struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emi Lu <em...@encs.concordia.ca>
Subject Re: lost URL parameters with <s:param> tag
Date Tue, 20 Jul 2010 19:50:27 GMT

> Are you intending for these values to come from your application resource
> bundle?  That's where getText() gets it's values from.  I believe it it
> doesn't find anything it just returns whatever is passed to is, which might
> be why you're seeing what I expect you are expecting.
>
> If you are actually trying to test this out with static values (or use
> static values), try this instead (note the embedded single quotes within the
> double quoted, maybe cutting-n-pasting would work best)
>
> <s:param name="helpTitle"  value="'example1'"/>
> <s:param name="helpText" value="'example2'"/>

All right, I found the trick.

Workable solution:
========================
<s:param name="helpTitle"  value="%{'example1'}"/>
<s:param name="helpText"   value="%{'example2'}"/>

Thank you for all your help! Very helpful!

--
Lu Ying




> On Tue, Jul 20, 2010 at 12:20 PM, Emi Lu<emilu@encs.concordia.ca>  wrote:
>
>> On 07/20/2010 01:39 PM, Dale Newfield wrote:
>>
>>> On 7/20/10 11:48 AM, Emi Lu wrote:
>>>
>>>> It seems that "s:param" does not work well when more than one s:param is
>>>> assigned.
>>>>
>>>
>>> I use multiple param tags inside url tags all over the place. It does
>>> work. I would suggest running your application inside a debugger to find
>>> out what exactly is not working for you. One thing I would suggest is
>>> eliminating ambiguities -- value fields (for example) are going to be
>>> interpreted as OGNL, so if you want the ognl expression contents, then
>>> value="%{contents}" and if you want the string contents, then
>>> value="%{'contents'}".
>>>
>>
>> Thank you for all your inputs!
>>
>> Conclusion:
>> =================
>> (1) workable version:
>> <s:param name="helpTitle"      value="%{getText('example1')}" />
>> <s:param name="helpText"       value="%{getText('example2')}" />
>>
>> (2) this way, it does not work:
>>
>> <s:param name="helpTitle"      value="example1" />
>> <s:param name="helpText"       value="example2" />
>>
>> Frankly, I do *not* like way(1) since "%{getText('example2')}" is a very
>> long paragraph. I prefer to transfer key property and retrieve text in
>> Action Class.
>>
>> Anyhow, it seems that this is the current solution I could find for now.
>>
>> If you have better ideas, please let me know.
>>
>>
>> Thanks a lot!
>>
>> --
>> Lu Ying
>>
>> Note:
>> attribute.property
>> =====================
>> example1=Title info
>> example2=...... a very long paragraph ...
>>
>>
>> ---------------------------------------------------------------------
>> 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


Mime
View raw message