开发者

how to get values sent by location.replace(URL)

开发者 https://www.devze.com 2022-12-30 10:33 出处:网络
In my JavaScript function I do like this in order to redirect parameters to s开发者_高级运维ervlet:

In my JavaScript function I do like this in order to redirect parameters to s开发者_高级运维ervlet:

var ids1=document.getElementById("projet").value;
document.location.href("http://localhost:8080/Opc_Web_App/ServletAffectation?ids1="+ids1);

and in the servlet I do the following to get Value:

String idprojet= request.getParameter("ids1");
System.out.println("le projet selectionné est :" +idprojet);

the problem that i didn't have the result of System.out.print in my screen; so in other terms the servlet didn't get the parameter.

I can not see the problem until now. Please help. Thank you.


It should be

String idprojet= request.getParameter("ids1");


What Matthew said or change the JavaScript to:

var projet=document.getElementById("projet").value;
document.location.href("http://localhost:8080/Opc_Web_App/ServletAffectation?projet="+projet);
0

精彩评论

暂无评论...
验证码 换一张
取 消