• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
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 ?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • 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.
 
I don't always make ads but when I do they're tiny
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic