|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AggregateLifeCycle
org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandlerContainer
org.eclipse.jetty.server.handler.HandlerWrapper
org.eclipse.jetty.server.handler.ScopedHandler
org.eclipse.jetty.servlet.ServletHandler
public class ServletHandler
Servlet HttpHandler. This handler maps requests to servlets that implement the javax.servlet.http.HttpServlet API.
This handler does not implement the full J2EE features and is intended to
be used directly when a full web application is not required. If a Web application is required,
then this handler should be used as part of a org.eclipse.jetty.webapp.WebAppContext.
Unless run as part of a ServletContextHandler or derivative, the initialize()
method must be called manually after start().
| 嵌套类摘要 |
|---|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口 |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| 从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口 |
|---|
LifeCycle.Listener |
| 字段摘要 | |
|---|---|
static String |
__DEFAULT_SERVLET
|
protected ConcurrentMap<String,FilterChain>[] |
_chainCache
|
protected Queue<String>[] |
_chainLRU
|
| 从类 org.eclipse.jetty.server.handler.ScopedHandler 继承的字段 |
|---|
_nextScope, _outerScope |
| 从类 org.eclipse.jetty.server.handler.HandlerWrapper 继承的字段 |
|---|
_handler |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段 |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| 构造方法摘要 | |
|---|---|
ServletHandler()
Constructor. |
|
| 方法摘要 | |
|---|---|
void |
addFilter(FilterHolder filter)
Convenience method to add a preconstructed FilterHolder |
void |
addFilter(FilterHolder filter,
FilterMapping filterMapping)
convenience method to add a filter and mapping |
FilterHolder |
addFilter(String className,
String pathSpec,
EnumSet<DispatcherType> dispatches)
已过时。 use #addFilterWithMapping(Class, String, EnumSet instead |
void |
addFilterMapping(FilterMapping mapping)
Convenience method to add a preconstructed FilterMapping |
FilterHolder |
addFilterWithMapping(Class<? extends Filter> filter,
String pathSpec,
EnumSet<DispatcherType> dispatches)
Convenience method to add a filter. |
FilterHolder |
addFilterWithMapping(Class<? extends Filter> filter,
String pathSpec,
int dispatches)
Convenience method to add a filter. |
void |
addFilterWithMapping(FilterHolder holder,
String pathSpec,
EnumSet<DispatcherType> dispatches)
Convenience method to add a filter. |
void |
addFilterWithMapping(FilterHolder holder,
String pathSpec,
int dispatches)
Convenience method to add a filter. |
FilterHolder |
addFilterWithMapping(String className,
String pathSpec,
EnumSet<DispatcherType> dispatches)
Convenience method to add a filter. |
FilterHolder |
addFilterWithMapping(String className,
String pathSpec,
int dispatches)
Convenience method to add a filter. |
void |
addServlet(ServletHolder holder)
Convenience method to add a pre-constructed ServletHolder. |
void |
addServletMapping(ServletMapping mapping)
Convenience method to add a pre-constructed ServletMapping. |
ServletHolder |
addServletWithMapping(Class<? extends Servlet> servlet,
String pathSpec)
conveniance method to add a servlet. |
void |
addServletWithMapping(ServletHolder servlet,
String pathSpec)
conveniance method to add a servlet. |
ServletHolder |
addServletWithMapping(String className,
String pathSpec)
Convenience method to add a servlet. |
void |
doHandle(String target,
Request baseRequest,
HttpServletRequest request,
HttpServletResponse response)
|
void |
doScope(String target,
Request baseRequest,
HttpServletRequest request,
HttpServletResponse response)
|
protected void |
doStart()
Start the managed lifecycle beans in the order they were added. |
protected void |
doStop()
Stop the joined lifecycle beans in the reverse order they were added. |
void |
dump(Appendable out,
String indent)
|
Object |
getContextLog()
|
FilterHolder |
getFilter(String name)
|
FilterMapping[] |
getFilterMappings()
|
FilterHolder[] |
getFilters()
Get Filters. |
PathMap.Entry |
getHolderEntry(String pathInContext)
ServletHolder matching path. |
int |
getMaxFilterChainsCacheSize()
|
ServletHolder |
getServlet(String name)
|
ServletContext |
getServletContext()
|
ServletMapping |
getServletMapping(String pattern)
|
ServletMapping[] |
getServletMappings()
|
ServletHolder[] |
getServlets()
Get Servlets. |
void |
initialize()
Initialize filters and load-on-startup servlets. |
protected FilterMapping[] |
insertFilterMapping(FilterMapping mapping,
int pos,
boolean before)
Insert a filtermapping in the list |
boolean |
isAvailable()
|
boolean |
isFilterChainsCached()
|
boolean |
isStartWithUnavailable()
|
FilterHolder |
newFilterHolder(Holder.Source source)
|
ServletHolder |
newServletHolder(Holder.Source source)
see also newServletHolder(Class) |
protected void |
notFound(HttpServletRequest request,
HttpServletResponse response)
|
void |
prependFilterMapping(FilterMapping mapping)
Convenience method to add a preconstructed FilterMapping |
void |
setFilterChainsCached(boolean filterChainsCached)
|
void |
setFilterMappings(FilterMapping[] filterMappings)
|
void |
setFilters(FilterHolder[] holders)
|
void |
setMaxFilterChainsCacheSize(int maxFilterChainsCacheSize)
Set the maximum filter chain cache size. |
void |
setServer(Server server)
|
void |
setServletMappings(ServletMapping[] servletMappings)
|
void |
setServlets(ServletHolder[] holders)
Set Servlets. |
Set<String> |
setServletSecurity(ServletRegistration.Dynamic registration,
ServletSecurityElement servletSecurityElement)
|
void |
setStartWithUnavailable(boolean start)
|
protected void |
updateMappings()
|
protected void |
updateNameMappings()
|
| 从类 org.eclipse.jetty.server.handler.ScopedHandler 继承的方法 |
|---|
handle, never, nextHandle, nextScope |
| 从类 org.eclipse.jetty.server.handler.HandlerWrapper 继承的方法 |
|---|
destroy, expandChildren, getHandler, getHandlers, getNestedHandlerByClass, setHandler |
| 从类 org.eclipse.jetty.server.handler.AbstractHandlerContainer 继承的方法 |
|---|
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass |
| 从类 org.eclipse.jetty.server.handler.AbstractHandler 继承的方法 |
|---|
dumpThis, getServer |
| 从类 org.eclipse.jetty.util.component.AggregateLifeCycle 继承的方法 |
|---|
addBean, addBean, contains, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, unmanage |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法 |
|---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 从接口 org.eclipse.jetty.util.component.LifeCycle 继承的方法 |
|---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 字段详细信息 |
|---|
public static final String __DEFAULT_SERVLET
protected final ConcurrentMap<String,FilterChain>[] _chainCache
protected final Queue<String>[] _chainLRU
| 构造方法详细信息 |
|---|
public ServletHandler()
| 方法详细信息 |
|---|
public void setServer(Server server)
Handler 中的 setServerHandlerWrapper 中的 setServer
protected void doStart()
throws Exception
AggregateLifeCycle 复制的描述
ScopedHandler 中的 doStartExceptionHandlerWrapper.doStart()
protected void doStop()
throws Exception
AggregateLifeCycle 复制的描述
HandlerWrapper 中的 doStopExceptionAbstractLifeCycle.doStart()public Object getContextLog()
public FilterMapping[] getFilterMappings()
public FilterHolder[] getFilters()
public PathMap.Entry getHolderEntry(String pathInContext)
pathInContext - Path within _context.
public ServletContext getServletContext()
public ServletMapping[] getServletMappings()
public ServletMapping getServletMapping(String pattern)
public ServletHolder[] getServlets()
public ServletHolder getServlet(String name)
public void doScope(String target,
Request baseRequest,
HttpServletRequest request,
HttpServletResponse response)
throws IOException,
ServletException
ScopedHandler 中的 doScopeIOException
ServletException
public void doHandle(String target,
Request baseRequest,
HttpServletRequest request,
HttpServletResponse response)
throws IOException,
ServletException
ScopedHandler 中的 doHandleIOException
ServletExceptionpublic boolean isAvailable()
public void setStartWithUnavailable(boolean start)
start - True if this handler will start with unavailable servletspublic boolean isStartWithUnavailable()
public void initialize()
throws Exception
Exceptionpublic boolean isFilterChainsCached()
public ServletHolder newServletHolder(Holder.Source source)
public ServletHolder addServletWithMapping(String className,
String pathSpec)
public ServletHolder addServletWithMapping(Class<? extends Servlet> servlet,
String pathSpec)
public void addServletWithMapping(ServletHolder servlet,
String pathSpec)
servlet - servlet holder to addpathSpec - servlet mappings for the servletHolderpublic void addServlet(ServletHolder holder)
holder - public void addServletMapping(ServletMapping mapping)
mapping -
public Set<String> setServletSecurity(ServletRegistration.Dynamic registration,
ServletSecurityElement servletSecurityElement)
public FilterHolder newFilterHolder(Holder.Source source)
#newFilterHolder(Class)public FilterHolder getFilter(String name)
public FilterHolder addFilterWithMapping(Class<? extends Filter> filter,
String pathSpec,
EnumSet<DispatcherType> dispatches)
filter - class of filter to createpathSpec - filter mappings for filterdispatches - see FilterMapping.setDispatches(int)
public FilterHolder addFilterWithMapping(String className,
String pathSpec,
EnumSet<DispatcherType> dispatches)
className - of filterpathSpec - filter mappings for filterdispatches - see FilterMapping.setDispatches(int)
public void addFilterWithMapping(FilterHolder holder,
String pathSpec,
EnumSet<DispatcherType> dispatches)
holder - filter holder to addpathSpec - filter mappings for filterdispatches - see FilterMapping.setDispatches(int)
public FilterHolder addFilterWithMapping(Class<? extends Filter> filter,
String pathSpec,
int dispatches)
filter - class of filter to createpathSpec - filter mappings for filterdispatches - see FilterMapping.setDispatches(int)
public FilterHolder addFilterWithMapping(String className,
String pathSpec,
int dispatches)
className - of filterpathSpec - filter mappings for filterdispatches - see FilterMapping.setDispatches(int)
public void addFilterWithMapping(FilterHolder holder,
String pathSpec,
int dispatches)
holder - filter holder to addpathSpec - filter mappings for filterdispatches - see FilterMapping.setDispatches(int)
public FilterHolder addFilter(String className,
String pathSpec,
EnumSet<DispatcherType> dispatches)
#addFilterWithMapping(Class, String, EnumSet) instead
className - pathSpec - dispatches -
public void addFilter(FilterHolder filter,
FilterMapping filterMapping)
filter - filterMapping - public void addFilter(FilterHolder filter)
filter - public void addFilterMapping(FilterMapping mapping)
mapping - public void prependFilterMapping(FilterMapping mapping)
mapping -
protected FilterMapping[] insertFilterMapping(FilterMapping mapping,
int pos,
boolean before)
mapping - the FilterMapping to addpos - the position in the existing arry at which to add itbefore - if true, insert before pos, if false insert after it
protected void updateNameMappings()
protected void updateMappings()
protected void notFound(HttpServletRequest request,
HttpServletResponse response)
throws IOException
IOExceptionpublic void setFilterChainsCached(boolean filterChainsCached)
filterChainsCached - The filterChainsCached to set.public void setFilterMappings(FilterMapping[] filterMappings)
filterMappings - The filterMappings to set.public void setFilters(FilterHolder[] holders)
public void setServletMappings(ServletMapping[] servletMappings)
servletMappings - The servletMappings to set.public void setServlets(ServletHolder[] holders)
holders - Array of servletsto definepublic int getMaxFilterChainsCacheSize()
public void setMaxFilterChainsCacheSize(int maxFilterChainsCacheSize)
isFilterChainsCached() is true. If the max cache size
is greater than zero, then the cache is flushed whenever it grows to be this size.
maxFilterChainsCacheSize - the maximum number of entries in a filter chain cache.
public void dump(Appendable out,
String indent)
throws IOException
Dumpable 中的 dumpAbstractHandlerContainer 中的 dumpIOException
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||