## net.i2p.router.web
Class LocaleWebAppHandler

    java.lang.Object
      org.mortbay.util.Container
          org.mortbay.jetty.servlet.ServletHandler
              org.mortbay.jetty.servlet.WebApplicationHandler
                  net.i2p.router.web.LocaleWebAppHandler

All Implemented Interfaces:
  Serializable, HttpHandler, EventProvider, LifeCycle

    public class LocaleWebAppHandler

extends WebApplicationHandler

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",x and "/foo" to "/foo.jsp".

Author:
  zzz
See Also:
  Serialized Form

Field Summary

Fields inherited from class org.mortbay.jetty.servlet.WebApplicationHandler
`_chainCache, _contextAttributeListeners, _namedChainCache, _requestAttributeListeners, _requestListeners, _sessionListeners, jsr154Filter, jsr154FilterHolder`

Fields inherited from class org.mortbay.jetty.servlet.ServletHandler
`__DEFAULT_SERVLET, __J_S_CONTEXT_TEMPDIR, __J_S_ERROR_EXCEPTION, __J_S_ERROR_EXCEPTION_TYPE, __J_S_ERROR_MESSAGE, __J_S_ERROR_REQUEST_URI, __J_S_ERROR_SERVLET_NAME, __J_S_ERROR_STATUS_CODE, _attributes, _contextLog, _formErrorPage, _formLoginPage, _httpContext, _loader, _nameMap, _servletMap, _sessionManager`

Constructor Summary
`LocaleWebAppHandler(I2PAppContext ctx)`

Method Summary
`void` `handle(String pathInContext, String pathParams, HttpRequest httpRequest, HttpResponse httpResponse)` 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.
`void` `handleOptions(HttpRequest request, HttpResponse response)` Not an override
`void` `handleTrace(HttpRequest request, HttpResponse response)` Overrides method in ServletHandler

Methods inherited from class org.mortbay.jetty.servlet.WebApplicationHandler

`addComponent, addEventListener, addFilterHolder, addFilterPathMapping, addFilterServletMapping, defineFilter, destroy, dispatch, doStart, doStop, getErrorPage, getFilter, getFilters, getJsr154Filter, initializeServlets, isAcceptRanges, isFilterChainsCached, main, newFilterHolder, removeComponent, removeContextAttribute, removeEventListener, setAcceptRanges, setContextAttribute, setFilterChainsCached, setSessionManager`

Methods inherited from class org.mortbay.jetty.servlet.ServletHandler

`addServlet, addServlet, addServlet, addServletHolder, finalize, formAuthInit, getClassLoader, getContextAttribute, getContextAttributeNames, getHolderEntry, getHttpContext, getHttpSession, getName, getNamedDispatcher, getRealPath, getRequestDispatcher, getResource, getResourceAsStream, getResourcePaths, getServletContext, getServletHolder, getServletMap, getServlets, getSessionManager, handleOptions, handleTrace, initialize, isAutoInitializeServlets, isUsingCookies, mapPathToServlet, newHttpSession, newServletHolder, newServletHolder, notFound, setAutoInitializeServlets, setDynamicInitParams, setDynamicServletPathSpec, setName, setServeDynamicSystemServlets, setSessionInactiveInterval, setUsingCookies`

Methods inherited from class org.mortbay.util.Container
`getComponents, isFailed, isStarted, isStarting, isStopping, start, stop`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.mortbay.util.LifeCycle
`isStarted, start, stop`

Constructor Detail

### LocaleWebAppHandler

    public LocaleWebAppHandler(I2PAppContext ctx)

Method Detail

### handle

    public void handle(String pathInContext,
                       String pathParams,
                       HttpRequest httpRequest,
                       HttpResponse httpResponse)
                throws IOException

  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 `HttpHandler`
  Overrides:
    `handle` in class `ServletHandler`
  Throws:
    `IOException`

### handleTrace

    public void handleTrace(HttpRequest request,
                            HttpResponse response)
                     throws IOException

  Overrides method in ServletHandler

  Overrides:
    `handleTrace` in class `ServletHandler`
  Throws:
    `IOException`
  Since:
    0.8

### handleOptions

    public void handleOptions(HttpRequest request,
                              HttpResponse response)
                       throws IOException

  Not an override

  Throws:
    `IOException`
  Since:
    0.8