Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create nested tag files, which pass information from outer to inner

 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create nested tag files, which pass information from outer to inner.

I tried the following

Parent tag called repeater.tag as given below


Child tag is header.tag as given below


Now my test.jsp has the following content


I was expecting the the out put as Header = true
but it doesn't happen because header.tag doesn't know anything about the EL variable .

I am confused .
I am setting setHeader as a EL varaible and it has a NESTED scope in the repeater.tag

header.tag is nested inside the repeater so theoretically the EL variable must be accessible for it isn't it ?

But I am wrong why ? & Where ?
Do you have an idea ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't tell much about it, but I suspect that the variable is made available in the tag and its caller page. The header tag uses its own page context, that would be why you can't access the variable. I don't remember if there's a way to synchronize variables for inner tag files...
If you can't find out how to do it, you could use an attribute for the header tag. The spec also recommends that for IN parameters, you should use attributes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic