net.i2p.router.web
Class LocaleWebAppHandler

java.lang.Object
  extended by org.mortbay.component.AbstractLifeCycle
      extended by org.mortbay.jetty.handler.AbstractHandler
          extended by org.mortbay.jetty.handler.AbstractHandlerContainer
              extended by org.mortbay.jetty.handler.HandlerWrapper
                  extended by org.mortbay.jetty.handler.ContextHandler
                      extended by org.mortbay.jetty.servlet.Context
                          extended by org.mortbay.jetty.webapp.WebAppContext
                              extended by net.i2p.router.web.LocaleWebAppHandler
All Implemented Interfaces:
org.mortbay.component.LifeCycle, Handler, HandlerContainer, Server.Graceful, Attributes

public class LocaleWebAppHandler
extends org.mortbay.jetty.webapp.WebAppContext

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".

Author:
zzz

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mortbay.jetty.servlet.Context
Context.SContext
 
Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle
org.mortbay.component.LifeCycle.Listener
 
Field Summary
 
Fields inherited from class org.mortbay.jetty.webapp.WebAppContext
ERROR_PAGE, WEB_DEFAULTS_XML
 
Fields inherited from class org.mortbay.jetty.servlet.Context
_securityHandler, _servletHandler, _sessionHandler, NO_SECURITY, NO_SESSIONS, SECURITY, SESSIONS
 
Fields inherited from class org.mortbay.jetty.handler.ContextHandler
_scontext, MANAGED_ATTRIBUTES
 
Fields inherited from class org.mortbay.jetty.handler.AbstractHandler
_string
 
Fields inherited from class org.mortbay.component.AbstractLifeCycle
_listeners
 
Fields inherited from interface org.mortbay.jetty.Handler
ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST
 
Constructor Summary
LocaleWebAppHandler(I2PAppContext ctx, String path, String warPath)
           
 
Method Summary
 void handle(String pathInContext, HttpServletRequest httpRequest, HttpServletResponse httpResponse, int dispatch)
          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(HttpServletRequest request, HttpServletResponse response)
          Not an override
 
Methods inherited from class org.mortbay.jetty.webapp.WebAppContext
addEventListener, addWebApplications, addWebApplications, addWebApplications, addWebApplications, doStart, doStop, dumpUrl, getConfigurationClasses, getConfigurations, getCurrentWebAppContext, getDefaultsDescriptor, getDescriptor, getExtraClasspath, getOverrideDescriptor, getPermissions, getResource, getResourceAlias, getResourceAliases, getServerClasses, getSystemClasses, getTempDirectory, getUnavailableException, getWar, getWebInf, isCopyWebDir, isDistributable, isExtractWAR, isLogUrlOnStart, isParentLoaderPriority, isProtectedTarget, isTempWorkDirectory, loadConfigurations, removeResourceAlias, resolveWebApp, setClassLoader, setConfigurationClasses, setConfigurations, setCopyWebDir, setDefaultsDescriptor, setDescriptor, setDistributable, setEventListeners, setExtraClasspath, setExtractWAR, setLogUrlOnStart, setOverrideDescriptor, setParentLoaderPriority, setPermissions, setResourceAlias, setResourceAliases, setServerClasses, setSystemClasses, setTempDirectory, setWar, startContext, toString
 
Methods inherited from class org.mortbay.jetty.servlet.Context
addFilter, addFilter, addFilter, addServlet, addServlet, addServlet, getSecurityHandler, getServletHandler, getSessionHandler, setSecurityHandler, setServletHandler, setSessionHandler
 
Methods inherited from class org.mortbay.jetty.handler.ContextHandler
addLocaleEncoding, clearAttributes, getAllowNullPathInfo, getAttribute, getAttributeNames, getAttributes, getBaseResource, getClassLoader, getClassPath, getConnectorNames, getContextPath, getCurrentContext, getDisplayName, getErrorHandler, getEventListeners, getHosts, getInitParameter, getInitParameterNames, getInitParams, getLocaleEncoding, getMaxFormContentSize, getMimeTypes, getResourceBase, getResourcePaths, getServletContext, getVirtualHosts, getWelcomeFiles, isCompactPath, isShutdown, loadClass, removeAttribute, setAllowNullPathInfo, setAttribute, setAttributes, setBaseResource, setCompactPath, setConnectorNames, setContextPath, setDisplayName, setErrorHandler, setHosts, setInitParams, setMaxFormContentSize, setMimeTypes, setResourceBase, setServer, setShutdown, setVirtualHosts, setWelcomeFiles
 
Methods inherited from class org.mortbay.jetty.handler.HandlerWrapper
addHandler, expandChildren, getHandler, removeHandler, setHandler
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandlerContainer
expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler
destroy, getServer
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mortbay.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

Constructor Detail

LocaleWebAppHandler

public LocaleWebAppHandler(I2PAppContext ctx,
                           String path,
                           String warPath)
Method Detail

handle

public void handle(String pathInContext,
                   HttpServletRequest httpRequest,
                   HttpServletResponse httpResponse,
                   int dispatch)
            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 org.mortbay.jetty.webapp.WebAppContext
Throws:
IOException
ServletException

handleOptions

public void handleOptions(HttpServletRequest request,
                          HttpServletResponse response)
                   throws IOException
Not an override

Throws:
IOException
Since:
0.8