Chinaunix首页 | 论坛 | 博客
  • 博客访问: 820850
  • 博文数量: 780
  • 博客积分: 7000
  • 博客等级: 少将
  • 技术积分: 5010
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-12 09:11
文章分类

全部博文(780)

文章存档

2011年(1)

2008年(779)

我的朋友
最近访客

分类:

2008-09-12 09:14:58

     package jp.co.ricoh.gtis.others.profile.filters;


    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 SetCharacterEncodingFilter implements Filter {
     private String encoding;
     public void init(FilterConfig filterConfig) throws ServletException {
      // TODO Auto-generated method stub
      this.encoding=filterConfig.getInitParameter("encoding");
     }

     public void doFilter(ServletRequest request, ServletResponse response,
       FilterChain chain) throws IOException, ServletException {
      // TODO Auto-generated method stub
      request.setCharacterEncoding(this.encoding);
      chain.doFilter(request,response);
     }

     public void destroy() {
      // TODO Auto-generated method stub

     }

    }


--------------------next---------------------

阅读(348) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~