I got caught out by thinking the packages were created in a different
package than I assumed they were, but I don't recall if it was my fault or
if there was a configuration parameter I had forgotten to set or what.

But just in case it helps, I'll throw it out there.

Man, I've forgotten a lot of stuff--I really need to de-rust myself :(

Dave

On Wed, Dec 1, 2010 at 4:15 PM, <stanl...@gmail.com> wrote:

> I had a guy ask me why his internationalized properties were not accessible
> in his Struts app that was using both the REST and Convention plug-ins.  My
> first action was to read the docs which did not suggest anything out of the
> ordinary, so I through a core app together using this configuration and
> sure
> enough the properties were not found!
>
> He is using
>
>    <constant name="struts.convention.action.suffix" value="Controller"/>
>
> So I figured an Action called FooController would find
> FooController.properties in the same folder as the FooController.class,
> which as it turns out did *not* work.  I set a breakpoint at the top of
> LocalizedTextUtil and the localist contains only the following two files
> [org/apache/struts2/struts-messages,
> com/opensymphony/xwork2/xwork-messages].  Shouldn't this collection include
> my FooController.properties on a request http://.../foo?  Including a
> message key from struts-messages works fine, however a key from
> FooController.properties returns the key itself as it is not being located.
>
>    public static String findDefaultText(String aTextName, Locale locale) {
>        List<String> localList = DEFAULT_RESOURCE_BUNDLES;
>
>        for (String bundleName : localList) {
>            ResourceBundle bundle = findResourceBundle(bundleName, locale);
>            if (bundle != null) {
>                reloadBundles();
>                try {
>                    return bundle.getString(aTextName);
>                } catch (MissingResourceException e) {
>                    // ignore and try others
>                }
>            }
>        }
>
>        return null;
>    }
>

Reply via email to