• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic