These steps should reproduce the issue:
1. There needs to be ApplicationResources localization files that contain
the key used for this test for at least two languages, one of which is the
default VM locale.
2.Put the following snippet into a jsp, action naturally has to extend
ActionSupport:
<s:text name="test.key" />
<s:property value="%{getText('test.key')}" />
3. Using 'locale' GET parameter, change the application language into a
language that is not the default.
4. Go to jsp page. The two tags should print out different localizations.
The one using getText will print out the one in default language.
On Tue, May 27, 2008 at 5:09 PM, Matt Raible <[EMAIL PROTECTED]> wrote:
> Can you please provide the steps necessary to reproduce this issue?
>
> Thanks,
>
> Matt
>
> On Tue, May 27, 2008 at 2:01 AM, Jukka Välimaa <[EMAIL PROTECTED]>
> wrote:
> > Hi all,
> >
> > I'm using Appfuse 1.01, with most of the changes of 1.02 included. The
> > archetype is Struts 2 modular.
> >
> > My problem is that using getText() method in the jsp doesn't work
> properly;
> > it doesn't get the correct localization. All other methods, including
> using
> > getText() before result is rendered, work perfectly fine. But getText(),
> > when used in jsp, returns a locale that is different from the one
> selected
> > in the application. It seems to select the locale based on the locale of
> > server environment. When I removed the following lines from web.xml,
> getText
> > method used in jsps continued to work, despite all other localizations
> being
> > out:
> >
> >>
> >> <!-- Define the basename for a resource bundle for I18N -->
> >> <context-param>
> >>
> >> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
> >> <param-value>ApplicationResources</param-value>
> >> </context-param>
> >> <!-- Fallback locale if no bundles found for browser's preferred
> >> locale -->
> >> <!-- Force a single locale using param-name
> >> 'javax.servlet.jsp.jstl.fmt.locale' -->
> >> <context-param>
> >>
> <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
> >> <param-value>en</param-value>
> >> </context-param>
> >
> > According to a friend, the same problem exists in Appfuse showcase. Any
> idea
> > what might be causing this and how to fix it?
>