forked from fanruan/design
Jinbokai
6 years ago
2 changed files with 51 additions and 0 deletions
@ -0,0 +1,29 @@
|
||||
package com.fr.start.server; |
||||
|
||||
import javax.servlet.*; |
||||
import java.io.IOException; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
public class ForbidType implements Filter { |
||||
private String message; |
||||
|
||||
public void init(FilterConfig config) throws ServletException { |
||||
message = config.getInitParameter("msg"); |
||||
|
||||
System.out.println("Filter is ready."); |
||||
} |
||||
|
||||
@Override |
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { |
||||
System.out.println(message); |
||||
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse; |
||||
|
||||
response.sendRedirect("/webroot/decision"); |
||||
} |
||||
|
||||
public void destroy() { |
||||
|
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue