struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stanlick <>
Subject Re: Internationalization with REST/Convention plug-ins
Date Wed, 01 Dec 2010 21:47:38 GMT

de-rust?  That's awesome.  I personally am afraid to see what might be
lurking under all my rust.

There is a struts.convention.package.locators set to the top-level folder in
the class hierarchy.  One thing that I found interesting though, I added the
struts2-config-browser-plugin hoping to get a better look at the runtime and
discovered the url .../foo/config-browser/index.action throws a 404.  When I
removed the index.action I get the following stack trace.  You know, all
these plug-ins are great, but debugging this or that combination being used
is a PITA!

java.lang.IllegalArgumentException: The index() is not defined in action
class com.opensymphony.xwork2.ActionSupport




Dave Newton-6 wrote:
> 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, <> 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
>> 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 on a request http://.../foo?  Including a
>> message key from struts-messages works fine, however a key from
>> 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;
>>    }

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message