Package org.apache.tapestry5.http
Class TapestryFilter
- java.lang.Object
- 
- org.apache.tapestry5.http.TapestryFilter
 
- 
- All Implemented Interfaces:
- javax.servlet.Filter
 - Direct Known Subclasses:
- TapestryFilter,- TapestrySpringFilter
 
 public class TapestryFilter extends java.lang.Object implements javax.servlet.Filter The TapestryFilter is responsible for intercepting all requests into the web application. It identifies the requests that are relevant to Tapestry, and lets the servlet container handle the rest. It is also responsible for initializing Tapestry. The application is primarily configured via context-level init parameters.- tapestry.app-package
- The application package (used to search for pages, components, etc.)
 tapestry.execution-mode(with default value "production"). This property is a comma-separated list of execution modes. For each mode, an additional init parameter is checked for:tapestry.mode-modules; this is a comma-separated list of module class names to load. In this way, more precise control over the available modules can be obtained which is often needed during testing.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringREGISTRY_CONTEXT_NAMEKey under which the Tapestry IoCRegistryis stored in the ServletContext.
 - 
Constructor SummaryConstructors Constructor Description TapestryFilter()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Shuts down and discards the registry.protected voiddestroy(Registry registry)Invoked fromdestroy()to allow subclasses to add additional shutdown logic to the filter.voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)protected javax.servlet.FilterConfiggetFilterConfig()voidinit(javax.servlet.FilterConfig filterConfig)Initializes the filter using theTapestryAppInitializer.protected voidinit(Registry registry)Invoked frominit(FilterConfig)after the Registry has been created, to allow any additional initialization to occur.protected java.lang.Class[]provideExtraModuleClasses(javax.servlet.ServletContext context)Overridden in subclasses to provide additional module classes beyond those normally located.protected ModuleDef[]provideExtraModuleDefs(javax.servlet.ServletContext context)Overridden in subclasses to provide additional module definitions beyond those normally located.voidrunFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
 
- 
- 
- 
Field Detail- 
REGISTRY_CONTEXT_NAMEpublic static final java.lang.String REGISTRY_CONTEXT_NAME Key under which the Tapestry IoCRegistryis stored in the ServletContext. This allows other code, beyond Tapestry, to obtain the Registry and, from it, any Tapestry services. Such code should be careful about invokingRegistry.cleanupThread()appropriately.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
TapestryFilterpublic TapestryFilter() 
 
- 
 - 
Method Detail- 
initpublic final void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException Initializes the filter using theTapestryAppInitializer. The application name is the capitalization of the filter name (as specified in web.xml).- Specified by:
- initin interface- javax.servlet.Filter
- Throws:
- javax.servlet.ServletException
 
 - 
getFilterConfigprotected final javax.servlet.FilterConfig getFilterConfig() 
 - 
initprotected void init(Registry registry) throws javax.servlet.ServletException Invoked frominit(FilterConfig)after the Registry has been created, to allow any additional initialization to occur. This implementation does nothing, and my be overridden in subclasses.- Parameters:
- registry- from which services may be extracted
- Throws:
- javax.servlet.ServletException
 
 - 
provideExtraModuleDefsprotected ModuleDef[] provideExtraModuleDefs(javax.servlet.ServletContext context) Overridden in subclasses to provide additional module definitions beyond those normally located. This implementation returns an empty array.
 - 
provideExtraModuleClassesprotected java.lang.Class[] provideExtraModuleClasses(javax.servlet.ServletContext context) Overridden in subclasses to provide additional module classes beyond those normally located. This implementation returns an empty array.- Since:
- 5.3
 
 - 
runFilterpublic final void runFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException - Throws:
- java.io.IOException
- javax.servlet.ServletException
 
 - 
doFilterpublic final void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException - Specified by:
- doFilterin interface- javax.servlet.Filter
- Throws:
- java.io.IOException
- javax.servlet.ServletException
 
 - 
destroypublic final void destroy() Shuts down and discards the registry. Invokesdestroy(org.apache.tapestry5.ioc.Registry)to allow subclasses to perform any shutdown logic, then shuts down the registry, and removes it from the ServletContext.- Specified by:
- destroyin interface- javax.servlet.Filter
 
 
- 
 
-