Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sending request parameters in JSP using Ajax

807601May 7 2008 — edited May 7 2008
Hi

Below is a code snippet in JSP
<form name="test">
<input name="fname" value="changeMe" onchange="AjaxCalling()"/>
</form>
Ajaxcalling() is a javascript function using ajax.
where i am sending a request to another JSP page, which will read the request parameter "changeMe".

AjaxCalling()
// sending request
ajaxObject.open("get", "second.jsp", true);
ajaxObject.send(null);
but in Second.jsp when i am trying to read request parameter
request.getParameter("fname");
It is giving NULL.

This works fine if i am not using ajax as below :
<form name="test" action="second.jsp" method="get">
<input name="fname" value="changeMe"/>
<input type="submit" value="submit"/>
</form>
Please help me out.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2008
Added on May 7 2008
1 comment
2,327 views