Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make a variable available across tag files?

 
Shraddha Jain
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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?
 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
so there is a better way to do this then? would be gr8 if you'd share your idea!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic