struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Maritato <marit...@yahoo-inc.com>
Subject Re: setting a var with dynamic content
Date Mon, 24 Nov 2008 19:36:33 GMT
That worked! Thanks Musachy! For reference, since my variable name is a 
concatenation of a variable and a string I had to do this:

<s:set name="superName" value="%{'something'+obj.id}"/>

for the initial s:set.

Musachy Barroso wrote:
> You cannot nest %{}, this could be a way of doing it:
> 
> <s:set name="superName" value="%{'something'}"/>
> <s:set name="%{#superName}" value="'test'"/>
> <s:property value="%{#request[#superName]}" />
> 
> musachy
> 
> 
> On Mon, Nov 24, 2008 at 1:28 PM, Frank Maritato <maritatf@yahoo-inc.com>wrote:
> 
>> ok, so I'm able to verify that:
>>
>> <s:set name="something_%{obj.id}" value="'test'"/>
>>
>> sets the variable name as I want it. I can verify by printing it out with
>> property with a hardcoded value like this:
>>
>> <s:property value="something_12345" />
>>
>> but I cannot figure out how to do it without using the hardcoded id. I've
>> tried the following:
>>
>> <s:property value="something_%{#obj.id}" />
>> <s:property value="#something_%{obj.id}" />
>> <s:property value="something_%{obj.id}" />
>> <s:property value="%{something_#obj.id}" />
>> <s:property value="something_#obj.id" />
>>
>> but nothing works. Can anyone help here?
>>
>>
>>
>>
>> Frank Maritato wrote:
>>
>>> I need to set a variable that is specific to the object id I'm working
>>> with. I tried something like this:
>>>
>>> <s:set name="something_%{obj.id}" value="'test'"/>
>>>
>>> and then later in the page:
>>>
>>> <s:property value="#something_%{obj.id}" />
>>>
>>> but didn't get anything. Is there a different way to do this?
>>>
>> --
>> Frank Maritato
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 

-- 
Frank Maritato

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


Mime
View raw message