Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JS variable In JSP

 
Niklesh Mudiraj
Greenhorn
Posts: 12
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic