Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP with JavaScript  RSS feed

 
anuraag kb
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got a Jsp doubt.......i have passed a 2 dimensional string array from servlet into jsp using session.getAttribute()......is there any way to pass this 2-D array into a JavaScript function in the same jsp page...?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not directly. JSP runs on the server, JavaScript on the client. Please read this article to understand how JSP operates.

What you can do is to use JSP to "write" the JavaScript necessary to re-create the data on the page in JavaScript format.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!