This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!
  • 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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!