(四)Struts2传参的中文问题
来源:互联网 发布:部落冲突10本升级数据 编辑:程序博客网 时间:2024/06/05 02:52
1.首先提到的就是如果参数是中文,就不要用get,用post.
2.在struts.xml中:
<!-- 让参数可以传中文 --><constant name="struts.i18n.encoding" value="GBK" />
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"><struts><!-- <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts.devMode" value="false" /> <package name="default" namespace="/" extends="struts-default"> <default-action-ref name="index" /> <global-results> <result name="error">/error.jsp</result> </global-results> <global-exception-mappings> <exception-mapping exception="java.lang.Exception" result="error"/> </global-exception-mappings> <action name="index"> <result type="redirectAction"> <param name="actionName">HelloWorld</param> <param name="namespace">/example</param> </result> </action> </package> <include file="example.xml"/>--><!-- 下面是设定开发模式,设定为true,方便修改action name后的热部署 --><constant name="struts.devMode" value="true" /><!-- 让参数可以传中文 --><constant name="struts.i18n.encoding" value="GBK" /><!-- package区分包,name space是访问路径,如 name是user,namespace就是/user,按模块划分 --><!-- namespace不写,就等于namespace="",URL为任意项目名/xxx下的index --><package name="default" namespace="/" extends="struts-default">
不过好像貌似没用.
- (四)Struts2传参的中文问题
- Struts2中action之间传参中文乱码的问题
- struts2中文问题的处理
- Struts2的中文乱码问题
- jsp 传参乱码 Struts2中action之间传参中文乱码的问题
- Struts2(四)请求的扩展名问题
- 关于struts2支持中文的问题
- struts2中解决中文乱码的问题
- struts2中文乱码的问题之三
- 解决struts2的中文乱码问题
- struts2中文乱码问题的解决方法
- Struts2 Action中文乱码问题的解决办法
- Struts2 Action中文乱码问题的解决办法
- Struts2 Action中文乱码问题的解决办法
- struts2 解决中文乱码的问题
- struts2中文乱码问题的解决方法
- Struts2 Action中文乱码问题的解决办法
- Struts2 Action中文乱码问题的解决办法
- Qt网络编程之实例一GET方式
- CToolBar与CImageList合用,达到360的标题栏的效果
- HTML/XHTML/HTML5/CSS学习链接
- meta-data使用
- Android 用户界面---状态栏通知(一)
- (四)Struts2传参的中文问题
- 简单的Oracle的树分级查询
- 自制一小型的linux系统mylinux
- 2012-03-25
- jquery给动态增加元素绑定事件
- 关于Visual studio 2010 代码提示
- Vim+Cscope
- C++-----------------多态
- jquery实现点击按钮左右移动的菜单