• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to assign js variable to jsp variable

 
shyam sunder prasad
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


how to assign java script variable to jsp scriplet variable.

like jspName=name;

please help,thanks in advance.
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This can be done effectively with the help of form submission..

Submit the form and then request goes to servlet and in servet set the request parameter,or session parameter as per your requirement

Get those parameter in your jsp scriplet
 
shyam sunder prasad
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i want fetch the data there it self
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not possible.as the scope of javascript is within the page only where you are using it
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65124
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a fundamental misunderstanding of what JSP is and how it works. Please read this article to see why what you are asking is completely impossible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic