org.riotfamily.common.web.servlet
Class ReloadableDispatcherServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.springframework.web.servlet.HttpServletBean
org.springframework.web.servlet.FrameworkServlet
org.springframework.web.servlet.DispatcherServlet
org.riotfamily.common.web.servlet.ReloadableDispatcherServlet
- All Implemented Interfaces:
- Serializable, EventListener, Servlet, ServletConfig, ConfigurableBean, ApplicationListener
public class ReloadableDispatcherServlet
- extends DispatcherServlet
- implements ConfigurableBean
DispatcherServlet that checks whether one of the configuration files has
been modified. If a change is detected the servlet is re-initalized and the
underlying BeanFactory is refreshed.
As checks are performed upon each request you might want to set the
reloadable
init parameter to false
when used in
a production environment. Alternatively you can add a
ReloadableDispatcherServletConfig
bean to your ApplicationContext
which allows you to set the reloadable
property without
modifying the web.xml.
- Author:
- Felix Gnass [fgnass at neteye dot de], Jan-Frederic Linde [jfl at neteye dot de]
- See Also:
- Serialized Form
Fields inherited from class org.springframework.web.servlet.DispatcherServlet |
HANDLER_ADAPTER_BEAN_NAME, HANDLER_EXCEPTION_RESOLVER_BEAN_NAME, HANDLER_EXECUTION_CHAIN_ATTRIBUTE, HANDLER_MAPPING_BEAN_NAME, LOCALE_RESOLVER_ATTRIBUTE, LOCALE_RESOLVER_BEAN_NAME, MULTIPART_RESOLVER_BEAN_NAME, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger, REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME, THEME_RESOLVER_ATTRIBUTE, THEME_RESOLVER_BEAN_NAME, THEME_SOURCE_ATTRIBUTE, VIEW_RESOLVER_BEAN_NAME, WEB_APPLICATION_CONTEXT_ATTRIBUTE |
Methods inherited from class org.springframework.web.servlet.DispatcherServlet |
buildLocaleContext, checkMultipart, cleanupMultipart, createDefaultStrategy, doService, getDefaultStrategies, getDefaultStrategy, getDefaultViewName, getHandler, getHandlerAdapter, getLastModified, getMultipartResolver, getThemeSource, initStrategies, noHandlerFound, processHandlerException, render, resolveViewName, setCleanupAfterInclude, setDetectAllHandlerAdapters, setDetectAllHandlerExceptionResolvers, setDetectAllHandlerMappings, setDetectAllViewResolvers, setThreadContextInheritable |
Methods inherited from class org.springframework.web.servlet.FrameworkServlet |
createWebApplicationContext, destroy, doDelete, doGet, doOptions, doPost, doPut, doTrace, findWebApplicationContext, getContextAttribute, getContextConfigLocation, getNamespace, getServletContextAttributeName, getUsernameForRequest, getWebApplicationContext, initFrameworkServlet, initServletBean, initWebApplicationContext, onApplicationEvent, postProcessWebApplicationContext, processRequest, refresh, setContextAttribute, setContextClass, setContextConfigLocation, setDispatchOptionsRequest, setDispatchTraceRequest, setNamespace, setPublishContext, setPublishEvents |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReloadableDispatcherServlet
public ReloadableDispatcherServlet()
getContextClass
public Class<? extends ApplicationContext> getContextClass()
- Overrides:
getContextClass
in class FrameworkServlet
setReloadable
public void setReloadable(boolean reloadable)
isReloadable
public boolean isReloadable()
- Specified by:
isReloadable
in interface ConfigurableBean
onRefresh
protected void onRefresh(ApplicationContext context)
throws BeansException
- Overrides:
onRefresh
in class DispatcherServlet
- Throws:
BeansException
doDispatch
protected void doDispatch(HttpServletRequest request,
HttpServletResponse response)
throws Exception
- Overrides:
doDispatch
in class DispatcherServlet
- Throws:
Exception
configure
public void configure()
- Specified by:
configure
in interface ConfigurableBean