net.i2p.router.web
Class LocaleWebAppHandler

java.lang.Object
  extended by org.mortbay.util.Container
      extended by org.mortbay.jetty.servlet.ServletHandler
          extended by org.mortbay.jetty.servlet.WebApplicationHandler
              extended by net.i2p.router.web.LocaleWebAppHandler
All Implemented Interfaces:
java.io.Serializable, org.mortbay.http.HttpHandler, org.mortbay.util.EventProvider, org.mortbay.util.LifeCycle

public class LocaleWebAppHandler
extends org.mortbay.jetty.servlet.WebApplicationHandler

Convert foo.jsp to foo_xx.jsp for language xx. This is appropriate for jsps with large amounts of text. This does not work for included jsps (e.g. summary*)

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(java.lang.String pathInContext, java.lang.String pathParams, org.mortbay.http.HttpRequest httpRequest, org.mortbay.http.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(org.mortbay.http.HttpRequest request, org.mortbay.http.HttpResponse response)
          Not an override
 void handleTrace(org.mortbay.http.HttpRequest request, org.mortbay.http.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(java.lang.String pathInContext,
                   java.lang.String pathParams,
                   org.mortbay.http.HttpRequest httpRequest,
                   org.mortbay.http.HttpResponse httpResponse)
            throws java.io.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 org.mortbay.http.HttpHandler
Overrides:
handle in class org.mortbay.jetty.servlet.ServletHandler
Throws:
java.io.IOException

handleTrace

public void handleTrace(org.mortbay.http.HttpRequest request,
                        org.mortbay.http.HttpResponse response)
                 throws java.io.IOException
Overrides method in ServletHandler

Overrides:
handleTrace in class org.mortbay.jetty.servlet.ServletHandler
Throws:
java.io.IOException
Since:
0.8

handleOptions

public void handleOptions(org.mortbay.http.HttpRequest request,
                          org.mortbay.http.HttpResponse response)
                   throws java.io.IOException
Not an override

Throws:
java.io.IOException
Since:
0.8