FileDocCategorySizeDatePackage
JSPLocaleNegotiatorServlet.javaAPI DocExample1930Wed Jan 17 20:18:56 GMT 2001None

JSPLocaleNegotiatorServlet

public class JSPLocaleNegotiatorServlet extends HttpServlet

Fields Summary
private static final String
defaultJSP
private static final String
jspExtension
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)


        
        

    Locale usersLocale = request.getLocale();

    StringBuffer jspWithLocale = new StringBuffer();
    if (request.getParameter("jsppage") != null) {
      jspWithLocale.append(request.getParameter("jsppage"));
      jspWithLocale.append("_");
      jspWithLocale.append(usersLocale.toString());
      jspWithLocale.append(jspExtension);
    } else
      jspWithLocale.append(defaultJSP);

    response.setLocale(usersLocale);
    getServletConfig().getServletContext()
        .getRequestDispatcher(jspWithLocale.toString())
        .forward(request,response);