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