FileDocCategorySizeDatePackage
LanguageAction.javaAPI DocExample975Sat Nov 22 19:35:12 GMT 2003s2wexample.controller.actions

LanguageAction

public class LanguageAction extends Object implements Action
An action to set the language based on a form

Fields Summary
private static final String
LANGUAGE_PARAM
attribute name for the language element in the JSP page
Constructors Summary
Methods Summary
public booleanperformAction(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletContext context)
Perform this action. Set the language property in the UserBean

    
                    
       
                                  
    
        // read the parameter from the request
        String language = req.getParameter(LANGUAGE_PARAM);
        
        // set it in the UserBean
        HttpSession session = req.getSession();
        UserBean ub = (UserBean) session.getAttribute(LoginAction.USERBEAN_ATTR);
        ub.setLanguage(language);
        
        // we suceeded
        return true;