Re: Meta data in decorator

Scott Farquhar <[email protected]>
Newsgroups gmane.comp.web.sitemesh.general
Message-ID <[email protected]>
I found the problem.

We currently move the page object into the PAGE scope on first access.
This is so that you can use page:applyDecorator in decorators, and not
have it messed up.

If you use a non-static include, then you need to put your decorator tags
in the same include.

This can be worked around by editing AbstractTag, and commenting out a
line:

     60     protected Page getPage() {
     61         Page p = (Page)pageContext.getAttribute(PAGE, PageContext.PAGE_SCOPE);
     62
     63         if (p == null) {
     64             p = (Page)pageContext.getAttribute(PAGE, PageContext.REQUEST_SCOPE);
     65             if (p == null) {
     66                 pageContext.removeAttribute(PAGE, PageContext.PAGE_SCOPE);
     67             }
     68             else {
     69                 pageContext.setAttribute(PAGE, p, PageContext.PAGE_SCOPE);
     70             }
     71             //pageContext.removeAttribute(PAGE, PageContext.REQUEST_SCOPE);
     72         }
     73         return p;
     74     }

Cheers,
Scott

On Fri, Mar 26, 2004 at 11:18:19AM +1100, Mike Cannon-Brookes wrote:
> Hrm - that shouldn't make any difference.
> 
> Can you post some failing sample code of what you're trying to do?
> 
> Cheers,
> Mike
> 
> --
> ATLASSIAN - http://www.atlassian.com/
> 
> Confluence - the professional J2EE wiki - tried it yet?
> http://www.atlassian.com/confluence/
> 
> On 26/03/2004, at 6:41 AM, Matt Dowell wrote:
> 
> > Here's the file:
> >
> > <jsp:include page="head_inc.jsp"/>
> > <jsp:include page="title_inc.jsp"/>
> > <jsp:include page="body_inc.jsp"/>
> > <jsp:include page="footer_inc.jsp"/>
> >
> >
> > -----Original Message-----
> > From: Joe Walnes [mailto:[email protected]]
> > Sent: Thursday, March 25, 2004 1:38 PM
> > To: Matt Dowell
> > Cc: [email protected]
> > Subject: Re: [Opensymphony-sitemesh] Meta data in decorator
> >
> >
> > Ermm.. dunno.
> >
> > Which type of includes are you using? <%@ include ... %> or 
> > <jsp:include
> > ..>?
> >
> > Matt Dowell wrote:
> >
> >> Thanks everyone, I discovered the problem. If my decorator is made up
> >> of includes, it will not pull the meta data, if there are no includes.
> >> It works. Resin 2.1.9.
> >>
> >> Is this a Resin bug?
> >>
> >> Matt
> >>
> >>
> >> -----Original Message-----
> >> From: Joe Walnes [mailto:[email protected]]
> >> Sent: Thursday, March 25, 2004 1:08 PM
> >> To: Matt Dowell
> >> Cc: [email protected]
> >> Subject: Re: [Opensymphony-sitemesh] Meta data in decorator
> >>
> >>
> >> Matt Dowell wrote:
> >>
> >>
> >>
> >>> Has anyone ever gotten a decorator to pull data from a meta tag like
> >>> this:
> >>>
> >>> <meta name="author" content="[email protected]">
> >>>
> >>>
> >>>
> >>>
> >> Using JSP:
> >>    <decorator:getProperty property="meta.author"/>
> >>
> >> Using Velocity:
> >>    $page.getProperty("meta.author")
> >>
> >> Using Java:
> >>    page.getProperty("meta.author");
> >>
> >> -joe
> >>
> >>
> >>
> >> -------------------------------------------------------
> >> This SF.Net email is sponsored by: IBM Linux Tutorials
> >> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> >> GenToo technologies. Learn everything from fundamentals to system
> >> administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
> >> _______________________________________________
> >> Opensymphony-sitemesh mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/opensymphony-sitemesh
> >>
> >>
> >>
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: IBM Linux Tutorials
> > Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > GenToo technologies. Learn everything from fundamentals to system
> > administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
> > _______________________________________________
> > Opensymphony-sitemesh mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/opensymphony-sitemesh
> >
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
> _______________________________________________
> Opensymphony-sitemesh mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-sitemesh


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.