I have a portal built on JBoss Portal 2.5.4 that needs to have some I18N. On the login.jsp page (which is in portal-server.war), we added a language switch. One of the links on the page is to the Forget Password facility.
For reasons related to look-and-feel, the ForgetPassword page is implemented as a maximized portlet inside our JBoss Portal. But, obviously, there's no user object yet, since there hasn't been a login.
So how do I pass the locale information that the user selects on the login.jsp down into the Forget Password jsp?
I've tried:
- session variables (no go, they don't cross over the wars)
- cookies (JBoss Portal swallows them)
- URL parameters (JBoss Portal swallows them too)
- System.setProperty() - by the time they get to the ForgetPassword jsp, they're reset.
This is all running on Windows Vista or 2003.
Is there some obvious technique I'm missing? Do I just need to bite the bullet and reorganize my ForgetPassword page as a servlet so I can get URL parameters?
Ok, I found one mechanism to do this - create a new portlet window (ForgotPasswordWindow_de) in portal-object.xml:
which points to a new portlet instance (UserMgmtPortletInstance_de) in portlet-instances.xml, which pointed to the same Portlet, with a lang preference defined.
Then, in the Portlet doView() code, I find this preference, and set an attribute.
Then, in the jsp, I look at the attribute, and set the locale.
And to kick it all off, the login page has a switch, and if the language is german, it calls ForgotPasswordWindow_de instead of ForgotPasswordWindow_en