Re: Processing value of decorator:getProperty in JSP-scriplet

Joe Walnes <[email protected]> Wed, 20 Apr 2005 20:11:19 +0100
Newsgroups gmane.comp.web.sitemesh.general
Message-ID <[email protected]>
On 4/15/05, Rick Gruber-Riemer <[email protected]> wrote:
> Hi
> 
> Having read the thread "Thread: Removing meta tags from source" I am a bit confused. Isn't it possible to use the value of at meta-tag submitted by the to be decorated page in a JSP-decorator for processing? If yes: how do I do this using JSP-technology?
> 
> E.g.
> # I get an ASP page foo.asp (-> being an externalIy developed webpage, I cannot use the technique to programmatically set something in the request as suggested in another with setAttribute(..))
> # In foo.asp there is a meta-tag: <meta name="rightbox" content="true" />
> # In my jsp-decorator could retrieve the value of the meta-tag with: <decorator:getProperty property="meta.rightbox" default="false" />
> # I want to assign the value of the metatag to a variable in a JSP-scriplet like this (i.e. using the value for processing, not directly for output):
> <%
> boolean foo;
> foo = Boolean.parseBoolean(<decorator:getProperty property="meta.rightbox" default="false" />);
> if (foo) {
>         out.println("Hello");
> }
> %>

This is how you do it:

<decorator:usePage id="content" />
<%
boolean foo = content.getBooleanProperty("meta.rightbox");
if (foo) {
       out.println("Hello");
}
%>

thanks
-Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]