Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling a JSP from a Javascript

 
Prashanth Nayak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Prashanth Nayak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 147
Debian Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the JavaScript variable "sIP" being assigned?

Prashanth Nayak wrote:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic