[jboss-user] [JBoss Portal] - Re: HOW to change Locale in Program?

2008-02-23 Thread littleprince
I m facing the same problem. I have the difficulties of getting the session at 
portlet or LocaleInterceptor from httpSession.


i set the value at attribute of a servlet

  | public void doPost(HttpServletRequest req, HttpServletResponse resp)
  | throws ServletException, IOException {
  | try{
  |  req.getSession().setAttribute(value, value1);
  |  resp.sendRedirect();
  | }catch(Exception e){}
  | 
  | }
  | 

and i try to get the value from portlet by the code below and it fails to get 
the value also.


  | rRequest.getPortletSession(true).getAttribute(value, 
PortletSession.APPLICATION_SCOPE))
  | 

or at LocaleInterceptor, the below line also gave me error.

  | req.getContext().getClientRequest().getSession();
  | 

Anyone can advise me on this?
Thanks in advance.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4131614#4131614

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4131614
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal] - Re: HOW to change Locale in Program?

2008-02-22 Thread jvence
zaza wrote : Thx for your reply. 
  | 
  | But could you tell me how to adapt or change the class LocaleInterceptor?
  | (if i want to store it in session)
  | 
  | 
  | Thx 

Did you ever to get this working? Thanks

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4131538#4131538

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4131538
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal] - Re: HOW to change Locale in Program?

2007-03-21 Thread qqqqzaza
Thx for your reply. 

But could you tell me how to adapt or change the class LocaleInterceptor?
(if i want to store it in session)


Thx 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4030149#4030149

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4030149
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal] - Re: HOW to change Locale in Program?

2007-03-21 Thread qqqqzaza
i have changed  LocaleInterceptor.java.. 

there is another struts ChangeLocale program which will set locale to session 

but it seems not workhelp..

public class LocaleInterceptor extends ServerInterceptor
{
/** The logger. */
   protected Logger log = Logger.getLogger(getClass());


   protected void invoke(ServerInvocation invocation) throws Exception, 
InvocationException
   {
  ServerRequest req = invocation.getRequest();
//  Locale locale = req.getContext().getClientRequest().getLocale();

  HttpSession session =  req.getContext().getClientRequest().getSession();
  Locale locale = (Locale)  
session.getAttributeorg.apache.struts.action.LOCALE);
  log.debug(LocaleInterceptor Locale: +locale);

  if (locale == null){
locale = req.getContext().getClientRequest().getLocale();
   log.debug(2. LocaleInterceptor Locale: +locale);
session.setAttribute(org.apache.struts.action.LOCALE, locale);
  }  

  try
  {
 req.setLocales(new Locale[]{locale});
 invocation.invokeNext();
  }
  finally
  {
 req.setLocales(null);
  }
   }
}


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4030465#4030465

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4030465
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal] - Re: HOW to change Locale in Program?

2007-03-20 Thread [EMAIL PROTECTED]
The common way in a portal is to use the user profile.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4029654#4029654

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4029654
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal] - Re: HOW to change Locale in Program?

2007-03-20 Thread qqqqzaza
I know we can change locale using User Profile setting. 

But in my case, i wanna build a project that contains a header with links to 
swap language of the whole pages. (my project uses struts to handle action )

is there any other methods to deal with this ?

thx

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4029678#4029678

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4029678
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Portal] - Re: HOW to change Locale in Program?

2007-03-20 Thread [EMAIL PROTECTED]
So you want non-logged in user to be able to change the locale as well ?

For logged-in user you should change the preference (you don't have to do it 
using the portlet, nothing prevent you from creating your own action calling 
the identity service to update the preferred language)

For non-logged-in user, you would have to define how you want to store the 
preferred locale (session probably) and adapt 
org.jboss.portal.core.aspects.server/LocaleInterceptor accordingly

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4029683#4029683

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4029683
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user