struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grish <gin1...@hotmail.com>
Subject Re: [S2] Access a SiteMesh Object in a Struts tag
Date Mon, 22 Oct 2007 03:37:12 GMT

After going through the OGNL documents and trial and error I was able to get
the properties from the page object from sitemesh using the following code:

<decorator:usePage id="myPage" />
<s:set name="currentNav"
value="%{#attr.myPage.getProperty('meta.currentNav')}" />

Hope this is of some use to someone out there :)


Grish wrote:
> 
> So I tried the following:
> 
> <decorator:usePage id="myPage" />
> <% String current = myPage.getProperty("meta.current"); %>
> <s:set name="currentPage" value="#attr.current" />
> <!-- <s:property value="#currentPage" /> -->
> 
> but this displays blank. What I want to do is get the property from the
> Page object of sitemesh and make it accessible to my s2 tags. I was
> reading about OGNL and the syntax but i can't seem to get that property.
> Is my syntax incorrect?
> 
> 
> Grish wrote:
>> 
>> Hi,
>> 
>> I was wondering if this is possible, I want to access a SiteMesh object
>> in a struts tag like the set tag:
>> 
>> I want to access the Page object from SiteMesh and get a property from
>> that object and assign it a value
>> 
>> <decorator:usePage id="myPage" />
>> 
>> <s:set name="currentPage" value="" />
>> 
>> where value would be myPage.getProperty("meta.curentPage").
>> 
>> I have a feeling i'm just using incorrect syntax. Can anyone point me to
>> the right direction?
>> 
>> Thanks!
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Access-a-SiteMesh-Object-in-a-Struts-tag-tf4646229.html#a13336246
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message