Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Another simple question  RSS feed

 
shaju joseph
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form with couple of fields. If I submit the form to a servlet ( action="aaaservlet"), then I can access the value of the form fields by request.getParameter ("something"). But if I submit the form to a JSP page I am not able to access the form values by request.getParameter function. Am I missing something ?
Thanks for any clarifications. :roll:
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by shaju joseph:
But if I submit the form to a JSP page I am not able to access the form values by request.getParameter function. Am I missing something ?

You should be able to access the Parameters using the same function -- can you post a simplified version of your code that DOES work with a servlet, and the code that DOES NOT work with a JSP?
 
shaju joseph
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. Here is what I am trying to do. I am running this on Jrun.
test.jsp
--------
<html>
<body>
<form action="/test/jsp/testresult.jsp" method="POST">
<table>
<tr>
<td>
<input type=text name="SomeThing" >
</table>
<input type=submit>
</form>

</body>
</html
testresult.jsp
--------------
<html>
<body>
<table>
<tr>
<td>
<input type=text value=<% request.getParameter("SomeThing"); %>>
</table>
</body>
</html>
 
shaju joseph
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I figured it out.
It should be
<input type=text value=<%=request.getParameter("SomeThing"); %>>
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nice catch. -- glad you figured it out
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!