• 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

Custom tags

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can I access variables in scriptlets in JSP?
 
Sheriff
Posts: 67746
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
This question is so vague as to be meaningless. And what does it have to so with custom tags?
But, using one possible interpretation of the question, yes you can create and reference local variables in Java scriptlets within a JSP. Any such scriplets become part the service method of the JSP-generated servlet.
bear
 
Jean Miles
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually the question is based on the topic 'Custom tags' can i reference variables that are defined in scriplets in Custom tags?
 
Bear Bibeault
Sheriff
Posts: 67746
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
More carefully-worded questions will get better answers.
To this one: no. While you can pass the values of scripting variables to custom tags through the attributes that allow run-time values, you cannot access scripting variables by name in custom tags.
Tacking values onto the page context as attributes is a common means of passing non-attribute info to tags. (Though I'd be cautious about doing so since you can create artificial bindings between your pages and tags that could limit the reusability of the tags).
bear
reply
    Bookmark Topic Watch Topic
  • New Topic