struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Alfors" <peter.alf...@hksystems.com>
Subject Re: Dynamically obtaining component definition name
Date Tue, 02 Oct 2001 16:07:55 GMT
he should send an email to:

    struts-user-unsubscribe@jakarta.apache.org

to unsubscribe himself.



Mark Backstrom wrote:

> Please unsubscribe Trevor Lewis from this distribution.   He may be
> receiving it under trevorl@discovermusic.com
>
> Thanks,
>
> Mark Backstrom
> Systems Support Engineer
> Loudeye Technologies
>
> -----Original Message-----
> From: Cedric Dumoulin [mailto:cedric.dumoulin@lifl.fr]
> Sent: Tuesday, October 02, 2001 9:01 AM
> To: struts-user@jakarta.apache.org
> Subject: Re: Dynamically obtaining component definition name
>
>   Hi Sean,
>
>   Actually, there is nothing to obtain the name of the definition used to
> insert Component/Tile.
>   Even if such mechanism exist, you will not get what you want from within
> 'top.jsp', because you are one level behind "site.default".
>
>   You can effectively put an attribute carrying the name. But you need to
> pass if to top.jsp when you insert it.
>   This can be done in site-template.jsp with something like :
>
>   <tiles:insert name="top" >
>     <tiles:put name="name" beanName="name" beanScope="template" />
>   </tiles:insert>
>
>     Cedric
>
> Sean wrote:
>
> > I have a definition something like this:
> >
> > <definition name="site.default"
> > template="/WEB-INF/views//site-template.jsp">
> >    <put name="top"      content="/WEB-INF/views/top.jsp" />
> >     <put name="left"     content="/WEB-INF/views/left.jsp" />
> >    <put name="content"  content="/WEB-INF/home.jsp" />
> >     <put name="right"    content="/WEB-INF/right.jsp" />
> >    <put name="bottom"   content="/WEB-INF/bottom.jsp" />
> >   </definition>
> >
> > from within the top.jsp and left.jsp I want to obtain the "name" of
> > the calling compontent definition to do something.  Is this possible?
> > short of creating a new attribute and putting that in the definition
> > like:
> >
> >     <put name="name" content="site.default"/>
> >
> > Is there a way to get a hold of this variable? Any help would be
> > appreciated.
> >
> > Sean

Mime
View raw message