Package org.apache.catalina.ssi
Class SSIFilter
- java.lang.Object
-
- jakarta.servlet.GenericFilter
-
- org.apache.catalina.ssi.SSIFilter
-
- All Implemented Interfaces:
Filter,FilterConfig,java.io.Serializable
public class SSIFilter extends GenericFilter
Filter to process SSI requests within a webpage. Mapped to a content types from within web.xml.- See Also:
SSIServlet, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowExecWhen true, allows the exec directive (normally blocked for security).protected java.util.regex.PatterncontentTypeRegExRegex pattern to match when evaluating content types for SSI processing.protected intdebugDebug level for this servlet.protected java.lang.LongexpiresExpiration time in seconds for the doc.protected booleanisVirtualWebappRelativeWhen true, virtual paths are interpreted as webapp-relative.protected java.util.regex.PatternshtmlRegExDefault pattern for matching SHTML content type.
-
Constructor Summary
Constructors Constructor Description SSIFilter()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoFilter(ServletRequest request, ServletResponse response, FilterChain chain)Captures the response, processes SSI directives if the content type matches, and writes the output.voidinit()Initializes the filter by reading configuration parameters.-
Methods inherited from class jakarta.servlet.GenericFilter
getFilterConfig, getFilterName, getInitParameter, getInitParameterNames, getServletContext, init
-
-
-
-
Field Detail
-
debug
protected int debug
Debug level for this servlet.
-
expires
protected java.lang.Long expires
Expiration time in seconds for the doc.
-
isVirtualWebappRelative
protected boolean isVirtualWebappRelative
When true, virtual paths are interpreted as webapp-relative.
-
contentTypeRegEx
protected java.util.regex.Pattern contentTypeRegEx
Regex pattern to match when evaluating content types for SSI processing.
-
shtmlRegEx
protected final java.util.regex.Pattern shtmlRegEx
Default pattern for matching SHTML content type.
-
allowExec
protected boolean allowExec
When true, allows the exec directive (normally blocked for security).
-
-
Method Detail
-
init
public void init() throws ServletExceptionInitializes the filter by reading configuration parameters.- Overrides:
initin classGenericFilter- Throws:
ServletException- If an exception occurs that interrupts the Filter's normal operation
-
doFilter
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException
Captures the response, processes SSI directives if the content type matches, and writes the output.- Parameters:
request- The request to processresponse- The response associated with the requestchain- Provides access to the next filter in the chain for this filter to pass the request and response to for further processing- Throws:
java.io.IOException- if an I/O error occurs during this filter's processing of the requestServletException- if the processing fails for any other reason
-
-