forked from zhuzhengping911/MySpringBoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyFilter.java
More file actions
29 lines (21 loc) · 750 Bytes
/
Copy pathMyFilter.java
File metadata and controls
29 lines (21 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.Filter;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* Created by zhuzhengping on 2017/2/12.
*/
public class MyFilter implements Filter{
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest resquest = (HttpServletRequest) servletRequest;
System.out.println("this is myfilter,url:" + resquest.getRequestURI());
filterChain.doFilter(servletRequest,servletResponse);
}
@Override
public void destroy() {
}
}