jetty-9 distribution working

This commit is contained in:
Greg Wilkins 2012-09-06 14:54:55 +10:00
parent 3acf2e65ed
commit 2dfcebfc04
32 changed files with 237 additions and 183 deletions

View File

@ -34,7 +34,7 @@ import org.eclipse.jetty.server.LocalConnector;
import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.server.handler.GzipHandler; import org.eclipse.jetty.servlets.gzip.GzipHandler;
import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.IO;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;

View File

@ -0,0 +1,3 @@
OPTIONS=annotations
etc/jetty-annotations.xml

View File

@ -15,18 +15,10 @@
<!-- Server Thread Pool --> <!-- Server Thread Pool -->
<!-- =========================================================== --> <!-- =========================================================== -->
<Arg name="threadPool"> <Arg name="threadPool">
<!-- Default queued blocking threadpool -->
<New class="org.eclipse.jetty.util.thread.QueuedThreadPool"> <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
<Set name="maxThreads">200</Set> <Set name="maxThreads">200</Set>
<Set name="minThreads">10</Set> <Set name="minThreads">10</Set>
</New> </New>
<!-- Optional Java 5 bounded threadpool with job queue
<New class="org.eclipse.thread.concurrent.ThreadPool">
<Set name="corePoolSize">50</Set>
<Set name="maximumPoolSize">50</Set>
</New>
-->
</Arg> </Arg>
<!-- =========================================================== --> <!-- =========================================================== -->

View File

@ -343,22 +343,24 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<!--
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId> <artifactId>jetty-jsp</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-rewrite</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-annotations</artifactId> <artifactId>jetty-annotations</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<!--
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-rewrite</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jndi</artifactId> <artifactId>jetty-jndi</artifactId>

View File

@ -9,7 +9,6 @@ to serve static html files and images.
--> -->
<Configure class="org.eclipse.jetty.server.handler.ContextHandler"> <Configure class="org.eclipse.jetty.server.handler.ContextHandler">
<Call class="org.eclipse.jetty.util.log.Log" name="debug"><Arg>Configure javadoc.xml</Arg></Call>
<Set name="contextPath">/resources</Set> <Set name="contextPath">/resources</Set>
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/resources/</Set> <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/resources/</Set>
<Set name="handler"> <Set name="handler">

View File

@ -9,7 +9,6 @@ to serve static html files and images.
--> -->
<Configure class="org.eclipse.jetty.server.handler.ContextHandler"> <Configure class="org.eclipse.jetty.server.handler.ContextHandler">
<Call class="org.eclipse.jetty.util.log.Log" name="debug"><Arg>Configure javadoc.xml</Arg></Call>
<Set name="contextPath">/javadoc</Set> <Set name="contextPath">/javadoc</Set>
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/javadoc/</Set> <Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/javadoc/</Set>
<Set name="handler"> <Set name="handler">

View File

@ -1,8 +1,13 @@
#=========================================================== #===========================================================
# Jetty start.jar arguments # Jetty start.jar arguments
# Each line of this file is prepended to the command line # The contents of this file, together with the start.ini
# arguments # of a call to: # fragments found in start.d directory are used to build
# the classpath and command line on a call to
# java -jar start.jar [arg...] # java -jar start.jar [arg...]
#
# Use the following command to see more options
# java -jar start.jar --help
#
#=========================================================== #===========================================================
@ -46,7 +51,7 @@
# for a full listing do # for a full listing do
# java -jar start.jar --list-options # java -jar start.jar --list-options
#----------------------------------------------------------- #-----------------------------------------------------------
OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations OPTIONS=Server,jsp,resources,websocket,ext,plus
#----------------------------------------------------------- #-----------------------------------------------------------
@ -55,9 +60,7 @@ OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations
# For a full list of available configuration files do # For a full list of available configuration files do
# java -jar start.jar --help # java -jar start.jar --help
#----------------------------------------------------------- #-----------------------------------------------------------
#etc/jetty-jmx.xml
etc/jetty.xml etc/jetty.xml
etc/jetty-annotations.xml
# etc/jetty-ssl.xml # etc/jetty-ssl.xml
# etc/jetty-requestlog.xml # etc/jetty-requestlog.xml
etc/jetty-deploy.xml etc/jetty-deploy.xml

View File

@ -7,7 +7,7 @@
<!-- The simplest way to achieve this is to add etc/jetty-jmx.xml as the --> <!-- The simplest way to achieve this is to add etc/jetty-jmx.xml as the -->
<!-- first file in configuration file list at the end of start.ini file. --> <!-- first file in configuration file list at the end of start.ini file. -->
<!-- ============================================================================ --> <!-- ============================================================================ -->
<Configure id="Server" class="org.eclipse.jetty.server.Server"> <Configure id="Container" class="org.eclipse.jetty.util.component.Container">
<!-- =========================================================== --> <!-- =========================================================== -->
<!-- Set the java.rmi.server.hostname property in case you've --> <!-- Set the java.rmi.server.hostname property in case you've -->
@ -21,7 +21,7 @@
--> -->
<!-- =========================================================== --> <!-- =========================================================== -->
<!-- Initialize an mbean server --> <!-- Get the platform mbean server -->
<!-- =========================================================== --> <!-- =========================================================== -->
<Call id="MBeanServer" class="java.lang.management.ManagementFactory" <Call id="MBeanServer" class="java.lang.management.ManagementFactory"
name="getPlatformMBeanServer" /> name="getPlatformMBeanServer" />
@ -35,16 +35,8 @@
</New> </New>
<!-- Add to the Server to listen for object events --> <!-- Add to the Server to listen for object events -->
<Get id="Container" name="container"> <Call name="addEventListener">
<Call name="addEventListener"> <Arg><Ref id="MBeanContainer" /></Arg>
<Arg><Ref id="MBeanContainer" /></Arg>
</Call>
</Get>
<!-- Add to the Server as a managed lifecycle -->
<Call name="addBean">
<Arg><Ref id="MBeanContainer"/></Arg>
<Arg type="boolean">true</Arg>
</Call> </Call>
<!-- Add the static log --> <!-- Add the static log -->

