Two Laptop Bag*
The moose likes JSP and the fly likes Calling a JSP from a Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Calling a JSP from a Javascript" Watch "Calling a JSP from a Javascript" New topic
Author

Calling a JSP from a Javascript

Prashanth Nayak
Greenhorn

Joined: Dec 19, 2011
Posts: 4
Hi All ,
I have a javascript where I have some values to be passed as hidden values . I am doing a form.submit using post method in it.
I need to pass those values to the jsp which is invoked from the javascript itself .
Now , how do I invoke the URL along with those values passed to it .
I am doing a window.open but I am not able to pass the values to the jsp .
Any help is appreciated .
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Are you doing a window.open or a form submit. You say that you are going both, but you can;t do both at the same time.

If you want the values to be submitted, you'll need to set them as values of form elements (such as hidden elements).

For window.open, pass them as a query string on the URL.

That assumes you can figure out which one you want to do.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Prashanth Nayak
Greenhorn

Joined: Dec 19, 2011
Posts: 4
Hi Code goes something like this






In the JSP I am doing this




From the resin logs I can see that I am sample.jsp is accessed but the values are not passed to it. Can you please help .
Pete Nelson
Ranch Hand

Joined: Aug 30, 2010
Posts: 147

Where is the JavaScript variable "sIP" being assigned?

Prashanth Nayak wrote:


OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling a JSP from a Javascript
 
Similar Threads
Passed
Passed SCJP
Javascript not detecting argument passed by JSP code
Passed with 83%
passed! :)