Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Another simple question  RSS feed

 
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:
 
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!