使用Struts-config.xml来实现全局request编码转换
来源:互联网 发布:小众香水 知乎 编辑:程序博客网 时间:2024/06/13 04:01
Struts-config.xml:
<controller contentType="text/html;charset=GB2312"
processorClass="com.bjjdsy.xb.XBDefaultProcessor" />
XBDefaultProcessor.java
public class XBDefaultProcessor extends RequestProcessor ...{
private static Logger logger = Logger.getLogger(XBDefaultProcessor.class);
protected boolean processRoles(HttpServletRequest request,
HttpServletResponse response, ActionMapping mapping)
throws IOException, ServletException ...{
return super.processRoles(request, response, mapping);
}
protected void processContent(HttpServletRequest request,
HttpServletResponse response) ...{
try ...{
request.setCharacterEncoding("GB2312");
} catch (UnsupportedEncodingException e) ...{
log.warn("unable to set request charsetEncoding");
}
super.processContent(request, response);
}
}
private static Logger logger = Logger.getLogger(XBDefaultProcessor.class);
protected boolean processRoles(HttpServletRequest request,
HttpServletResponse response, ActionMapping mapping)
throws IOException, ServletException ...{
return super.processRoles(request, response, mapping);
}
protected void processContent(HttpServletRequest request,
HttpServletResponse response) ...{
try ...{
request.setCharacterEncoding("GB2312");
} catch (UnsupportedEncodingException e) ...{
log.warn("unable to set request charsetEncoding");
}
super.processContent(request, response);
}
}
- 使用Struts-config.xml来实现全局request编码转换
- 配置Struts应用使用多个struts-config.xml文件
- struts 使用多个配置文件 struts-config.xml
- Struts中使用多个配置文件 struts-config.xml
- 利用过滤器实现request的编码转换
- 继承ActionServlet实现request的编码转换
- struts-config.xml整理
- struts-config.xml文件
- struts-config.xml 配置
- struts-config.xml配置
- struts-config.xml
- struts-config.xml详解
- struts-config-yhgl.xml
- struts-config.xml
- struts-config.xml配置
- struts-config.xml详解
- struts-config.xml配置
- struts-config.xml模板
- 兄弟的一些照片
- Linux 用户(User)查询篇
- struts-config.xml文件详解
- 对日合作WINCE C 开发工程师
- 如何访问其他进程的 socket 句柄?
- 使用Struts-config.xml来实现全局request编码转换
- Visual C#常用函数和方法集汇总
- ASP.NET - Code Samples - Disable CheckboxList Items
- Select()系统调用及文件描述符集fd_set的应用
- 对日合作C++/MFC开发工程师
- Select()函数
- Ip-adress.com:国际IP地址查询工具
- firebird
- 便利的开发编辑工具-vim