Created
May 15, 2012 04:56
-
-
Save vvasabi/2699227 to your computer and use it in GitHub Desktop.
Filter that wraps request in CustomRequestWrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import javax.servlet.Filter; | |
import javax.servlet.FilterChain; | |
import javax.servlet.FilterConfig; | |
import javax.servlet.ServletException; | |
import javax.servlet.ServletRequest; | |
import javax.servlet.ServletResponse; | |
import javax.servlet.http.HttpServletRequest; | |
public class WrapRequestFilter implements Filter { | |
@Override | |
public void init(FilterConfig filterConfig) throws ServletException { | |
// NOOP | |
} | |
@Override | |
public void doFilter(ServletRequest request, ServletResponse response, | |
FilterChain chain) throws IOException, ServletException { | |
chain.doFilter(new CustomRequestWrapper((HttpServletRequest)request), | |
response); | |
} | |
@Override | |
public void destroy() { | |
// NOOP | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment