Last active
October 10, 2018 08:37
-
-
Save exhesham/886c4bbc2e13bcfc4ad805d941e33a64 to your computer and use it in GitHub Desktop.
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
public class FilterLogin implements Filter { | |
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain){ | |
// inject cookie | |
Cookie c = getCookie(httpServletResponse, "WASReqURL"); | |
if(c == null){ | |
// inject the cookie if it is not there | |
c = new Cookie("WASReqURL", ""); | |
httpServletResponse.addCookie(c); | |
} | |
String newUrl = "/my_action_servlet"; | |
// update the cookie value with the new url | |
c.setValue(newUrl); | |
// continue to the j_security_check | |
chain.doFilter(request, response); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment