Hi stephan,

I see you solved your issue regarding resource bundle.

I am having a problem where intermittently the resource bundles get lost and
instead of seeing values on the browser...we start seeing actual properties
like: my.label.name.


using the execute method for your code below...is there any way to find out
whether a resource file named "MyResources" is loaded in the session?


On Thu, Jan 28, 2010 at 2:07 PM, Stephan R. Mueller <
stephanr.muel...@stud.leuphana.de> wrote:

> Hi list,
>
> I'm using struts 2.1.8 with JDK6
>
> I've Message.properties | Message_de_DE.properties
> and Message_en_US.properties.
>
> When switching the local via a browser plugin everything
> works fine and I can see that Session.WW_TRANS_I18N_LOCALE
> contains the expected locale (de_DE or en_US).
> Now I've added a languages.jsp that contains 2 links
> Constructed like this:
> <s:url id="url" action="./languages">
>            <s:param name="request_locale">en_US</s:param>
>        </s:url>
>        <s:a href="%{url}">English</s:a>
>    </li>
>    <li>
>        <s:url id="url" action="./languages">
>            <s:param name="request_locale">de_DE</s:param>
>        </s:url>
>        <s:a href="%{url}">Deutsch</s:a>
>
> When using one of these links I can see that
> Session.WW_TRANS_I18N_LOCALE changes it's value
> accordingly but the displayed language stays the same and
> doesn't change.
> languages.jsp uses an action like the following:
> --snip-
> public class LanguagesShowAction extends ActionSupport implements
> ServletRequestAware {
>
>        HttpServletRequest request;
>        private Map<String, Object> application;
>        private Map<String, Object> session;
>
>        public String execute() {
>
>                application = ActionContext.getContext().getApplication();
>                session = ActionContext.getContext().getSession();
>                session.put("referer", "languages");
>
>                String localeParam = request.getParameter("request_locale");
>
>                System.out.println("localeParam = " + localeParam);
>
>                if (localeParam != null && !localeParam.isEmpty()) {
>                        return "localeChngd"; //used to redirect to another
> jsp
>                }
>                System.out.println("loading languages page");
>                return SUCCESS;
> ---snap---
>
> Any ideas on what I may have done wrong?
> Additional info needed?
>
> Regards,
> Stephan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to