You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christian Priebe <di...@gmx.de> on 2009/01/10 03:28:55 UTC

[S2] Avoiding nested tags / Using Sitemesh properties within Struts 2 tags

Hey,

I want to use a sitemesh property got by the tag <decorator:getProperty property="paramName" /> within a Struts2 tag to make a special include dynamically controllable by the decorated content page. But as we all know a nested tag like

<s:include value="<decorator:getProperty property="paramName" />" />

won't work. Now my question:
What alternative do I have to achieve what I want (if there is a possibility at all) ?

I'm using Struts 2.0.14 with the sitemesh-plugin and neither Freemarker nor Velocity, just simple JSPs.


Thanks in advance,
Christian
-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Avoiding nested tags / Using Sitemesh properties within Struts 2 tags

Posted by Randy Burgess <rb...@ultiweb.com>.
I know this thread is a little old but maybe someone will find this useful.
The variable in this case, listEditEnabled, has to do with enabling editing
of an ajaxified list of items.

<c:set var="listEditEnabled">
    <sitemesh-decorator:getProperty property="meta.listEditEnabled" />
</c:set> 
<c:if test="${empty listEditEnabled}">
    <c:set var="listEditEnabled" value="true"/>
</c:if> 

I added a metatag to pages that I don't want listEditEnabled with a content
value of false, otherwise the value is true.

Randy Burgess

> From: Christian Priebe <ch...@prie.be>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Sat, 10 Jan 2009 20:30:32 +0100
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: [S2] Avoiding nested tags / Using Sitemesh properties within
> Struts 2 tags
> 
> Thanks Dave für your answer!
> 
> That's what I thought of first :) But I haven't found a solution yet.
> 
> Unfortunately there apparently isn't an accepted notation like <s:set
> name="dynInc" scope="request"><decorator:getProperty
> property="paramName" /></set>.
> The value can only be set by the value-attribute, right?
> 
> I hope there is another possibility. I didn't thought I'm the only one
> with such a need.
> 
> Thanks,
> Christian
> 
> 
> Dave Newton schrieb:
>> Christian Priebe wrote:
>>> <s:include value="<decorator:getProperty property="paramName" />" />
>>> 
>>> won't work. Now my question:
>>> What alternative do I have to achieve what I want (if there is a
>>> possibility at all)?
>> 
>> Is there a way to put the decorator properties into a JEE scope? If
>> so, you can just use OGNL.
>> 
>> Dave
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Avoiding nested tags / Using Sitemesh properties within Struts 2 tags

Posted by Christian Priebe <ch...@prie.be>.
Thanks Dave für your answer!

That's what I thought of first :) But I haven't found a solution yet.

Unfortunately there apparently isn't an accepted notation like <s:set 
name="dynInc" scope="request"><decorator:getProperty 
property="paramName" /></set>.
The value can only be set by the value-attribute, right?

I hope there is another possibility. I didn't thought I'm the only one 
with such a need.

Thanks,
Christian


Dave Newton schrieb:
> Christian Priebe wrote:
>> <s:include value="<decorator:getProperty property="paramName" />" />
>>
>> won't work. Now my question:
>> What alternative do I have to achieve what I want (if there is a 
>> possibility at all)?
>
> Is there a way to put the decorator properties into a JEE scope? If 
> so, you can just use OGNL.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Avoiding nested tags / Using Sitemesh properties within Struts 2 tags

Posted by Dave Newton <ne...@yahoo.com>.
Christian Priebe wrote:
> <s:include value="<decorator:getProperty property="paramName" />" />
> 
> won't work. Now my question:
> What alternative do I have to achieve what I want (if there is a possibility at all)?

Is there a way to put the decorator properties into a JEE scope? If so, 
you can just use OGNL.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org