File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Login with language selection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Login with language selection" Watch "Login with language selection" New topic

Login with language selection

Daniel Markovic

Joined: Apr 24, 2008
Posts: 1

I try to get a login screen where the language can be changed. There is no problem to do that after I have logged in. But how can I change it immediately after I switched the language? (For example the Horde Email Platform has this possibility. But unfortunately it is written in PHP. Here is an example.)

I tried it already with a valueChangeListener. But how can I update the page itself? Is this possible in JSF?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Normally when a person first enters a website, I display a welcome page for the language that that user's browser is set to prefer. Most likely, if I wanted to support the user's being able to select a language for a specific app, I'd place a drop-list menu of languages on the welcome page. Selecting the language would either re-request the welcome or login page for that language, or use client-side Javascript to update the currently displayed page with the selected language.

If the welcome page is a login page and you're using container-based authentication, it might require a little more creativeness, but same general idea.

Also, it's a good idea to keep a cookie so that the user doesn't have to select every time.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Login with language selection
It's not a secret anymore!