View File

@ -0,0 +1,2 @@
OPTIONS=jmx
etc/jetty-jmx.xml

View File

@ -2,5 +2,7 @@
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Call class="org.eclipse.jetty.util.log.Log" name="info"><Arg>Executing jetty-web.xml for <Property name="overlay.instance"/></Arg></Call> <Get class="org.eclipse.jetty.util.log.Log" name="rootLogger">
</Configure> <Call name="info"><Arg>Executing jetty-web.xml for <Property name="overlay.instance"/></Arg></Call>
</Get>
</Configure>

View File

@ -1,5 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!-- =============================================================== --> <!-- =============================================================== -->
<!-- Configure the Jetty Server --> <!-- Configure the Jetty Server -->
@ -16,32 +17,28 @@
<Configure id="Server" class="org.eclipse.jetty.server.Server"> <Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- =========================================================== --> <!-- =========================================================== -->
<!-- Server Thread Pool --> <!-- Server Thread Pool -->
<!-- =========================================================== --> <!-- =========================================================== -->
<Set name="ThreadPool"> <Arg name="threadpool">
<!-- Default queued blocking threadpool --> <New id="threadpool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
<New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
<Set name="minThreads">10</Set> <Set name="minThreads">10</Set>
<Set name="maxThreads">200</Set> <Set name="maxThreads">200</Set>
<Set name="detailedDump">false</Set> <Set name="detailedDump">false</Set>
</New> </New>
</Set> </Arg>
<Arg name="container"><Ref id="Container"/></Arg>
<!-- =========================================================== --> <!-- =========================================================== -->
<!-- Set connectors --> <!-- Set connectors -->
<!-- =========================================================== --> <!-- =========================================================== -->
<Call name="addConnector"> <Call name="addConnector">
<Arg> <Arg>
<New class="org.eclipse.jetty.server.SelectChannelConnector"> <New class="org.eclipse.jetty.server.SelectChannelConnector">
<Arg name="server"><Ref id="Server" /></Arg>
<Set name="host"><Property name="jetty.host" /></Set> <Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="8080"/></Set> <Set name="port"><Property name="jetty.port" default="8080"/></Set>
<Set name="idleTimeout">300000</Set> <Set name="idleTimeout">300000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
</New> </New>
</Arg> </Arg>
</Call> </Call>

View File

@ -58,12 +58,12 @@ public class SelectChannelConnector extends AbstractNetworkConnector
private volatile boolean _reuseAddress = true; private volatile boolean _reuseAddress = true;
private volatile int _lingerTime = -1; private volatile int _lingerTime = -1;
public SelectChannelConnector(Server server) public SelectChannelConnector(@Name("server") Server server)
{ {
this(server, null); this(server, null);
} }
public SelectChannelConnector(Server server, SslContextFactory sslContextFactory) public SelectChannelConnector(@Name("server")Server server, @Name("sslContextFactory") SslContextFactory sslContextFactory)
{ {
this(server, null, null, null, sslContextFactory, 0, 0); this(server, null, null, null, sslContextFactory, 0, 0);
} }

View File

