File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JS variable In JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JS variable In JSP " Watch "JS variable In JSP " New topic
Author

JS variable In JSP

Niklesh Mudiraj
Greenhorn

Joined: Jun 26, 2011
Posts: 12

Can we access variable/value of variable declare in JS in JSP page as we can use variable declare in JSP in JS .
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62279
    
  68

Niklesh Mudiraj wrote:Can we access variable/value of variable declare in JS in JSP page

No, of course not. JSP executes on the server, JavaScript on the client. They cannot mix and match.

Please read this article to find out how JSP works and why that could never be

as we can use variable declare in JSP in JS .

You cannot use JSP in JS either. See above.

You can use JSP to write JavaScript that is then sent to the browser, but you are not using the JSP variable in the JS.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JS variable In JSP