- All Implemented Interfaces:
Handler, HandlerContainer, Container, Destroyable, Dumpable, LifeCycle
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".
Nested Class Summary
Nested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.ListenerField Summary
FieldsModifier and TypeFieldDescriptionprivate final I2PAppContextThe router context whose locale is set.private final WebAppContextThe webapp context whose locale is set.Fields inherited from class HandlerWrapper
_handlerFields inherited from class AbstractLifeCycle
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPINGConstructor Summary
ConstructorsConstructorDescriptionLocaleWebAppHandler(I2PAppContext ctx, String path, String warPath, File tmpdir, ServletHandler servletHandler) Create handler for localized JSP resolution and Jetty integration.Method Summary
Modifier and TypeMethodDescriptionvoidhandle(String pathInContext, Request baseRequest, HttpServletRequest httpRequest, HttpServletResponse 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 therouterconsole.langproperty.private voidsetInitParams(Map<?, ?> params) Mysteriously removed from Jetty 7.static voidsetInitParams(WebAppContext context, Map<?, ?> params) Copy init params from map to WebAppContext.Methods inherited from class HandlerWrapper
destroy, expandChildren, getHandler, getHandlers, insertHandler, setHandlerMethods inherited from class AbstractHandlerContainer
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServerMethods inherited from class AbstractHandler
doStart, doStop, dumpThis, getServerMethods inherited from class ContainerLifeCycle
addBean, addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansMethods inherited from class AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
Field Details
_context
The router context whose locale is set._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 therouterconsole.langpropertypath- context path the console is served underwarPath- filesystem location of the console WARtmpdir- directory Jetty unpacks the WAR intoservletHandler- 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 therouterconsole.langproperty. Unless language == "en".- Specified by:
handlein interfaceHandler- Overrides:
handlein classHandlerWrapper- Throws:
IOExceptionServletException
setInitParams
Mysteriously removed from Jetty 7.- Parameters:
params- the init parameter map to copy to the web app context
setInitParams
Copy init params from map to WebAppContext.- Parameters:
context- the web app context the parameters are copied intoparams- the init parameter map to copy from