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 can I add a servlet filter programmatically?

Although I've seen many similar questions, I didn't find a clear answer. Using Servlet Spec 2.5, is it possible to add …

java servlets servlet-filters
doFilter not getting called

Could you help to check why doFilter not getting called web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app …

java servlets servlet-filters
Servlet filter url mapping

How can a filter be mapped to the root of a URL? I'm using Tomcat 7.0.2 and deploying an application as …

java servlets servlet-filters url-pattern
Session variables in ServletRequest

I need to access session variables through a filter. I don't even know if it is possible. In practice, the …

java servlets servlet-filters
Failed to retrieve Session from FacesContext inside a Servlet Filter

After autheticating my user, I want to put a reference in the session to current logged in user. Here how …

jsf session servlet-filters facescontext
ContentCachingResponseWrapper Produces Empty Response

I'm trying to implement filter for logging requests and responses in Spring MVC application. I use the following code: @Component …

spring-mvc servlets spring-boot servlet-filters
How to setup Access-Control-Allow-Origin filter problematically in Spring Security 3.2

I am trying to setup my Spring server with Spring Security 3.2 to be able to do an ajax login request. …

spring spring-mvc spring-security http-headers servlet-filters
Servlet.init() and Filter.init() call sequence

In which order are Servlet.init() and Filter.init() methods called in java web application? Which one is called first? …

java servlets jakarta-ee servlet-filters
Multiple filters with same url mapping

Is it possible to use two filters that have the same url-mapping? <filter> <filter-name>TeeFilter</…

java servlets servlet-filters web.xml
FacesContext#getCurrentInstance() returns null in Filter#doFilter()

Inside a public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) I wanted to get the session using FacesContext.getCurrentInstance().…

jsf servlet-filters