You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Paul Benedict <pb...@apache.org> on 2007/03/14 05:11:04 UTC

[s2] Localization (with portlets)

I am getting back in gear to enhance localization for Struts 1, which I 
hope will prove useful for Struts 2 as well. One thing I need to know 
though is how the locale is determined for a portlet? Right now I have 
tied the getting/setting of the locale to the servlet objects, but this 
wouldn't be a good idea if the Portlet API has a getLocale() method. 
However, I haven't found such a method. So how does a S2 portlet app 
really get the locale?

Paul

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


Re: [s2] Localization (with portlets)

Posted by Antonio Petrelli <an...@gmail.com>.
2007/3/14, Nils-Helge Garli <ni...@gmail.com>:
> In a portlet, the locale can be fetched from the PortletRequest
> object. There is a snippet of code in the Jsr168Dispatcher that does
> this. Also, check out
> http://www.jdocs.com/portlet/1.0/api/index.html?javax/portlet/PortletRequest.html

In addition to it, you can get inspiration by Tiles, where portlet and
servlet requests are handled in a similar way, see:
http://tiles.apache.org/tiles-core/apidocs/org/apache/tiles/context/TilesRequestContext.html

HTH
Antonio

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


Re: [s2] Localization (with portlets)

Posted by Nils-Helge Garli <ni...@gmail.com>.
In a portlet, the locale can be fetched from the PortletRequest
object. There is a snippet of code in the Jsr168Dispatcher that does
this. Also, check out
http://www.jdocs.com/portlet/1.0/api/index.html?javax/portlet/PortletRequest.html

Nils-H

On 3/14/07, Paul Benedict <pb...@apache.org> wrote:
> I am getting back in gear to enhance localization for Struts 1, which I
> hope will prove useful for Struts 2 as well. One thing I need to know
> though is how the locale is determined for a portlet? Right now I have
> tied the getting/setting of the locale to the servlet objects, but this
> wouldn't be a good idea if the Portlet API has a getLocale() method.
> However, I haven't found such a method. So how does a S2 portlet app
> really get the locale?
>
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

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