This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sending a variable set in java tag library definition to jsp file  RSS feed

 
shriya hegde
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am working on some enhancement on application which was written 15 yrs back. I have a requirement. The flow is as below

In a jsp file one selection dropdown exists and a body.
Selection dropdown is written as custom tag library and is included in jsp file eg tag.tld whose code exists in tag.java
code for other parts of jsp are written in that *.jsp file itself. eg test.jsp

i.e test.jsp calls tag.tld to include selection dropdown

I now want a hashmap created in tag.java to be available in jsp file and I want to use it in one of the javascript function available in same jsp file for validation

How can I achieve this
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Making it available to the JSP is as easy as creating a scoped variable.

JavaScript executes on the client and has no access to server-side data. You'll need to use the JSP to create JavaScript constructs that contain the data.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!