60e92ad518e8001b1f64ced6b2628f88

来自「JSP与STRUT开发的酒店管理系统,请各位试用」· 代码 · 共 37 行

TXT
37
字号
package com;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class FilterTest implements Filter {
	protected FilterConfig config;
	String targerEncoding = "gb2312";

	public void init(FilterConfig config) throws ServletException {
		// TODO Auto-generated method stub
		this.config = config;
		this.targerEncoding = config.getInitParameter("Encoding");

	}

	public void doFilter(ServletRequest arg0, ServletResponse arg1,
			FilterChain arg2) throws IOException, ServletException {
		// TODO Auto-generated method stub
        System.out.println("现在使用的编码方式为:"+this.targerEncoding);
        
	}

	public void destroy() {
		// TODO Auto-generated method stub
		this.config = null;

	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?