?? encodingfilter.java
字號(hào):
package liuxiaobo.filter;import javax.servlet.*;import javax.servlet.http.*;import java.io.*;public class EncodingFilter implements Filter { protected FilterConfig filterConfig; public void init(FilterConfig config) { this.filterConfig = config; } public void destroy() { this.filterConfig = null; } public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException{ String targetEncoding ="ISO8859-1"; targetEncoding = this.filterConfig.getInitParameter("encoding"); HttpServletRequest hrequest = (HttpServletRequest)request; hrequest.setCharacterEncoding(targetEncoding); filterChain.doFilter(request, response); }}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -