Package com.jk.web.filters
Class JKDefaultFilter
java.lang.Object
com.jk.web.filters.JKDefaultFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
This class is a servlet filter that provides default behavior for caching and
processing requests.
It handles caching for specific types of resources such as JavaScript, CSS, images, fonts, and more.
Additionally, it can be configured to perform specific actions based on request parameters, such as converting the response to a PDF format.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
void
doFilter
(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) void
init
(jakarta.servlet.FilterConfig arg0) static boolean
isMultipartContent
(jakarta.servlet.http.HttpServletRequest request) This method checks if the request is of multi-part content type.
-
Constructor Details
-
JKDefaultFilter
public JKDefaultFilter()
-
-
Method Details
-
destroy
public void destroy()- Specified by:
destroy
in interfacejakarta.servlet.Filter
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilter
in interfacejakarta.servlet.Filter
- Throws:
IOException
jakarta.servlet.ServletException
-
isMultipartContent
public static boolean isMultipartContent(jakarta.servlet.http.HttpServletRequest request) This method checks if the request is of multi-part content type.- Parameters:
request
- Specifies the HTTP servlet request.- Returns:
- true, if the request is of multi-part content type, false otherwise.
-
init
public void init(jakarta.servlet.FilterConfig arg0) throws jakarta.servlet.ServletException - Specified by:
init
in interfacejakarta.servlet.Filter
- Throws:
jakarta.servlet.ServletException
-