|
spring-web | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.web.context.AbstractContextLoaderInitializer
public abstract class AbstractContextLoaderInitializer
Convenient base class for WebApplicationInitializer implementations that
register a ContextLoaderListener in the servlet context.
The only method required to be implemented by subclasses is createRootApplicationContext(), which gets invoked from registerContextLoaderListener(javax.servlet.ServletContext).
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses. |
| Constructor Summary | |
|---|---|
AbstractContextLoaderInitializer()
|
|
| Method Summary | |
|---|---|
protected abstract WebApplicationContext |
createRootApplicationContext()
Create the "root" application context to be provided to the ContextLoaderListener. |
void |
onStartup(javax.servlet.ServletContext servletContext)
Configure the given ServletContext with any servlets, filters, listeners
context-params and attributes necessary for initializing this web application. |
protected void |
registerContextLoaderListener(javax.servlet.ServletContext servletContext)
Register a ContextLoaderListener against the given servlet context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public AbstractContextLoaderInitializer()
| Method Detail |
|---|
public void onStartup(javax.servlet.ServletContext servletContext)
throws javax.servlet.ServletException
WebApplicationInitializerServletContext with any servlets, filters, listeners
context-params and attributes necessary for initializing this web application. See
examples above.
onStartup in interface WebApplicationInitializerservletContext - the ServletContext to initialize
javax.servlet.ServletException - if any call against the given ServletContext
throws a ServletExceptionprotected void registerContextLoaderListener(javax.servlet.ServletContext servletContext)
ContextLoaderListener against the given servlet context. The
ContextLoaderListener is initialized with the application context returned
from the createRootApplicationContext() template method.
servletContext - the servlet context to register the listener againstprotected abstract WebApplicationContext createRootApplicationContext()
ContextLoaderListener.
The returned context is delegated to
ContextLoaderListener.ContextLoaderListener(WebApplicationContext) and will
be established as the parent context for any DispatcherServlet application
contexts. As such, it typically contains middle-tier services, data sources, etc.
null if a root context is not
desiredorg.springframework.web.servlet.support.AbstractDispatcherServletInitializer
|
spring-web | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||