You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Rick Ross <rr...@stupendousman.com> on 2003/09/09 19:05:12 UTC
Accessing the wrapped context from a tag file.
Hi all,
I have a simple jsp that I used to include statically to pages when I
needed to see what variables were in all of the implicit objects
(parameters, session etc). For example:
<table>
<c:forEach items='${pageScope}' var='page'>
<tr><th>${page.key}</th><td>${page.value}</td></tr>
</c:forEach>
</table>
Now I want to convert it to a tag file, but the problem is that the
pageScope inside a tag file is a fresh clean pageScope, as demanded by
the Spec. I want access to the original pageScope as well. Any one
know if this scope is available via the EL?
Thanks,
Rick
Re: Accessing the wrapped context from a tag file.
Posted by Rick Ross <rr...@stupendousman.com>.
Thanks. I guess I'll write the tag... bummer. I suspect that the
'outer' scope should be made available, surely there will be other use
cases for it.
R
Serge Knystautas wrote:
> Rick Ross wrote:
>
>> Hi all,
>>
>> I have a simple jsp that I used to include statically to pages when I
>> needed to see what variables were in all of the implicit objects
>> (parameters, session etc). For example:
>> <table>
>> <c:forEach items='${pageScope}' var='page'>
>> <tr><th>${page.key}</th><td>${page.value}</td></tr>
>> </c:forEach>
>> </table>
>>
>> Now I want to convert it to a tag file, but the problem is that the
>> pageScope inside a tag file is a fresh clean pageScope, as demanded
>> by the Spec. I want access to the original pageScope as well. Any
>> one know if this scope is available via the EL?
>
>
> This doesn't really have anything to do with EL. You can't access
> this other scope. Alternatives might be:
> 1. iterate through the pageContext attributes and store them in a Map
> in a request attriubte.
> 2. create a custom tag instead of an include file. then the tag would
> exist in the same page scope.
> 3. do a static include, so you're just inlining that separate file and
> you stay in the same page scope.
>
Re: Accessing the wrapped context from a tag file.
Posted by Serge Knystautas <se...@lokitech.com>.
Rick Ross wrote:
> Hi all,
>
> I have a simple jsp that I used to include statically to pages when I
> needed to see what variables were in all of the implicit objects
> (parameters, session etc). For example:
> <table>
> <c:forEach items='${pageScope}' var='page'>
> <tr><th>${page.key}</th><td>${page.value}</td></tr>
> </c:forEach>
> </table>
>
> Now I want to convert it to a tag file, but the problem is that the
> pageScope inside a tag file is a fresh clean pageScope, as demanded by
> the Spec. I want access to the original pageScope as well. Any one
> know if this scope is available via the EL?
This doesn't really have anything to do with EL. You can't access this
other scope. Alternatives might be:
1. iterate through the pageContext attributes and store them in a Map in
a request attriubte.
2. create a custom tag instead of an include file. then the tag would
exist in the same page scope.
3. do a static include, so you're just inlining that separate file and
you stay in the same page scope.
--
Serge Knystautas
President
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. sergek@lokitech.com