Top "Servlet-filters" questions

In the Servlet API, you normally use a Servlet when you want to control, preprocess and/or postprocess specific requests.

How filter chain invocation works?

I am trying to understand filter chaining.As defined in this question All filters are chained (in the order of …

java jakarta-ee servlet-filters
Servlet filter for browser caching?

Does anyone know how to go about coding a servlet filter that will set cache headers on a response for …

java servlets caching servlet-filters
Filter mapping Url pattern *.action not working struts2

in the struts2 web.xml application i have filter and servlet web.xml ... <servlet> <servlet-name>SchServlet&…

struts2 web.xml servlet-filters url-pattern action-mapping
Spring interceptor vs servlet filter

What advantages does a Spring interceptor have over a servlet filter?

java spring spring-mvc servlet-filters
WebFilter urlPatterns ignored

I have read numerous examples though I seem to have an 'exact' copy of them, so I cannot figure out …

java jsf servlet-filters url-pattern
How do I get a SessionScoped CDI bean from inside a Filter?

This question is related to a previous one on writing a session timeout handler. The answer in that thread involved …

jsf-2 servlet-filters cdi
ByteArrayOutputStream to PrintWriter (Java Servlet)

Writing generated PDF (ByteArrayOutputStream) in a Servlet to PrintWriter. I am desperately looking for a way to write a generated …

java servlets servlet-filters printwriter bytearrayoutputstream
Using Tomcat, @WebFilter doesn't work with <filter-mapping> inside web.xml

Here's a working web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/…

java jakarta-ee tomcat servlet-filters
web.xml order or filter and listener

For a Java EE web application, I have a listener that implements ServletRequestListener, and a Filter. Is there a way …

servlets servlet-filters servlet-listeners
Is there any easy way to preprocess and redirect GET requests?

I'm looking for a best practise answer. I want to do some preprocessing for GET requests. So e.g. if …

jsf authentication jsf-2 servlet-filters