There are 2 ways to go about this

1) within Struts tags

use key=""

where your i8nl key should go in.

But for that to work your struts needs to know where all the i8nl values are
located.

Define a constant for it in struts.xml

or create a struts.properties to contain this

struts.custom.i18n.resources=package

where my i8nl file is called package.properties located in the same folder
where struts.xml is present

2) use fmt tag

JSTL tag for i8nl

<%...@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"; %>

<fmt:message key="authGroups.addTitle"/>

Make sure the jstl jar(s) are on your dependency list.

On Sat, Nov 28, 2009 at 1:53 AM, <mailtolouis2020-str...@yahoo.com> wrote:

> Hi,
>
> Can someone tell me how to make the label use my resource bundle value?
> I've tried this
> <s:textfield label="label.name" name="user.name" maxlength="35"
> theme="xhtml"/>
> and
> <s:textfield label="%{getText(label.name)}" name="user.name"
> maxlength="35" theme="xhtml"/>
> both are not working.
>
> But this work:
> <s:label key="label.name"/>
>
> in my resource bundle properties file
> I've this
> label.name = Name
>
> THanks
>
> L.V
>



-- 
Saeed Iqbal
http://www.iqbalconsulting.com
Struts - J2EE - Application Architect / Developer

Reply via email to