Skip to content

Instantly share code, notes, and snippets.

Last active Oct 10, 2018
What would you like to do?
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", "");
String newUrl = "/my_action_servlet";
// update the cookie value with the new url
// 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