Could you put the "tricky & deep" dive code in your action and use simple OGNL expressions on your pages? I find when web pages start looking like myObj.someSubList(X).someSubMap[Y](Z).subObj.fieldName I am writing complex code in the *wrong* place. Remember what the web page is for... presentation!
Scott On Fri, Feb 15, 2008 at 5:51 AM, Maxx <[EMAIL PROTECTED]> wrote: > Hello, > > As I wasn't able to find this out at the moment, I'm posting my question > here : > > Would it be possible, within Struts2 tags, to evaluate a (String) > property which contains the OGNL expression referring to an other > property?? > > Example : > > <s:set name="testValue" value="%{12}" /> > testValue = <s:property value="#testValue" /> // print 1 > <s:set name="testValueName" value="%{'testValue'}" /> > testValueName = <s:property value="#testValueName" /> // print > testValue > > testValue (via xxxName) = <s:property value="%{%{#testValueName}}" > /> > // print nothing!!! > > > Why I'm wanting this ? > This might be tricky but because I'm getting complex OGNL expressions like > myObj.someSubList(X).someSubMap[Y](Z).subObj.fieldName > > I'd like to set my OGNL "prefix" with a simple set > <s:set name="myPrefix" > value="%{'myObj.someSubList(X).someSubMap[Y](Z).subObj.'}" /> > and then for each property call use something like > %{#myPrefix + 'fieldName'} > > But unfortunately I'm unable to make it work at the moment. > > Could please someone explain me what I'm doing wrong? > > Thanks, > Maxx > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Scott [EMAIL PROTECTED]