提交 | 用户 | 时间
|
58d006
|
1 |
package com.mandi.servlet; |
A |
2 |
|
|
3 |
import java.io.IOException; |
|
4 |
|
|
5 |
import javax.servlet.Filter; |
|
6 |
import javax.servlet.FilterChain; |
|
7 |
import javax.servlet.FilterConfig; |
|
8 |
import javax.servlet.ServletContext; |
|
9 |
import javax.servlet.ServletException; |
|
10 |
import javax.servlet.ServletRequest; |
|
11 |
import javax.servlet.ServletResponse; |
|
12 |
import javax.servlet.http.HttpServletRequest; |
|
13 |
import javax.servlet.http.HttpServletResponse; |
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
import org.apache.log4j.Logger; |
|
19 |
|
|
20 |
/** |
|
21 |
* @author mengly |
|
22 |
* @version 创建时间:2015年10月19日 下午7:31:46 |
|
23 |
* 类说明 |
|
24 |
*/ |
|
25 |
//@WebFilter(filterName="webinfofilter",urlPatterns={"*.jsf"}) |
|
26 |
public class Webinfofilter implements Filter{ |
|
27 |
private Logger log=Logger.getLogger(Webinfofilter.class); |
|
28 |
@Override |
|
29 |
public void doFilter(ServletRequest arg0, ServletResponse arg1, |
|
30 |
FilterChain arg2) throws IOException, ServletException { |
|
31 |
HttpServletRequest r=(HttpServletRequest)arg0; |
|
32 |
HttpServletResponse re=(HttpServletResponse)arg1; |
|
33 |
ServletContext sc=r.getSession().getServletContext(); |
|
34 |
// Webinfo wi=(Webinfo)sc.getAttribute(ConstantVar.sc_webinfo); |
|
35 |
String uri=r.getRequestURI(); |
|
36 |
if(uri.endsWith("webinforeg.jsf")) |
|
37 |
{ |
|
38 |
arg2.doFilter(arg0, arg1); |
|
39 |
return; |
|
40 |
} |
|
41 |
// log.info("start to check key..."+Jacksonmethod.tojson_date(wi, true)); |
|
42 |
return ; |
|
43 |
// if(Webinfoutil.scheckkey(wi)) |
|
44 |
// { |
|
45 |
// log.info("check ok"); |
|
46 |
// arg2.doFilter(arg0, arg1); |
|
47 |
// return; |
|
48 |
// }else{ |
|
49 |
// //如果是regkey不等于null,则已经注册过,失效了 |
|
50 |
// if(wi.getRegkey()!=null) |
|
51 |
// { |
|
52 |
// //清空classes里面所有的class |
|
53 |
// Webinfoutil.delclasses(this); |
|
54 |
// } |
|
55 |
// |
|
56 |
// re.sendRedirect(r.getServletContext().getContextPath()+"/administrate/system/webinforeg.jsf"); |
|
57 |
// return; |
|
58 |
// } |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public void destroy() { |
|
63 |
} |
|
64 |
@Override |
|
65 |
public void init(FilterConfig arg0) throws ServletException { |
|
66 |
} |
|
67 |
|
|
68 |
} |