This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes How to pass input values to the JSP using POST method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to pass input values to the JSP using POST method" Watch "How to pass input values to the JSP using POST method" New topic
Author

How to pass input values to the JSP using POST method

Prashanth Nayak
Greenhorn

Joined: Dec 19, 2011
Posts: 4
One of the test html has the below code where it calls the sample.jsp using POST method.
The problem here that the SOP in the sample.jsp is coming as null . I am suspecting that name-value passed in the below html is not the correct way . Pardon my knowledge on few basics but can someone tell how to pass the value to JSP if this is not the correct way
I need the SOP to be printed which gets the sIP value passed to it .


check.html:
==========


sample.jsp:
==========

JSP which is invoked i.e sample.jsp is this way


Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

You never add the input field to the form, or anywhere else in the document. You need to explicitly add it, using appendChild:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to pass input values to the JSP using POST method