• 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

how to make a variable available across tag files?

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to use a boolean attribute , which i set in a tag file A inside another tag file B which is nested in A, i tried doing this by jspContext.setAttribute("header",new Boolean("true"), PageContext.PAGE_SCOPE); in tag File A,
then using
jspContext.getAttribute("header",PageContext.PAGE_SCOPE); in tag file B. but this isnt helping at all! any suggestions?
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you use this page attribute in tag file A
<%@variable name-given="header" variable-class="java.lang.Boolean" scope="AT_BEGIN"%>
then set the attribute like you are doing in Tag file A.

Yu will be able to get it in Tag file B.

By the way if i were you i would avoid the use of scriptlets.
 
Shraddha Jain
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so there is a better way to do this then? would be gr8 if you'd share your idea!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic