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
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply 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: 1046

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: 1046

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: 56168
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to assign js variable to jsp variable
 
Similar Threads
use javascript variable in JSP?
JS ---> JSP variables
server side and client side variables
how to call Jsp in servlet
Head First Servlets & JSP book - JSP Question