File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to pass a value from a JSP to Javascript on the same page.

 
Ramesh Shanmugam
Ranch Hand
Posts: 132
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to pass a value from a JSP to Javascript on the same page.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the server side, you need to write out the JavaScript that holds that information. Only way for JavaScript to get the info.

Eric
 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

A clarification needed here.....

Can't it be done in the client side itself? Do we really need to do it the .js at the server side?

Is there no way like var



Might sound silly, but to know that...

Cheers,
Swamy.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only way for the JSP to pass the value to the page is to dynamically write it to the page. It can be placed in a text field or written to a varaible, or place it in a cookie. There is really no other way to do it then those ways.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic