/** * */ package com.yihu.base.filters; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Timer; 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 com.coreframework.db.DB; import com.coreframework.db.Sql; import com.coreframework.util.AppConfig; import com.yihu.base.ConfigUtil; import com.yihu.jkedu.enums.MyDatabaseEnum; import com.yihu.main.ServerConsole; import com.yihu.utils.SecretUtil; /** * @author zhangzz * @company yihu.com 2014-12-25上午9:40:29 */ public class SysBaseFilter implements Filter { protected FilterConfig filterConfig; protected String encoding; public void destroy() { } public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; request.setCharacterEncoding(encoding); chain.doFilter(request, response); } public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; encoding = filterConfig.getInitParameter("encoding"); ServerConsole.init(); } }