This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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: 19651
    
  18

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
 
Don't get me started about those stupid light bulbs.
 
subject: How to pass input values to the JSP using POST method
 
Similar Threads
Javascript function trying to access Scriptlet value
POSTing data from an applet
How to pass input values to the JSP using POST method
Calling a JSP from a Javascript
YUI listener problem