> -----Original Message----- > From: Martin Gainty > Sent: Tuesday, May 31, 2011 15:50 > To: Struts Users Mailing List > Subject: RE: Dynamic text > > <snip/> > > <!-- this from the german site lailuna (originally targeted > for Struts1) --> > http://www.laliluna.de/articles/struts-message-resources-tutorial.html
His issue was not on where and how to access properties in struts2, but rather an OGNL issue of how to access his getter in the action in %{} notation. > > Martin <snip/> > > Action has method (could return different value than 'goodbye') > > > > public String getMyKey() { > > return "goodbye"; > > } > > > > > > resource file has keys: > > hello=Hello There! > > goodbye=See you later! > > > > page has tags: > > <s:text name="hello" /> This works fine <br /> <s:text > > name="%{getMyKey}" /> Nope <br /> <s:text name="#getMyKey" /> Nope <br > > /> > > > > > > <s:property value="getMyKey" /> This returns nothing <br /> > > <s:property value="%{getMyKey}" /> This returns nothing <br /> > > <s:property value="getText(#getMyKey)" /> This returns > nothing <br /> Note the use of %{getMyKey}... It should read as %{myKey} or %{getMyKey()} > > > > > > > > > > > > > > On 31/05/2011 15:38, Jason Pyeron wrote: > > >> -----Original Message----- > > >> From: Marcus Bond > > >> Sent: Tuesday, May 31, 2011 10:26 > > >> To: Struts Users Mailing List > > >> Subject: Dynamic text > > >> > > >> Hi, > > >> > > >> I want to use some view objects in my action that will contain > > >> resource keys and then show these using s:text to > resolve the key > > >> to it's translation.. Is this type of thing supported? I > know a lot > > >> of tags moan if you try and use any ${foo.bar} type arguments > > > Have you taken a look at > > > http://struts.apache.org/2.x/docs/localization.html > > > yet? > > > > > > If so could you please post a specific problem? > > > > > > -Jason > > > > > > > > > -- > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > > > - - > > > - Jason Pyeron PD Inc. http://www.pdinc.us - > > > - Principal Consultant 10 West 24th Street #100 - > > > - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - > > > - - > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > > > This message is copyright PD Inc, subject to license 20080407P00. > > > > > > > > > > > > > > > > -------------------------------------------------------------------- > > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100 - - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org