aspose file tools*
The moose likes JSP and the fly likes How to assign js variable to jsp variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to assign js variable to jsp variable" Watch "How to assign js variable to jsp variable" New topic
Author

How to assign js variable to jsp variable

shyam sunder prasad
Ranch Hand

Joined: Mar 23, 2011
Posts: 62


how to assign java script variable to jsp scriplet variable.

like jspName=name;

please help,thanks in advance.
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

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


SCJP6.0,My blog Ranchers from Delhi
shyam sunder prasad
Ranch Hand

Joined: Mar 23, 2011
Posts: 62
no i want fetch the data there it self
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

Its not possible.as the scope of javascript is within the page only where you are using it
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61226
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to assign js variable to jsp variable