MyFilter.java.svn-base
上传用户:liangcc
上传日期:2019-05-24
资源大小:4412k
文件大小:1k
- package com.softeem.webmail.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.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import javax.servlet.http.HttpSession;
- public class MyFilter implements Filter{
- public void destroy() {
-
-
- }
- public void doFilter(ServletRequest arg0, ServletResponse arg1,
- FilterChain chain) throws IOException, ServletException {
- HttpServletRequest request=(HttpServletRequest) arg0;
- HttpServletResponse response=(HttpServletResponse) arg1;
- request.setCharacterEncoding("UTF-8");
- response.setContentType("text/html;charset=UTF-8");
- //HttpSession session=request.getSession(false);
- /*
- *
- * 全局过滤Session
- *
- * */
- // if(session==null){
- // response.sendRedirect("index.jsp");
- //
- // }
-
- chain.doFilter(request, response);
-
- }
- public void init(FilterConfig arg0) throws ServletException {
-
-
- }
- }