struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wes Wannemacher" <w...@wantii.com>
Subject Re: Resource Bundles and token replacement
Date Thu, 13 Dec 2007 02:16:24 GMT
I could be wrong, but if you are using the s:text tag, you can specify
an s:param that will be used. I could be wrong, and hopefully someone
will correct me if I am but -

<s:text name="mesage.key">
    <s:param>Mr. Smith</s:param>
</s:text>

package.properties -
message.key=Hello {0}

The docs aren't real specific on it, but there is some information here -
http://struts.apache.org/2.0.11/docs/text.html

On 12/12/07, Alberto A. Flores <aaflores@gmail.com> wrote:
> In struts 1.x, a resource bundle can have:
>
> errors.required={0} is required.
>
> And the validation.xml files will have a param set to the token (key) to
> be plugged in the {0} variable. Is there such a functionality in Struts 2?
>
> I have been able to only print one resource bundle using the key
> attribute in the <message key=""> tag. The closes I've made it is to
> display the name of the validated field doing:
>
> errors.required=${getText(fieldName}} is required.
>
>
> If the only alternatively is to write my own template, can someone point
> in the right direction in where, how to get started.
>
> Hope this is not a big question.
>
> Thanks,
>
>
> --
>
> Alberto A. Flores
> http://www.linkedin.com/in/aflores
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


-- 
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

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


Mime
View raw message