2024年4月15日发(作者:)

filter会执行几次?Why?

感觉自己真的太浅薄了,什么都不是很懂,什么都是一知半解,filter,http协议那只是一个缩影而以

可以百度,google出来的问题都不叫问题吧

那些不专业的人们啊,可不可以不要误人子弟?请不要随意在网上上回答你不太懂的东西好吗?给网络一片净土

➢ 今天用eclipse在JavaEE下写了一个filter:

public class EncodeingFilter implements Filter {

protected String encoding = null;

protected FilterConfig filterConfig = null;

public EncodeingFilter() {

}

public void destroy() {

}

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws

IOException, ServletException {

n("我是filter");

n("title:"+ameter("title"));

er(request, response);

}

public void init(FilterConfig fConfig) throws ServletException {

// Web应用启动的时候,会调用

Config = fConfig ;

ng = tParameter("encoding");

}

}

➢ 如下配置:

EncodeingFilter

ingFilter

encoding