aspose file tools
The moose likes JSP and the fly likes JS variable In JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Reply 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: 10

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

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.


[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: JS variable In JSP
 
Similar Threads
want to access an arraylist of jsp in javascript
Calling constants from another file in JS
Jsp & Javascript
JS variable to JAVA
Assigining java variable to java script variable