Class SpringMiltonFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
Use contextConfigClass to define the @Configuration class or
contextConfigLocation to define the Spring XML configuration file. If
any of them is defined, SpringMiltonFilter will try to load a file
named applicationContext.xml from the classpath.
If it still fails, only the parent context will be considered.
This filter then gets the bean named milton.http.manager and uses that for Milton processing.
The milton.http.manager bean can either be a HttpManager or it can be
a HttpManagerBuilder, in which case a HttpManager is
constructed from it
Requests with a path which begins with one of the exclude paths will not be processed by Milton. Instead, for these requests, the filter chain will be invoked so the request can be serviced by JSP or a servlet, etc
This uses an init parameter called milton.exclude.paths, which should
be a comma separated list of paths to ignore. For example:
/static,/images,/login.jsp
This allows non-Milton resources to be accessed, while still mapping all URLs to Milton
- Author:
- bradm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()voiddoFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp, jakarta.servlet.FilterChain fc) voidinit(jakarta.servlet.FilterConfig fc) protected voidinitSpringApplicationContext(jakarta.servlet.FilterConfig fc)
-
Constructor Details
-
SpringMiltonFilter
public SpringMiltonFilter()
-
-
Method Details
-
init
public void init(jakarta.servlet.FilterConfig fc) throws jakarta.servlet.ServletException - Specified by:
initin interfacejakarta.servlet.Filter- Throws:
jakarta.servlet.ServletException
-
initSpringApplicationContext
protected void initSpringApplicationContext(jakarta.servlet.FilterConfig fc) -
doFilter
public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp, jakarta.servlet.FilterChain fc) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilterin interfacejakarta.servlet.Filter- Throws:
IOExceptionjakarta.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroyin interfacejakarta.servlet.Filter
-