@ -47,6 +47,7 @@ import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject; import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.Name;
import org.eclipse.jetty.util.component.Container; import org.eclipse.jetty.util.component.Container;
import org.eclipse.jetty.util.component.Destroyable; import org.eclipse.jetty.util.component.Destroyable;
import org.eclipse.jetty.util.component.Graceful; import org.eclipse.jetty.util.component.Graceful;
@ -80,7 +81,7 @@ public class Server extends HandlerWrapper implements Attributes
__version=System.getProperty("jetty.version","9.x.y.z-SNAPSHOT"); __version=System.getProperty("jetty.version","9.x.y.z-SNAPSHOT");
} }
private final Container _container=new Container(); private final Container _container;
private final AttributesMap _attributes = new AttributesMap(); private final AttributesMap _attributes = new AttributesMap();
private final ThreadPool _threadPool; private final ThreadPool _threadPool;
private final List<Connector> _connectors = new CopyOnWriteArrayList<>(); private final List<Connector> _connectors = new CopyOnWriteArrayList<>();
@ -102,7 +103,7 @@ public class Server extends HandlerWrapper implements Attributes
/** Convenience constructor /** Convenience constructor
* Creates server and a {@link SelectChannelConnector} at the passed port. * Creates server and a {@link SelectChannelConnector} at the passed port.
*/ */
public Server(int port) public Server(@Name("port")int port)
{ {
this((ThreadPool)null); this((ThreadPool)null);
SelectChannelConnector connector=new SelectChannelConnector(this); SelectChannelConnector connector=new SelectChannelConnector(this);
@ -114,7 +115,7 @@ public class Server extends HandlerWrapper implements Attributes
/** Convenience constructor /** Convenience constructor
* Creates server and a {@link SelectChannelConnector} at the passed address. * Creates server and a {@link SelectChannelConnector} at the passed address.
*/ */
public Server(InetSocketAddress addr) public Server(@Name("address")InetSocketAddress addr)
{ {
this((ThreadPool)null); this((ThreadPool)null);
SelectChannelConnector connector=new SelectChannelConnector(this); SelectChannelConnector connector=new SelectChannelConnector(this);
@ -125,9 +126,16 @@ public class Server extends HandlerWrapper implements Attributes
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
public Server(ThreadPool pool) public Server(@Name("threadpool") ThreadPool pool)
{
this(pool,null);
}
/* ------------------------------------------------------------ */
public Server(@Name("threadpool") ThreadPool pool,@Name("container") Container container)
{ {
_threadPool=pool!=null?pool:new QueuedThreadPool(); _threadPool=pool!=null?pool:new QueuedThreadPool();
_container=container!=null?container:new Container();
addBean(_threadPool); addBean(_threadPool);
setServer(this); setServer(this);
} }

View File

@ -167,7 +167,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
private Map<String, Object> _managedAttributes; private Map<String, Object> _managedAttributes;
private String[] _protectedTargets; private String[] _protectedTargets;
public enum Availability { AVAILABLE,SHUTDOWN,UNAVAILABLE}; public enum Availability { UNAVAILABLE,STARTING,AVAILABLE,SHUTDOWN,};
private volatile Availability _availability; private volatile Availability _availability;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
@ -666,7 +666,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
@Override @Override
protected void doStart() throws Exception protected void doStart() throws Exception
{ {
_availability = Availability.UNAVAILABLE; _availability = Availability.STARTING;
if (_contextPath == null) if (_contextPath == null)
throw new IllegalStateException("Null contextPath"); throw new IllegalStateException("Null contextPath");
@ -696,6 +696,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
startContext(); startContext();
_availability = Availability.AVAILABLE; _availability = Availability.AVAILABLE;
LOG.info("started {}",this);
} }
finally finally
{ {
@ -756,7 +757,6 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
public void callContextInitialized (ServletContextListener l, ServletContextEvent e) public void callContextInitialized (ServletContextListener l, ServletContextEvent e)
{ {
l.contextInitialized(e); l.contextInitialized(e);
LOG.info("started {}",this);
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */

View File

@ -38,8 +38,8 @@ import org.eclipse.jetty.continuation.Continuation;
import org.eclipse.jetty.continuation.ContinuationListener; import org.eclipse.jetty.continuation.ContinuationListener;
import org.eclipse.jetty.continuation.ContinuationSupport; import org.eclipse.jetty.continuation.ContinuationSupport;
import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.server.gzip.AbstractCompressedStream; import org.eclipse.jetty.servlets.gzip.AbstractCompressedStream;
import org.eclipse.jetty.server.gzip.CompressedResponseWrapper; import org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.log.Logger;

View File

@ -32,8 +32,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.io.UncheckedPrintWriter; import org.eclipse.jetty.io.UncheckedPrintWriter;
import org.eclipse.jetty.server.gzip.AbstractCompressedStream; import org.eclipse.jetty.servlets.gzip.AbstractCompressedStream;
import org.eclipse.jetty.server.gzip.CompressedResponseWrapper; import org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** Includable GZip Filter. /** Includable GZip Filter.

View File

@ -16,7 +16,7 @@
// ======================================================================== // ========================================================================
// //
package org.eclipse.jetty.server.gzip; package org.eclipse.jetty.servlets.gzip;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;

View File

@ -16,7 +16,7 @@
// ======================================================================== // ========================================================================
// //
package org.eclipse.jetty.server.gzip; package org.eclipse.jetty.servlets.gzip;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
@ -58,7 +58,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#setMimeTypes(java.util.Set) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#setMimeTypes(java.util.Set)
*/ */
public void setMimeTypes(Set<String> mimeTypes) public void setMimeTypes(Set<String> mimeTypes)
{ {
@ -67,7 +67,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#setBufferSize(int) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#setBufferSize(int)
*/ */
@Override @Override
public void setBufferSize(int bufferSize) public void setBufferSize(int bufferSize)
@ -77,7 +77,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#setMinCompressSize(int) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#setMinCompressSize(int)
*/ */
public void setMinCompressSize(int minCompressSize) public void setMinCompressSize(int minCompressSize)
{ {
@ -86,7 +86,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#setContentType(java.lang.String) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#setContentType(java.lang.String)
*/ */
@Override @Override
public void setContentType(String ct) public void setContentType(String ct)
@ -110,7 +110,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#setStatus(int, java.lang.String) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#setStatus(int, java.lang.String)
*/ */
@Override @Override
public void setStatus(int sc, String sm) public void setStatus(int sc, String sm)
@ -122,7 +122,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#setStatus(int) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#setStatus(int)
*/ */
@Override @Override
public void setStatus(int sc) public void setStatus(int sc)
@ -134,7 +134,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#setContentLength(int) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#setContentLength(int)
*/ */
@Override @Override
public void setContentLength(int length) public void setContentLength(int length)
@ -164,7 +164,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#addHeader(java.lang.String, java.lang.String) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#addHeader(java.lang.String, java.lang.String)
*/ */
@Override @Override
public void addHeader(String name, String value) public void addHeader(String name, String value)
@ -193,7 +193,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#flushBuffer() * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#flushBuffer()
*/ */
@Override @Override
public void flushBuffer() throws IOException public void flushBuffer() throws IOException
@ -208,7 +208,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#reset() * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#reset()
*/ */
@Override @Override
public void reset() public void reset()
@ -224,7 +224,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#resetBuffer() * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#resetBuffer()
*/ */
@Override @Override
public void resetBuffer() public void resetBuffer()
@ -238,7 +238,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#sendError(int, java.lang.String) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#sendError(int, java.lang.String)
*/ */
@Override @Override
public void sendError(int sc, String msg) throws IOException public void sendError(int sc, String msg) throws IOException
@ -249,7 +249,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#sendError(int) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#sendError(int)
*/ */
@Override @Override
public void sendError(int sc) throws IOException public void sendError(int sc) throws IOException
@ -260,7 +260,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#sendRedirect(java.lang.String) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#sendRedirect(java.lang.String)
*/ */
@Override @Override
public void sendRedirect(String location) throws IOException public void sendRedirect(String location) throws IOException
@ -271,7 +271,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#noCompression() * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#noCompression()
*/ */
public void noCompression() public void noCompression()
{ {
@ -291,7 +291,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#finish() * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#finish()
*/ */
public void finish() throws IOException public void finish() throws IOException
{ {
@ -303,7 +303,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#setHeader(java.lang.String, java.lang.String) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#setHeader(java.lang.String, java.lang.String)
*/ */
@Override @Override
public void setHeader(String name, String value) public void setHeader(String name, String value)
@ -330,7 +330,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#getOutputStream() * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#getOutputStream()
*/ */
@Override @Override
public ServletOutputStream getOutputStream() throws IOException public ServletOutputStream getOutputStream() throws IOException
@ -353,7 +353,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#getWriter() * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#getWriter()
*/ */
@Override @Override
public PrintWriter getWriter() throws IOException public PrintWriter getWriter() throws IOException
@ -377,7 +377,7 @@ public abstract class CompressedResponseWrapper extends HttpServletResponseWrapp
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
* @see org.eclipse.jetty.server.gzip.CompressedResponseWrapper#setIntHeader(java.lang.String, int) * @see org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper#setIntHeader(java.lang.String, int)
*/ */
@Override @Override
public void setIntHeader(String name, int value) public void setIntHeader(String name, int value)

View File

@ -16,7 +16,7 @@
// ======================================================================== // ========================================================================
// //
package org.eclipse.jetty.server.handler; package org.eclipse.jetty.servlets.gzip;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
@ -38,8 +38,9 @@ import org.eclipse.jetty.continuation.ContinuationListener;
import org.eclipse.jetty.continuation.ContinuationSupport; import org.eclipse.jetty.continuation.ContinuationSupport;
import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.gzip.AbstractCompressedStream; import org.eclipse.jetty.servlets.gzip.AbstractCompressedStream;
import org.eclipse.jetty.server.gzip.CompressedResponseWrapper; import org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper;
import org.eclipse.jetty.server.handler.HandlerWrapper;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.log.Logger;

View File

@ -24,8 +24,8 @@ import java.util.List;
import javax.servlet.Servlet; import javax.servlet.Servlet;
import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.server.gzip.CompressedResponseWrapper;
import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper;
import org.eclipse.jetty.servlets.gzip.GzipTester; import org.eclipse.jetty.servlets.gzip.GzipTester;
import org.eclipse.jetty.servlets.gzip.TestServletLengthStreamTypeWrite; import org.eclipse.jetty.servlets.gzip.TestServletLengthStreamTypeWrite;
import org.eclipse.jetty.servlets.gzip.TestServletLengthTypeStreamWrite; import org.eclipse.jetty.servlets.gzip.TestServletLengthTypeStreamWrite;

View File

@ -27,9 +27,9 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.server.gzip.CompressedResponseWrapper;
import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper;
import org.eclipse.jetty.servlets.gzip.GzipTester; import org.eclipse.jetty.servlets.gzip.GzipTester;
import org.eclipse.jetty.toolchain.test.TestingDir; import org.eclipse.jetty.toolchain.test.TestingDir;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;

View File

@ -142,9 +142,9 @@ public class Main
{ {
List<String> ini_args=new ArrayList<String>(); List<String> ini_args=new ArrayList<String>();
File start_ini = new File(_jettyHome,"start.ini"); File start_ini = new File(_jettyHome,"start.ini");
if (start_ini.exists())
ini_args.addAll(loadStartIni(start_ini)); boolean start_ini_processed=!start_ini.exists();
File start_d = new File(_jettyHome,"start.d"); File start_d = new File(_jettyHome,"start.d");
if (start_d.isDirectory()) if (start_d.isDirectory())
{ {
@ -156,9 +156,21 @@ public class Main
} }
}); });
Arrays.sort(inis); Arrays.sort(inis);
for (File i : inis) for (File i : inis)
{
if (!start_ini_processed && i.getName().charAt(0)>'0')
{
start_ini_processed=true;
ini_args.addAll(loadStartIni(start_ini));
}
ini_args.addAll(loadStartIni(i)); ini_args.addAll(loadStartIni(i));
}
} }
if (!start_ini_processed )
ini_args.addAll(loadStartIni(start_ini));
return ini_args; return ini_args;
} }
@ -392,7 +404,7 @@ public class Main
} }
else if (info.equals("@STARTINI")) else if (info.equals("@STARTINI"))
{ {
List<String> ini = loadStartIni(new File(_jettyHome,"start.ini")); List<String> ini = parseStartIniFiles();
if (ini != null && ini.size() > 0) if (ini != null && ini.size() > 0)
{ {
for (String a : ini) for (String a : ini)

View File

@ -4,18 +4,18 @@
# #
# Each line contains entry in the format: # Each line contains entry in the format:
# #
# SUBJECT [ [!] CONDITION [AND|OR] ]* # SUBJECT [ [!] CONDITION [AND|OR] ]*
# #
# where SUBJECT: # where SUBJECT:
# ends with ".class" is the Main class to run. # ends with ".class" is the Main class to run.
# ends with ".xml" is a configuration file for the command line # ends with ".xml" is a configuration file for the command line
# ends with "/" is a directory from which to add all jar and zip files. # ends with "/" is a directory from which to add all jar and zip files.
# ends with "/*" is a directory from which to add all unconsidered jar and zip files. # ends with "/*" is a directory from which to add all unconsidered jar and zip files.
# ends with "/**" is a directory from which to recursively add all unconsidered jar and zip files. # ends with "/**" is a directory from which to recursively add all unconsidered jar and zip files.
# Containing = are used to assign system properties. # Containing = are used to assign system properties.
# Containing ~= are used to assign start properties. # Containing ~= are used to assign start properties.
# Containing /= are used to assign a canonical path. # Containing /= are used to assign a canonical path.
# all other subjects are treated as files to be added to the classpath. # all other subjects are treated as files to be added to the classpath.
# #
# ${name} is expanded to a start property # ${name} is expanded to a start property
# $(name) is expanded to either a start property or a system property. # $(name) is expanded to either a start property or a system property.
@ -25,15 +25,15 @@
# the home directory. # the home directory.
# #
# CONDITION is one of: # CONDITION is one of:
# always # always
# never # never
# available classname # true if class on classpath # available classname # true if class on classpath
# property name # true if set as start property # property name # true if set as start property
# system name # true if set as system property # system name # true if set as system property
# exists file # true if file/dir exists # exists file # true if file/dir exists
# java OPERATOR version # java version compared to literal # java OPERATOR version # java version compared to literal
# nargs OPERATOR number # number of command line args compared to literal # nargs OPERATOR number # number of command line args compared to literal
# OPERATOR := one of "<",">","<=",">=","==","!=" # OPERATOR := one of "<",">","<=",">=","==","!="
# #
# CONTITIONS can be combined with AND OR or !, with AND being the assume # CONTITIONS can be combined with AND OR or !, with AND being the assume
# operator for a list of CONDITIONS. # operator for a list of CONDITIONS.
@ -45,117 +45,118 @@
# [ssl,default] # [ssl,default]
# #
# Clauses after a section header will only be included if they match one of the tags in the # Clauses after a section header will only be included if they match one of the tags in the
# options property. By default options are set to "default,*" or the OPTIONS property may # options property. By default options are set to "default,*" or the OPTIONS property may
# be used to pass in a list of tags, eg. : # be used to pass in a list of tags, eg. :
# #
# java -jar start.jar OPTIONS=jetty,jsp,ssl # java -jar start.jar OPTIONS=jetty,jsp,ssl
# #
# The tag '*' is always appended to the options, so any section with the * tag is always # The tag '*' is always appended to the options, so any section with the * tag is always
# applied. # applied.
# #
# add a property defined classpath # add a property defined classpath
${path}.path property path ${path}.path property path
# add a property defined library directory # add a property defined library directory
${lib}/** exists ${lib} ${lib}/** exists ${lib}
# Try different settings of jetty.home until the start.jar is found. # Try different settings of jetty.home until the start.jar is found.
jetty.home=. ! exists $(jetty.home)/start.jar jetty.home=. ! exists $(jetty.home)/start.jar
jetty.home=.. ! exists $(jetty.home)/start.jar jetty.home=.. ! exists $(jetty.home)/start.jar
jetty.home=jetty-distribution/src/main/resources ! exists $(jetty.home)/start.jar jetty.home=jetty-distribution/src/main/resources ! exists $(jetty.home)/start.jar
jetty.home=../jetty-distribution/src/main/resources ! exists $(jetty.home)/start.jar jetty.home=../jetty-distribution/src/main/resources ! exists $(jetty.home)/start.jar
jetty.home=. ! exists $(jetty.home)/start.jar jetty.home=. ! exists $(jetty.home)/start.jar
jetty.home/=$(jetty.home) exists $(jetty.home)/start.jar jetty.home/=$(jetty.home) exists $(jetty.home)/start.jar
# The main class to run # The main class to run
org.eclipse.jetty.xml.XmlConfiguration.class org.eclipse.jetty.xml.XmlConfiguration.class
${start.class}.class property start.class ${start.class}.class property start.class
# The default configuration files # The default configuration files
$(jetty.home)/etc/jetty.xml nargs == 0 $(jetty.home)/etc/jetty.xml nargs == 0
./jetty-server/src/main/config/etc/jetty.xml nargs == 0 AND ! exists $(jetty.home)/etc/jetty.xml ./jetty-server/src/main/config/etc/jetty.xml nargs == 0 AND ! exists $(jetty.home)/etc/jetty.xml
# Default OPTIONS if not specified on the command line # Default OPTIONS if not specified on the command line
OPTIONS~=default,* ! property OPTIONS OPTIONS~=default,* ! property OPTIONS
# Add a resources directory if it is there # Add a resources directory if it is there
[All,resources,default] [All,resources,default]
$(jetty.home)/resources/ $(jetty.home)/resources/
# Add jetty modules # Add jetty modules
[*] [*]
$(jetty.home)/lib/jetty-util-$(version).jar ! available org.eclipse.jetty.util.StringUtil $(jetty.home)/lib/jetty-util-$(version).jar ! available org.eclipse.jetty.util.StringUtil
$(jetty.home)/lib/jetty-io-$(version).jar ! available org.eclipse.jetty.io.Buffer $(jetty.home)/lib/jetty-io-$(version).jar ! available org.eclipse.jetty.io.Buffer
[Server,All,xml,default] [Server,All,xml,default]
$(jetty.home)/lib/jetty-xml-$(version).jar ! available org.eclipse.jetty.xml.XmlParser $(jetty.home)/lib/jetty-xml-$(version).jar ! available org.eclipse.jetty.xml.XmlParser
[Server,All,server,default] [Server,All,server,default]
$(jetty.home)/lib/servlet-api-3.0.jar ! available javax.servlet.ServletContext $(jetty.home)/lib/servlet-api-3.0.jar ! available javax.servlet.ServletContext
$(jetty.home)/lib/jetty-http-$(version).jar ! available org.eclipse.jetty.http.HttpParser $(jetty.home)/lib/jetty-http-$(version).jar ! available org.eclipse.jetty.http.HttpParser
$(jetty.home)/lib/jetty-continuation-$(version).jar ! available org.eclipse.jetty.continuation.Continuation $(jetty.home)/lib/jetty-continuation-$(version).jar ! available org.eclipse.jetty.continuation.Continuation
$(jetty.home)/lib/jetty-server-$(version).jar ! available org.eclipse.jetty.server.Server $(jetty.home)/lib/jetty-server-$(version).jar ! available org.eclipse.jetty.server.Server
[Server,All,security,default] [Server,All,security,default]
$(jetty.home)/lib/jetty-security-$(version).jar ! available org.eclipse.jetty.security.LoginService $(jetty.home)/lib/jetty-security-$(version).jar ! available org.eclipse.jetty.security.LoginService
[Server,All,servlet,default] [Server,All,servlet,default]
$(jetty.home)/lib/servlet-api-3.0.jar ! available javax.servlet.ServletContext $(jetty.home)/lib/servlet-api-3.0.jar ! available javax.servlet.ServletContext
$(jetty.home)/lib/jetty-servlet-$(version).jar ! available org.eclipse.jetty.servlet.ServletHandler $(jetty.home)/lib/jetty-servlet-$(version).jar ! available org.eclipse.jetty.servlet.ServletHandler
[Server,All,webapp,default] [Server,All,webapp,default]
$(jetty.home)/lib/jetty-webapp-$(version).jar ! available org.eclipse.jetty.webapp.WebAppContext $(jetty.home)/lib/jetty-webapp-$(version).jar ! available org.eclipse.jetty.webapp.WebAppContext
[Server,All,deploy,default] [Server,All,deploy,default]
$(jetty.home)/lib/jetty-deploy-$(version).jar ! available org.eclipse.jetty.deploy.ContextDeployer $(jetty.home)/lib/jetty-deploy-$(version).jar ! available org.eclipse.jetty.deploy.ContextDeployer
[Server,All,servlets,default] [Server,All,servlets,default]
$(jetty.home)/lib/jetty-servlets-$(version).jar ! available org.eclipse.jetty.servlets.WelcomeFilter $(jetty.home)/lib/jetty-servlets-$(version).jar ! available org.eclipse.jetty.servlets.WelcomeFilter
[All,rewrite] [All,rewrite]
$(jetty.home)/lib/jetty-rewrite-$(version).jar ! available org.eclipse.jetty.rewrite.handler.RewriteHandler $(jetty.home)/lib/jetty-rewrite-$(version).jar ! available org.eclipse.jetty.rewrite.handler.RewriteHandler
[All,jmx] [All,jmx]
$(jetty.home)/lib/jetty-jmx-$(version).jar ! available org.eclipse.jetty.jmx.MBeanContainer $(jetty.home)/lib/jetty-jmx-$(version).jar ! available org.eclipse.jetty.jmx.MBeanContainer
[All,ajp] [All,ajp]
$(jetty.home)/lib/jetty-ajp-$(version).jar ! available org.eclipse.jetty.ajp.Ajp13Connection $(jetty.home)/lib/jetty-ajp-$(version).jar ! available org.eclipse.jetty.ajp.Ajp13Connection
[All,plus,jndi] [All,plus,jndi]
$(jetty.home)/lib/jetty-jndi-${version}.jar ! available org.eclipse.jetty.jndi.ContextFactory $(jetty.home)/lib/jetty-jndi-${version}.jar ! available org.eclipse.jetty.jndi.ContextFactory
$(jetty.home)/lib/jetty-plus-${version}.jar ! available org.eclipse.jetty.plus.jndi.NamingEntry $(jetty.home)/lib/jetty-plus-${version}.jar ! available org.eclipse.jetty.plus.jndi.NamingEntry
$(jetty.home)/lib/jndi/** exists $(jetty.home)/lib/jndi $(jetty.home)/lib/jndi/** exists $(jetty.home)/lib/jndi
[All,annotations] [All,annotations]
$(jetty.home)/lib/jetty-annotations-$(version).jar ! available org.eclipse.jetty.annotations.AnnotationFinder $(jetty.home)/lib/jetty-annotations-$(version).jar ! available org.eclipse.jetty.annotations.AnnotationFinder
$(jetty.home)/lib/annotations/** exists $(jetty.home)/lib/jndi $(jetty.home)/lib/annotations/** exists $(jetty.home)/lib/jndi
[All,setuid] [All,setuid]
$(jetty.home)/lib/jetty-setuid-$(version).jar ! available org.eclipse.jetty.setuid.SetUID $(jetty.home)/lib/jetty-setuid-$(version).jar ! available org.eclipse.jetty.setuid.SetUID
$(jetty.home)/lib/setuid/** $(jetty.home)/lib/setuid/**
[All,policy] [All,policy]
$(jetty.home)/lib/jetty-policy-$(version).jar ! available org.eclipse.jetty.policy.JettyPolicy $(jetty.home)/lib/jetty-policy-$(version).jar ! available org.eclipse.jetty.policy.JettyPolicy
[All,Client,client] [All,Client,client]
$(jetty.home)/lib/jetty-http-$(version).jar ! available org.eclipse.jetty.http.HttpParser $(jetty.home)/lib/jetty-http-$(version).jar ! available org.eclipse.jetty.http.HttpParser
$(jetty.home)/lib/jetty-client-$(version).jar ! available org.eclipse.jetty.client.HttpClient $(jetty.home)/lib/jetty-client-$(version).jar ! available org.eclipse.jetty.client.HttpClient
[Client] [Client]
$(jetty.home)/lib/jetty-http-$(version).jar ! available org.eclipse.jetty.http.HttpParser $(jetty.home)/lib/jetty-http-$(version).jar ! available org.eclipse.jetty.http.HttpParser
[All,websocket] [All,websocket]
$(jetty.home)/lib/jetty-websocket-$(version).jar ! available org.eclipse.jetty.websocket.WebSocket $(jetty.home)/lib/websocket-core-$(version).jar ! available org.eclipse.jetty.websocket.api.WebSocketConnection
$(jetty.home)/lib/websocket-server-$(version).jar ! available org.eclipse.jetty.websocket.server.WebSocketServlet
[All,overlay,overlays] [All,overlay,overlays]
$(jetty.home)/lib/jetty-overlay-deployer-$(version).jar ! available org.eclipse.jetty.overlay.OverlayedAppProvider $(jetty.home)/lib/jetty-overlay-deployer-$(version).jar ! available org.eclipse.jetty.overlay.OverlayedAppProvider
# Add ext if it exists # Add ext if it exists
[Server,All,default,ext] [Server,All,default,ext]
$(jetty.home)/lib/ext/** $(jetty.home)/lib/ext/**
# Add all other sub-directories in /lib/ as options in a dynamic way # Add all other sub-directories in /lib/ as options in a dynamic way
[All,=$(jetty.home)/lib/**] [All,=$(jetty.home)/lib/**]

View File

@ -120,9 +120,12 @@ Defaults:
which are used if no command line arguments are provided and override which are used if no command line arguments are provided and override
the defaults in the start.config file. If the directory jetty.home/start.d the defaults in the start.config file. If the directory jetty.home/start.d
exists, then multiple *.ini files will be read from that directory in exists, then multiple *.ini files will be read from that directory in
alphabetical order. If --ini options are provided on the command line, alphabetical order. The contents of start.ini are processed after any
then start.ini and start.d will NOT be read. start.d files starting with a character <= "0".
The current start.ini arguments are: If --ini options are provided on the command line, then start.ini and
start.d will NOT be read.
The current start.ini/start.d arguments are:
@STARTINI@ @STARTINI@

View File

@ -22,7 +22,9 @@
</Arg> </Arg>
</New> </New>
<Call class="org.eclipse.jetty.util.log.Log" name="info"><Arg>Redirecting stderr/stdout to <Ref id="ServerLogName"/></Arg></Call> <Get class="org.eclipse.jetty.util.log.Log" name="rootLogger">
<Call name="info"><Arg>Redirecting stderr/stdout to <Ref id="ServerLogName"/></Arg></Call>
</Get>
<Call class="java.lang.System" name="setErr"><Arg><Ref id="ServerLog"/></Arg></Call> <Call class="java.lang.System" name="setErr"><Arg><Ref id="ServerLog"/></Arg></Call>
<Call class="java.lang.System" name="setOut"><Arg><Ref id="ServerLog"/></Arg></Call> <Call class="java.lang.System" name="setOut"><Arg><Ref id="ServerLog"/></Arg></Call>

View File

@ -107,8 +107,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
"org.eclipse.jetty.continuation.", // webapp cannot change continuation classes "org.eclipse.jetty.continuation.", // webapp cannot change continuation classes
"org.eclipse.jetty.jndi.", // webapp cannot change naming classes "org.eclipse.jetty.jndi.", // webapp cannot change naming classes
"org.eclipse.jetty.plus.jaas.", // webapp cannot change jaas classes "org.eclipse.jetty.plus.jaas.", // webapp cannot change jaas classes
"org.eclipse.jetty.websocket.WebSocket", // WebSocket is a jetty extension "org.eclipse.jetty.websocket.", // WebSocket is a jetty extension
"org.eclipse.jetty.websocket.WebSocketFactory", // WebSocket is a jetty extension
"org.eclipse.jetty.servlet.DefaultServlet" // webapp cannot change default servlets "org.eclipse.jetty.servlet.DefaultServlet" // webapp cannot change default servlets
} ; } ;
@ -121,8 +120,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
"-org.eclipse.jetty.continuation.", // don't hide continuation classes "-org.eclipse.jetty.continuation.", // don't hide continuation classes
"-org.eclipse.jetty.jndi.", // don't hide naming classes "-org.eclipse.jetty.jndi.", // don't hide naming classes
"-org.eclipse.jetty.plus.jaas.", // don't hide jaas classes "-org.eclipse.jetty.plus.jaas.", // don't hide jaas classes
"-org.eclipse.jetty.websocket.WebSocket", // WebSocket is a jetty extension "-org.eclipse.jetty.websocket.", // WebSocket is a jetty extension
"-org.eclipse.jetty.websocket.WebSocketFactory", // WebSocket is a jetty extension
"-org.eclipse.jetty.servlet.DefaultServlet", // don't hide default servlet "-org.eclipse.jetty.servlet.DefaultServlet", // don't hide default servlet
"-org.eclipse.jetty.servlet.listener.", // don't hide useful listeners "-org.eclipse.jetty.servlet.listener.", // don't hide useful listeners
"org.eclipse.jetty." // hide other jetty classes "org.eclipse.jetty." // hide other jetty classes
@ -855,13 +853,18 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
} }
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
@Override @Override
public String toString() public String toString()
{ {
return super.toString()+(_war==null?"":(","+_war)); if (_war!=null)
{
String war=_war;
if (war.indexOf("/webapps/")>=0)
war=war.substring(war.indexOf("/webapps/")+8);
return super.toString()+"{"+war+"}";
}
return super.toString();
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */

View File

@ -346,6 +346,22 @@ public class XmlConfiguration
if (id != null) if (id != null)
_idMap.put(id,obj); _idMap.put(id,obj);
// Object already constructed so skip any arguments
for (; i < cfg.size(); i++)
{
Object o = cfg.get(i);
if (o instanceof String)
continue;
XmlParser.Node node = (XmlParser.Node)o;
if ("Arg".equals(node.getTag()))
{
LOG.warn("Ignored arg: "+node);
continue;
}
break;
}
// Process real arguments
for (; i < cfg.size(); i++) for (; i < cfg.size(); i++)
{ {
Object o = cfg.get(i); Object o = cfg.get(i);

View File

@ -26,6 +26,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.eclipse.jetty.util.annotation.Name;
import org.junit.Ignore; import org.junit.Ignore;
@Ignore @Ignore
@ -33,6 +34,7 @@ public class TestConfiguration extends HashMap<String,Object>
{ {
public static int VALUE=77; public static int VALUE=77;
public final String name;
public TestConfiguration nested; public TestConfiguration nested;
public Object testObject; public Object testObject;
public int testInt; public int testInt;
@ -49,7 +51,19 @@ public class TestConfiguration extends HashMap<String,Object>
private Set set; private Set set;
private ConstructorArgTestClass constructorArgTestClass; private ConstructorArgTestClass constructorArgTestClass;
public Map map; public Map map;
public TestConfiguration()
{
this("");
}
public TestConfiguration(@Name("name") String n)
{
name=n;
}
public void setTest(Object value) public void setTest(Object value)
{ {
testObject=value; testObject=value;
@ -73,7 +87,7 @@ public class TestConfiguration extends HashMap<String,Object>
public TestConfiguration call(Boolean b) public TestConfiguration call(Boolean b)
{ {
nested=new TestConfiguration(); nested=new TestConfiguration("called-"+name);
nested.put("Arg",b); nested.put("Arg",b);
return nested; return nested;
} }

View File

@ -56,7 +56,7 @@ public class XmlConfigurationTest
URL url = XmlConfigurationTest.class.getClassLoader().getResource(_configure); URL url = XmlConfigurationTest.class.getClassLoader().getResource(_configure);
XmlConfiguration configuration = new XmlConfiguration(url); XmlConfiguration configuration = new XmlConfiguration(url);
TestConfiguration tc = new TestConfiguration(); TestConfiguration tc = new TestConfiguration("tc");
configuration.getProperties().putAll(properties); configuration.getProperties().putAll(properties);
configuration.configure(tc); configuration.configure(tc);

View File

@ -2,6 +2,7 @@
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.xml.TestConfiguration"> <Configure class="org.eclipse.jetty.xml.TestConfiguration">
<Arg name="name">name</Arg>
<Set name="Test">SetValue</Set> <Set name="Test">SetValue</Set>
<Set name="Test" type="int"><Property name="does.not.exist" default="2"/></Set> <Set name="Test" type="int"><Property name="does.not.exist" default="2"/></Set>

View File

@ -378,8 +378,11 @@
<module>jetty-annotations</module> <module>jetty-annotations</module>
<module>jetty-jndi</module> <module>jetty-jndi</module>
<module>jetty-jsp</module> <module>jetty-jsp</module>
<module>jetty-distribution</module>
<module>jetty-spring</module> <module>jetty-spring</module>
<!-- modules that need fixed and added back, or simply dropped and not maintained <!-- modules that need fixed and added back, or simply dropped and not maintained
<module>jetty-runner</module> <module>jetty-runner</module>
@ -533,7 +536,6 @@
<!-- <!--
<module>jetty-aggregate</module> <module>jetty-aggregate</module>
--> -->
<module>jetty-distribution</module>
</modules> </modules>
</profile> </profile>
<profile> <profile>