[Seasar-user:17491] Re: [Teeda] アプリの実装でロケールを変更すること

thomas [E-MAIL ADDRESS DELETED]
2009年 5月 20日 (水) 14:38:04 JST


小林さん、

Thanks for your reply,

I got the solution from your reply.






2009/5/20 Koichi Kobayashi <[E-MAIL ADDRESS DELETED]>

> 小林 (koichik) です.
>
> Date:    Wed, 20 May 2009 00:04:24 +0900
> From:    thomas <[E-MAIL ADDRESS DELETED]>
> To:      [E-MAIL ADDRESS DELETED]
> Subject: [Seasar-user:17488] [Teeda] アプリの実装でロケールを変更すること
>
> >                 if*
> >
> (request.getLocale().getLanguage().equals((String)session.getAttribute("language"))
> > *){
> >                     System.out.println("same");
> >                    * chain.doFilter(request,response);*
> >                     return;
> >                 }
> >                 else{
> >
> > *//How can i change the locale here*
>
> I wrote in [Seasar-user:17460]
> > > 2. Filter create a wrapper for an HttpServletRequest.
> > > 3. getLocale() and getLocales() methods of the wrapper
> > >    return the Locale from an HttpSession.
>
> then
>
>                      final Locale locale = new Locale((String)
> session.getAttribute("language"));
>                      request = new
> HttpServletRequestWrapper((HttpServletRequest) request) {
>                          public Locale getLocale() {
>                              return locale;
>                          }
>                          public Enumeration getLocales() {
>                              Vector v = new Vector();
>                              v.add(locale);
>                              return v.elements();
>                          }
>                      };
>
>
>
>
> --
> <component name="koichik">
>    <property name="fullName">"Koichi Kobayashi"</property>
>    <property name="email">"[E-MAIL ADDRESS DELETED]"</property>
>    <property name="blog">"http://d.hatena.ne.jp/koichik"</property>
> </component>
>
> _______________________________________________
> Seasar-user mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/seasar-user
>
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: <http://ml.seasar.org/archives/seasar-user/attachments/20090520/6b209bf2/attachment.html>


Seasar-user メーリングリストの案内