首页>代码>基于java servlet+jsp+javascript实现的简易聊天系统>/communicate/src/com/znzz/chat/filter/CharacterFilter.java
package com.znzz.chat.filter;

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;
import javax.servlet.annotation.WebFilter;

/**
 * Servlet Filter implementation class CharacterFilter
 */
@WebFilter("/CharacterFilter")
public class CharacterFilter implements Filter {

    /**
     * Default constructor. 
     */
    public CharacterFilter() {
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see Filter#destroy()
	 */
	public void destroy() {
		// TODO Auto-generated method stub
	}

	/**
	 * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)
	 */
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		// TODO Auto-generated method stub
		// place your code here
		request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");
		// pass the request along the filter chain
		chain.doFilter(request, response);
	}

	/**
	 * @see Filter#init(FilterConfig)
	 */
	public void init(FilterConfig fConfig) throws ServletException {
		// TODO Auto-generated method stub
	}

}
最近下载更多
heling0315hhh  LV1 2023年4月22日
jhh123  LV4 2022年6月2日
zzfzzf  LV7 2022年4月22日
A907419988  LV1 2022年1月16日
famloliy  LV6 2022年1月12日
TMY9930  LV1 2021年10月22日
xaiozhu  LV7 2021年5月23日
liu222  LV7 2021年5月11日
AV女优q  LV2 2021年5月7日
Игорь.  LV8 2021年3月31日
最近浏览更多
Rinkia 2024年3月13日
暂无贡献等级
asddwh  LV13 2023年12月26日
1234567p  LV1 2023年12月4日
lalalla159  LV3 2023年12月2日
hhhhui  LV1 2023年11月12日
wbx666  LV1 2023年9月25日
yybb7435100  LV2 2023年8月7日
你爹正在加载中  LV4 2023年7月19日
yewang666  LV1 2023年6月28日
liuliuyl  LV3 2023年6月17日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友