forked from I2P_Developers/i2p.i2p
RouterConsole compile fixes for Jetty 7.
Convert LocaleWebAppHandler from extending WebAppContext to extending HandlerWrapper, since handle() is now final in WebAppContext. Untested.
This commit is contained in:
@ -60,9 +60,13 @@
|
|||||||
<pathelement location="../../../core/java/build/i2p.jar" />
|
<pathelement location="../../../core/java/build/i2p.jar" />
|
||||||
<pathelement location="../../../router/java/build/router.jar" />
|
<pathelement location="../../../router/java/build/router.jar" />
|
||||||
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
|
||||||
|
<pathelement location="../../jetty/jettylib/jetty-http.jar" />
|
||||||
|
<pathelement location="../../jetty/jettylib/jetty-io.jar" />
|
||||||
|
<pathelement location="../../jetty/jettylib/jetty-security.jar" />
|
||||||
|
<pathelement location="../../jetty/jettylib/jetty-servlet.jar" />
|
||||||
|
<pathelement location="../../jetty/jettylib/jetty-servlets.jar" />
|
||||||
<pathelement location="../../jetty/jettylib/jetty-util.jar" />
|
<pathelement location="../../jetty/jettylib/jetty-util.jar" />
|
||||||
<pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
|
<pathelement location="../../jetty/jettylib/jetty-webapp.jar" />
|
||||||
<pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
|
|
||||||
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
|
||||||
<pathelement location="../../jetty/jettylib/jsp-api.jar" />
|
<pathelement location="../../jetty/jettylib/jsp-api.jar" />
|
||||||
<pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
|
<pathelement location="../../jetty/jettylib/jetty-i2p.jar" />
|
||||||
|
@ -17,7 +17,7 @@ import net.i2p.router.startup.LoadClientAppsJob;
|
|||||||
import net.i2p.router.update.ConsoleUpdateManager;
|
import net.i2p.router.update.ConsoleUpdateManager;
|
||||||
import static net.i2p.update.UpdateType.*;
|
import static net.i2p.update.UpdateType.*;
|
||||||
|
|
||||||
import org.mortbay.jetty.handler.ContextHandlerCollection;
|
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves changes to clients.config or webapps.config
|
* Saves changes to clients.config or webapps.config
|
||||||
|
@ -12,7 +12,7 @@ import net.i2p.router.Router;
|
|||||||
import net.i2p.router.RouterContext;
|
import net.i2p.router.RouterContext;
|
||||||
import net.i2p.router.util.RouterPasswordManager;
|
import net.i2p.router.util.RouterPasswordManager;
|
||||||
|
|
||||||
//import org.mortbay.jetty.security.UnixCrypt;
|
//import org.eclipse.jetty.util.security.UnixCrypt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage both plaintext and salted/hashed password storage in
|
* Manage both plaintext and salted/hashed password storage in
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package net.i2p.router.web;
|
package net.i2p.router.web;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -10,7 +11,11 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import net.i2p.I2PAppContext;
|
import net.i2p.I2PAppContext;
|
||||||
|
|
||||||
import org.mortbay.jetty.webapp.WebAppContext;
|
import org.eclipse.jetty.server.Request;
|
||||||
|
import org.eclipse.jetty.server.handler.HandlerWrapper;
|
||||||
|
import org.eclipse.jetty.server.session.SessionHandler;
|
||||||
|
import org.eclipse.jetty.servlet.ServletHandler;
|
||||||
|
import org.eclipse.jetty.webapp.WebAppContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert foo.jsp to foo_xx.jsp for language xx.
|
* Convert foo.jsp to foo_xx.jsp for language xx.
|
||||||
@ -21,14 +26,22 @@ import org.mortbay.jetty.webapp.WebAppContext;
|
|||||||
*
|
*
|
||||||
* @author zzz
|
* @author zzz
|
||||||
*/
|
*/
|
||||||
public class LocaleWebAppHandler extends WebAppContext
|
public class LocaleWebAppHandler extends HandlerWrapper
|
||||||
{
|
{
|
||||||
private final I2PAppContext _context;
|
private final I2PAppContext _context;
|
||||||
|
private final WebAppContext _wac;
|
||||||
|
|
||||||
public LocaleWebAppHandler(I2PAppContext ctx, String path, String warPath) {
|
public LocaleWebAppHandler(I2PAppContext ctx, String path, String warPath,
|
||||||
super(warPath, path);
|
File tmpdir, ServletHandler servletHandler) {
|
||||||
|
super();
|
||||||
_context = ctx;
|
_context = ctx;
|
||||||
|
_wac = new WebAppContext(warPath, path);
|
||||||
setInitParams(WebAppStarter.INIT_PARAMS);
|
setInitParams(WebAppStarter.INIT_PARAMS);
|
||||||
|
_wac.setTempDirectory(tmpdir);
|
||||||
|
_wac.setExtractWAR(false);
|
||||||
|
_wac.setSessionHandler(new SessionHandler());
|
||||||
|
_wac.setServletHandler(servletHandler);
|
||||||
|
setHandler(_wac);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,19 +50,12 @@ public class LocaleWebAppHandler extends WebAppContext
|
|||||||
* or as specified in the routerconsole.lang property.
|
* or as specified in the routerconsole.lang property.
|
||||||
* Unless language == "en".
|
* Unless language == "en".
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public void handle(String pathInContext,
|
public void handle(String pathInContext,
|
||||||
|
Request baseRequest,
|
||||||
HttpServletRequest httpRequest,
|
HttpServletRequest httpRequest,
|
||||||
HttpServletResponse httpResponse,
|
HttpServletResponse httpResponse)
|
||||||
int dispatch)
|
|
||||||
throws IOException, ServletException
|
throws IOException, ServletException
|
||||||
{
|
{
|
||||||
// Handle OPTIONS (nothing to override)
|
|
||||||
if ("OPTIONS".equals(httpRequest.getMethod()))
|
|
||||||
{
|
|
||||||
handleOptions(httpRequest, httpResponse);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// transparent rewriting
|
// transparent rewriting
|
||||||
if (pathInContext.equals("/") || pathInContext.equals("/index.html")) {
|
if (pathInContext.equals("/") || pathInContext.equals("/index.html")) {
|
||||||
@ -77,7 +83,7 @@ public class LocaleWebAppHandler extends WebAppContext
|
|||||||
if (lang != null && lang.length() > 0 && !lang.equals("en")) {
|
if (lang != null && lang.length() > 0 && !lang.equals("en")) {
|
||||||
String testPath = pathInContext.substring(0, len - 4) + '_' + lang + ".jsp";
|
String testPath = pathInContext.substring(0, len - 4) + '_' + lang + ".jsp";
|
||||||
// Do we have a servlet for the new path that isn't the catchall *.jsp?
|
// Do we have a servlet for the new path that isn't the catchall *.jsp?
|
||||||
Map.Entry servlet = getServletHandler().getHolderEntry(testPath);
|
Map.Entry servlet = _wac.getServletHandler().getHolderEntry(testPath);
|
||||||
if (servlet != null) {
|
if (servlet != null) {
|
||||||
String servletPath = (String) servlet.getKey();
|
String servletPath = (String) servlet.getKey();
|
||||||
if (servletPath != null && !servletPath.startsWith("*")) {
|
if (servletPath != null && !servletPath.startsWith("*")) {
|
||||||
@ -90,7 +96,7 @@ public class LocaleWebAppHandler extends WebAppContext
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//System.err.println("New path: " + newPath);
|
//System.err.println("New path: " + newPath);
|
||||||
super.handle(newPath, httpRequest, httpResponse, dispatch);
|
super.handle(newPath, baseRequest, httpRequest, httpResponse);
|
||||||
//System.err.println("Was handled? " + httpRequest.isHandled());
|
//System.err.println("Was handled? " + httpRequest.isHandled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,10 +118,28 @@ public class LocaleWebAppHandler extends WebAppContext
|
|||||||
* Not an override
|
* Not an override
|
||||||
* @since 0.8
|
* @since 0.8
|
||||||
*/
|
*/
|
||||||
|
/**** not in Jetty 7
|
||||||
public void handleOptions(HttpServletRequest request,
|
public void handleOptions(HttpServletRequest request,
|
||||||
HttpServletResponse response)
|
HttpServletResponse response)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
response.sendError(405);
|
response.sendError(405);
|
||||||
}
|
}
|
||||||
|
****/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mysteriously removed from Jetty 7
|
||||||
|
*/
|
||||||
|
private void setInitParams(Map params) {
|
||||||
|
setInitParams(_wac, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since Jetty 7
|
||||||
|
*/
|
||||||
|
public static void setInitParams(WebAppContext context, Map<?,?> params) {
|
||||||
|
for (Map.Entry e : params.entrySet()) {
|
||||||
|
context.setInitParameter((String)e.getKey(), (String)e.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import net.i2p.I2PAppContext;
|
|||||||
import net.i2p.util.FileUtil;
|
import net.i2p.util.FileUtil;
|
||||||
import net.i2p.util.VersionComparator;
|
import net.i2p.util.VersionComparator;
|
||||||
|
|
||||||
import org.mortbay.jetty.Server;
|
import org.eclipse.jetty.server.Server;
|
||||||
import org.tanukisoftware.wrapper.WrapperManager;
|
import org.tanukisoftware.wrapper.WrapperManager;
|
||||||
|
|
||||||
public class LogsHelper extends HelperBase {
|
public class LogsHelper extends HelperBase {
|
||||||
|
@ -34,7 +34,7 @@ import net.i2p.util.Log;
|
|||||||
import net.i2p.util.Translate;
|
import net.i2p.util.Translate;
|
||||||
import net.i2p.util.VersionComparator;
|
import net.i2p.util.VersionComparator;
|
||||||
|
|
||||||
import org.mortbay.jetty.handler.ContextHandlerCollection;
|
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,30 +42,33 @@ import net.i2p.util.ShellCommand;
|
|||||||
import net.i2p.util.SystemVersion;
|
import net.i2p.util.SystemVersion;
|
||||||
import net.i2p.util.VersionComparator;
|
import net.i2p.util.VersionComparator;
|
||||||
|
|
||||||
import org.mortbay.jetty.AbstractConnector;
|
import org.eclipse.jetty.security.HashLoginService;
|
||||||
import org.mortbay.jetty.Connector;
|
import org.eclipse.jetty.security.ConstraintMapping;
|
||||||
import org.mortbay.jetty.NCSARequestLog;
|
import org.eclipse.jetty.security.ConstraintSecurityHandler;
|
||||||
import org.mortbay.jetty.Server;
|
import org.eclipse.jetty.security.SecurityHandler;
|
||||||
import org.mortbay.jetty.bio.SocketConnector;
|
import org.eclipse.jetty.security.authentication.DigestAuthenticator;
|
||||||
import org.mortbay.jetty.handler.ContextHandlerCollection;
|
import org.eclipse.jetty.server.AbstractConnector;
|
||||||
import org.mortbay.jetty.handler.DefaultHandler;
|
import org.eclipse.jetty.server.Connector;
|
||||||
import org.mortbay.jetty.handler.HandlerCollection;
|
import org.eclipse.jetty.server.NCSARequestLog;
|
||||||
import org.mortbay.jetty.handler.RequestLogHandler;
|
import org.eclipse.jetty.server.Server;
|
||||||
import org.mortbay.jetty.nio.SelectChannelConnector;
|
import org.eclipse.jetty.server.bio.SocketConnector;
|
||||||
import org.mortbay.jetty.security.Credential.MD5;
|
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||||
import org.mortbay.jetty.security.DigestAuthenticator;
|
import org.eclipse.jetty.server.handler.DefaultHandler;
|
||||||
import org.mortbay.jetty.security.HashUserRealm;
|
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||||
import org.mortbay.jetty.security.Constraint;
|
import org.eclipse.jetty.server.handler.HandlerWrapper;
|
||||||
import org.mortbay.jetty.security.ConstraintMapping;
|
import org.eclipse.jetty.server.handler.RequestLogHandler;
|
||||||
import org.mortbay.jetty.security.SecurityHandler;
|
import org.eclipse.jetty.server.nio.SelectChannelConnector;
|
||||||
import org.mortbay.jetty.security.SslSocketConnector;
|
import org.eclipse.jetty.server.ssl.SslSocketConnector;
|
||||||
import org.mortbay.jetty.security.SslSelectChannelConnector;
|
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
|
||||||
import org.mortbay.jetty.servlet.ServletHandler;
|
import org.eclipse.jetty.servlet.ServletHandler;
|
||||||
import org.mortbay.jetty.servlet.ServletHolder;
|
import org.eclipse.jetty.servlet.ServletHolder;
|
||||||
import org.mortbay.jetty.servlet.SessionHandler;
|
import org.eclipse.jetty.webapp.WebAppContext;
|
||||||
import org.mortbay.jetty.webapp.WebAppContext;
|
import org.eclipse.jetty.util.security.Constraint;
|
||||||
import org.mortbay.thread.QueuedThreadPool;
|
import org.eclipse.jetty.util.security.Credential;
|
||||||
import org.mortbay.thread.concurrent.ThreadPool;
|
import org.eclipse.jetty.util.security.Credential.MD5;
|
||||||
|
import org.eclipse.jetty.util.thread.ExecutorThreadPool;
|
||||||
|
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||||
|
import org.eclipse.jetty.util.thread.ThreadPool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start the router console.
|
* Start the router console.
|
||||||
@ -306,7 +309,8 @@ public class RouterConsoleRunner implements RouterApp {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
ThreadPool ctp = new CustomThreadPoolExecutor();
|
ThreadPool ctp = new CustomThreadPoolExecutor();
|
||||||
ctp.prestartAllCoreThreads();
|
// Gone in Jetty 7
|
||||||
|
//ctp.prestartAllCoreThreads();
|
||||||
_server.setThreadPool(ctp);
|
_server.setThreadPool(ctp);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
// class not found...
|
// class not found...
|
||||||
@ -319,7 +323,9 @@ public class RouterConsoleRunner implements RouterApp {
|
|||||||
|
|
||||||
HandlerCollection hColl = new HandlerCollection();
|
HandlerCollection hColl = new HandlerCollection();
|
||||||
ContextHandlerCollection chColl = new ContextHandlerCollection();
|
ContextHandlerCollection chColl = new ContextHandlerCollection();
|
||||||
_server.addHandler(hColl);
|
// gone in Jetty 7
|
||||||
|
//_server.addHandler(hColl);
|
||||||
|
_server.setHandler(hColl);
|
||||||
hColl.addHandler(chColl);
|
hColl.addHandler(chColl);
|
||||||
hColl.addHandler(new DefaultHandler());
|
hColl.addHandler(new DefaultHandler());
|
||||||
|
|
||||||
@ -355,7 +361,7 @@ public class RouterConsoleRunner implements RouterApp {
|
|||||||
if (!_webAppsDir.endsWith("/"))
|
if (!_webAppsDir.endsWith("/"))
|
||||||
_webAppsDir += '/';
|
_webAppsDir += '/';
|
||||||
|
|
||||||
WebAppContext rootWebApp = null;
|
HandlerWrapper rootWebApp = null;
|
||||||
ServletHandler rootServletHandler = null;
|
ServletHandler rootServletHandler = null;
|
||||||
List<Connector> connectors = new ArrayList(4);
|
List<Connector> connectors = new ArrayList(4);
|
||||||
try {
|
try {
|
||||||
@ -511,17 +517,14 @@ public class RouterConsoleRunner implements RouterApp {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rootWebApp = new LocaleWebAppHandler(_context,
|
|
||||||
"/", _webAppsDir + ROUTERCONSOLE + ".war");
|
|
||||||
File tmpdir = new SecureDirectory(workDir, ROUTERCONSOLE + "-" +
|
File tmpdir = new SecureDirectory(workDir, ROUTERCONSOLE + "-" +
|
||||||
(_listenPort != null ? _listenPort : _sslListenPort));
|
(_listenPort != null ? _listenPort : _sslListenPort));
|
||||||
tmpdir.mkdir();
|
tmpdir.mkdir();
|
||||||
rootWebApp.setTempDirectory(tmpdir);
|
|
||||||
rootWebApp.setExtractWAR(false);
|
|
||||||
rootWebApp.setSessionHandler(new SessionHandler());
|
|
||||||
rootServletHandler = new ServletHandler();
|
rootServletHandler = new ServletHandler();
|
||||||
rootWebApp.setServletHandler(rootServletHandler);
|
rootWebApp = new LocaleWebAppHandler(_context,
|
||||||
initialize(_context, rootWebApp);
|
"/", _webAppsDir + ROUTERCONSOLE + ".war",
|
||||||
|
tmpdir, rootServletHandler);
|
||||||
|
initialize(_context, (WebAppContext)(rootWebApp.getHandler()));
|
||||||
chColl.addHandler(rootWebApp);
|
chColl.addHandler(rootWebApp);
|
||||||
|
|
||||||
} catch (Exception ioe) {
|
} catch (Exception ioe) {
|
||||||
@ -731,7 +734,7 @@ public class RouterConsoleRunner implements RouterApp {
|
|||||||
* Add all users and passwords.
|
* Add all users and passwords.
|
||||||
*/
|
*/
|
||||||
static void initialize(RouterContext ctx, WebAppContext context) {
|
static void initialize(RouterContext ctx, WebAppContext context) {
|
||||||
SecurityHandler sec = new SecurityHandler();
|
ConstraintSecurityHandler sec = new ConstraintSecurityHandler();
|
||||||
List<ConstraintMapping> constraints = new ArrayList(4);
|
List<ConstraintMapping> constraints = new ArrayList(4);
|
||||||
ConsolePasswordManager mgr = new ConsolePasswordManager(ctx);
|
ConsolePasswordManager mgr = new ConsolePasswordManager(ctx);
|
||||||
boolean enable = ctx.getBooleanProperty(PROP_PW_ENABLE);
|
boolean enable = ctx.getBooleanProperty(PROP_PW_ENABLE);
|
||||||
@ -741,14 +744,13 @@ public class RouterConsoleRunner implements RouterApp {
|
|||||||
enable = false;
|
enable = false;
|
||||||
ctx.router().saveConfig(PROP_CONSOLE_PW, "false");
|
ctx.router().saveConfig(PROP_CONSOLE_PW, "false");
|
||||||
} else {
|
} else {
|
||||||
HashUserRealm realm = new HashUserRealm(JETTY_REALM);
|
HashLoginService realm = new HashLoginService(JETTY_REALM);
|
||||||
sec.setUserRealm(realm);
|
sec.setLoginService(realm);
|
||||||
sec.setAuthenticator(authenticator);
|
sec.setAuthenticator(authenticator);
|
||||||
for (Map.Entry<String, String> e : userpw.entrySet()) {
|
for (Map.Entry<String, String> e : userpw.entrySet()) {
|
||||||
String user = e.getKey();
|
String user = e.getKey();
|
||||||
String pw = e.getValue();
|
String pw = e.getValue();
|
||||||
realm.put(user, MD5.__TYPE + pw);
|
realm.putUser(user, Credential.getCredential(MD5.__TYPE + pw), new String[] {JETTY_ROLE});
|
||||||
realm.addUserToRole(user, JETTY_ROLE);
|
|
||||||
Constraint constraint = new Constraint(user, JETTY_ROLE);
|
Constraint constraint = new Constraint(user, JETTY_ROLE);
|
||||||
constraint.setAuthenticate(true);
|
constraint.setAuthenticate(true);
|
||||||
ConstraintMapping cm = new ConstraintMapping();
|
ConstraintMapping cm = new ConstraintMapping();
|
||||||
@ -847,11 +849,13 @@ public class RouterConsoleRunner implements RouterApp {
|
|||||||
* Just to set the name and set Daemon
|
* Just to set the name and set Daemon
|
||||||
* @since Jetty 6
|
* @since Jetty 6
|
||||||
*/
|
*/
|
||||||
private static class CustomThreadPoolExecutor extends ThreadPool {
|
private static class CustomThreadPoolExecutor extends ExecutorThreadPool {
|
||||||
public CustomThreadPoolExecutor() {
|
public CustomThreadPoolExecutor() {
|
||||||
super(MIN_THREADS, MAX_THREADS, MAX_IDLE_TIME, TimeUnit.MILLISECONDS,
|
super(MIN_THREADS, MAX_THREADS, MAX_IDLE_TIME, TimeUnit.MILLISECONDS,
|
||||||
new SynchronousQueue(), new CustomThreadFactory(),
|
new SynchronousQueue() /** , following args not available in Jetty 7
|
||||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
new CustomThreadFactory(),
|
||||||
|
new ThreadPoolExecutor.CallerRunsPolicy() **/
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ import java.util.StringTokenizer;
|
|||||||
|
|
||||||
import net.i2p.I2PAppContext;
|
import net.i2p.I2PAppContext;
|
||||||
|
|
||||||
import org.mortbay.jetty.webapp.Configuration;
|
import org.eclipse.jetty.webapp.Configuration;
|
||||||
import org.mortbay.jetty.webapp.WebAppClassLoader;
|
import org.eclipse.jetty.webapp.WebAppClassLoader;
|
||||||
import org.mortbay.jetty.webapp.WebAppContext;
|
import org.eclipse.jetty.webapp.WebAppContext;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -133,14 +133,25 @@ public class WebAppConfiguration implements Configuration {
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void configureDefaults() {}
|
/** @since Jetty 7 */
|
||||||
public void configureWebApp() {}
|
public void deconfigure(WebAppContext context) {}
|
||||||
|
|
||||||
/** @since Jetty 6 */
|
/** @since Jetty 7 */
|
||||||
public void deconfigureWebApp() {}
|
public void configure(WebAppContext context) throws Exception {
|
||||||
|
|
||||||
/** @since Jetty 6 */
|
|
||||||
public void configureClassLoader() throws Exception {
|
|
||||||
configureClassPath();
|
configureClassPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @since Jetty 7 */
|
||||||
|
public void cloneConfigure(WebAppContext template, WebAppContext context) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @since Jetty 7 */
|
||||||
|
public void destroy(WebAppContext context) {}
|
||||||
|
|
||||||
|
/** @since Jetty 7 */
|
||||||
|
public void preConfigure(WebAppContext context) {}
|
||||||
|
|
||||||
|
/** @since Jetty 7 */
|
||||||
|
public void postConfigure(WebAppContext context) {}
|
||||||
}
|
}
|
||||||
|
@ -10,11 +10,11 @@ import net.i2p.router.RouterContext;
|
|||||||
import net.i2p.util.FileUtil;
|
import net.i2p.util.FileUtil;
|
||||||
import net.i2p.util.SecureDirectory;
|
import net.i2p.util.SecureDirectory;
|
||||||
|
|
||||||
import org.mortbay.jetty.Handler;
|
import org.eclipse.jetty.server.Handler;
|
||||||
import org.mortbay.jetty.Server;
|
import org.eclipse.jetty.server.Server;
|
||||||
import org.mortbay.jetty.webapp.WebAppContext;
|
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||||
import org.mortbay.jetty.handler.ContextHandler;
|
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||||
import org.mortbay.jetty.handler.ContextHandlerCollection;
|
import org.eclipse.jetty.webapp.WebAppContext;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,7 +56,7 @@ public class WebAppStarter {
|
|||||||
File tmpdir = new SecureDirectory(ctx.getTempDir(), "jetty-work-" + appName + ctx.random().nextInt());
|
File tmpdir = new SecureDirectory(ctx.getTempDir(), "jetty-work-" + appName + ctx.random().nextInt());
|
||||||
WebAppContext wac = addWebApp(ctx, server, appName, warPath, tmpdir);
|
WebAppContext wac = addWebApp(ctx, server, appName, warPath, tmpdir);
|
||||||
//_log.debug("Loading war from: " + warPath);
|
//_log.debug("Loading war from: " + warPath);
|
||||||
wac.setInitParams(INIT_PARAMS);
|
LocaleWebAppHandler.setInitParams(wac, INIT_PARAMS);
|
||||||
wac.start();
|
wac.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
<%
|
<%
|
||||||
// Let's make this easy...
|
// Let's make this easy...
|
||||||
final Integer ERROR_CODE = (Integer) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_STATUS_CODE);
|
final Integer ERROR_CODE = (Integer) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_STATUS_CODE);
|
||||||
final String ERROR_URI = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_REQUEST_URI);
|
final String ERROR_URI = (String) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_REQUEST_URI);
|
||||||
final String ERROR_MESSAGE = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_MESSAGE);
|
final String ERROR_MESSAGE = (String) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_MESSAGE);
|
||||||
if (ERROR_CODE != null && ERROR_MESSAGE != null) {
|
if (ERROR_CODE != null && ERROR_MESSAGE != null) {
|
||||||
// this is deprecated but we don't want sendError()
|
// this is deprecated but we don't want sendError()
|
||||||
response.setStatus(ERROR_CODE.intValue(), ERROR_MESSAGE);
|
response.setStatus(ERROR_CODE.intValue(), ERROR_MESSAGE);
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
<%
|
<%
|
||||||
// Let's make this easy...
|
// Let's make this easy...
|
||||||
final Integer ERROR_CODE = (Integer) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_STATUS_CODE);
|
final Integer ERROR_CODE = (Integer) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_STATUS_CODE);
|
||||||
final String ERROR_URI = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_REQUEST_URI);
|
final String ERROR_URI = (String) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_REQUEST_URI);
|
||||||
final String ERROR_MESSAGE = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_MESSAGE);
|
final String ERROR_MESSAGE = (String) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_MESSAGE);
|
||||||
final Class ERROR_CLASS = (Class)request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_EXCEPTION_TYPE);
|
final Class ERROR_CLASS = (Class)request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_EXCEPTION_TYPE);
|
||||||
final Throwable ERROR_THROWABLE = (Throwable)request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_EXCEPTION);
|
final Throwable ERROR_THROWABLE = (Throwable)request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_EXCEPTION);
|
||||||
if (ERROR_CODE != null && ERROR_MESSAGE != null) {
|
if (ERROR_CODE != null && ERROR_MESSAGE != null) {
|
||||||
// this is deprecated but we don't want sendError()
|
// this is deprecated but we don't want sendError()
|
||||||
response.setStatus(ERROR_CODE.intValue(), ERROR_MESSAGE);
|
response.setStatus(ERROR_CODE.intValue(), ERROR_MESSAGE);
|
||||||
|
Reference in New Issue
Block a user