All Implemented Interfaces:
Handler, HandlerContainer, Container, Destroyable, Dumpable, LifeCycle

public class LocaleWebAppHandlerextends HandlerWrapper
Convert foo.jsp to foo_xx.jsp for language xx. This is appropriate for jsps with large amounts of text.

Also, as of 0.8.2, rewrite "/" and "/index.html" to "/index.jsp", and "/foo" to "/foo.jsp".

  • Field Details

    • _context

      private final I2PAppContext _context
      The router context whose locale is set.
    • _wac

      private final WebAppContext _wac
      The webapp context whose locale is set.
  • Constructor Details

    • LocaleWebAppHandler

      public LocaleWebAppHandler(I2PAppContext ctx, String path, String warPath, File tmpdir, ServletHandler servletHandler)
      Create handler for localized JSP resolution and Jetty integration.
      Parameters:
      ctx - app context supplying the routerconsole.lang property
      path - context path the console is served under
      warPath - filesystem location of the console WAR
      tmpdir - directory Jetty unpacks the WAR into
      servletHandler - handler holding the console servlets
  • Method Details

    • handle

      public void handle(String pathInContext, Request baseRequest, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException
      Handle foo.jsp by converting to foo_xx.jsp for language xx, where xx is the language for the default locale, or as specified in the routerconsole.lang property. Unless language == "en".
      Specified by:
      handle in interface Handler
      Overrides:
      handle in class HandlerWrapper
      Throws:
      IOException
      ServletException
    • setInitParams

      private void setInitParams(Map<?,?> params)
      Mysteriously removed from Jetty 7.
      Parameters:
      params - the init parameter map to copy to the web app context
    • setInitParams

      public static void setInitParams(WebAppContext context, Map<?,?> params)
      Copy init params from map to WebAppContext.
      Parameters:
      context - the web app context the parameters are copied into
      params - the init parameter map to copy from