struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Yang <kenshin...@gmail.com>
Subject Re: Localice text through hierarchy.
Date Fri, 21 Jan 2011 05:09:12 GMT
IIRC, LocalizedTextUtil looks for package according to the Class hierarchy.
What I mean is if your MyAction extends Struts' ActionSupport then after
looking a MyAction.properties and the package.properties in the same package
it will be looking for ActionSupport.properties and package.properties in
the same package as ActionSupport, then so on.

So I am not sure if LocalizedTextUtil actually looked for the
package.properties in com.acme, unless MyAction extends some action or
implements some interface in that package.

Also I dont think it will ever look in the to package.properties in your
root unless your action extends some class in there which i doubt.

if you want to make the package.properties in root global you should use
"struts.custom.i18n.resources" in struts.properties or struts.xml

please correct me if i am wrong

On Thu, Jan 20, 2011 at 10:47 PM, JOSE L MARTINEZ-AVIAL <jlmagc@gmail.com>wrote:

> Anyone has any idea how to avoid this?.
>
> Thanks
>
> JL
>
> 2011/1/17 JOSE L MARTINEZ-AVIAL <jlmagc@gmail.com>
>
> > Hi,
> >     I'm using Struts 2.1.8.1, and I've found an odd behaviour in the way
> > LocalizedTextUtil looks for a text. The situation is a follows:
> >
> >  package.properties
> > com/
> >     acme/
> >         package.properties
> >         actions/
> >             MyAction.
> >
> >     So I have two package.properties, one at the root directory, and the
> > other one in com.acme. MyAction is trying to use a text defined in the
> first
> > one, but it seems that once LocalizedTextUtil  has located
> > com.acme.package.properties, and not found the text, it doesn't try to go
> up
> > in the hierarchy, and therefore it does not return the text. Is that
> > behaviour correct?
> >
> >     Thanks
> >
> > Jose Luis
> >
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message