字符过滤器工具类
来源:互联网 发布:淘宝降价提醒助手 编辑:程序博客网 时间:2024/06/15 01:57
package com.util;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import javax.servlet.*;import java.io.IOException;public class EncodingFilter implements Filter {private Log log = LogFactory.getLog(getClass());private String encoding = "UTF-8";public void destroy() {log.info("EncodingFilter destroyed.");}public void doFilter(ServletRequest request, ServletResponse response,FilterChain chain) throws IOException, ServletException {request.setCharacterEncoding(encoding);chain.doFilter(request, response); }public void init(FilterConfig filterConfig) throws ServletException {String encoding = filterConfig.getInitParameter("encoding");if (encoding != null && !"".equals(encoding.trim()))this.encoding = encoding.trim();log.info("Request character encoding is set to " + encoding);}}
阅读全文
0 0
- 字符过滤器工具类
- 字符集过滤器工具类
- 字符过滤器
- 字符过滤器
- 用过滤器类进行字符编码过虑
- 字符转换工具类
- 字符转换工具类
- 字符工具类
- 字符编码工具类
- 字符编码工具类
- JAVA工具类集锦3--编码过滤器
- JAVA工具类集锦4--登录过滤器
- 字符的处理----过滤器
- 特殊字符替换过滤器
- SetCharacterEncodingFilter jsp字符过滤器
- Filter 字符过滤器
- CharacterEncodingFilter 字符编码过滤器
- Servlet字符编码过滤器
- 小程序解析html富文本插件wxParse配制全面指南
- Mybatis模糊查询的写法
- Spring Cloud Eureka 入门 (二)服务提供者详解
- 卷积神经网络算法
- Python日期的加减等操作
- 字符过滤器工具类
- 解决Failed to ... maven-compiler-plugin:3.1:compile (default-compile) on project ...
- GoLang初探
- Mardown使用方法
- SVM学习资料链接
- c++模板特化
- 武大杨必胜老师论文-移动测量
- 癌症基因组遗传和表观遗传数据整合分析
- Java工程师的一些面试总结(7)