struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rula2005" <rudolf_l...@gmx.de>
Subject Re: tiles and forwards
Date Fri, 09 Jun 2006 13:01:33 GMT
Correct, i used the internal strutsAction:
org.apache.struts.actions.LocaleAction and the source could something like this,
which i found in the validator struts-example:

    public ActionForward execute(ActionMapping mapping,
                 ActionForm form,
                 HttpServletRequest request,
                 HttpServletResponse response)
    throws Exception {

    // Extract attributes we will need
    HttpSession session = request.getSession();
    Locale locale = getLocale(request);

    String language = null;
    String country = null;
    String page = null;

    try {
            language = (String)
              PropertyUtils.getSimpleProperty(form, "language");
            country = (String)
              PropertyUtils.getSimpleProperty(form, "country");
            page = (String)
              PropertyUtils.getSimpleProperty(form, "page");
        } catch (Exception e) {
           log.error(e.getMessage(), e);
        }

        if ((language != null && language.length() > 0) &&
            (country != null && country.length() > 0)) {
           locale = new java.util.Locale(language, country);
        } else if (language != null && language.length() > 0) {
           locale = new java.util.Locale(language, "");
    }

        session.setAttribute(Globals.LOCALE_KEY, locale);

        if (null==page) return mapping.findForward("success");
        else return new ActionForward(page);

    }

}
----- Original Message ----- 
From: "Antonio Petrelli" <brenmcguire@tariffenet.it>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, June 09, 2006 1:00 PM
Subject: Re: tiles and forwards


> Antonio Petrelli ha scritto:
>> Can you post the code of your action? At least the part when you 
>> return the forward in the "execute" method? I have a suspect.
> 
> Uh sorry, I didn't notice that you used an internal Struts action!
> Anyway let me think about it
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message