struts终极解决方案
来源:互联网 发布:网络推广专员的职责 编辑:程序博客网 时间:2024/05/22 05:23
1.在struts2-core-2.3.14.jar包中路径为struts2-core-2.3.16\org\apache \struts2
有一个default.properties 文件,把struts.i18n.encoding=UTF-8改为
2.或者在struts.xml文件内添加常量:
我当然是用的第二种方法,简单方便.
有一个default.properties 文件,把struts.i18n.encoding=UTF-8改为
struts.i18n.encoding=GBK
2.或者在struts.xml文件内添加常量:
<constantname="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.i18n.encoding" value="GBK"/>
<package name="com" extends="struts-default">
<action name="test" class="com.TestAction" method="test">
<result>/ok.jsp</result>
</action>
</package>
</struts>
<!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.i18n.encoding" value="GBK"/>
<package name="com" extends="struts-default">
<action name="test" class="com.TestAction" method="test">
<result>/ok.jsp</result>
</action>
</package>
</struts>
3.以上方法不行可以选择spring过滤器 jar 包 spring-core-3.0.5.RELEASE ,spring-web-3.0.5.RELEASE,spring-beans-3.0.5.RELEASE
web.xml配置如下
<filter>
<filter-name>encodingFilter </filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding </param-name>
<param-value>UTF-8 </param-value>
</init-param>
<init-param>
<param-name>forceEncoding </param-name>
<param-value>true </param-value>
</init-param>
</filter>
并将对应的后缀加入filter-mapping,例如
<filter-mapping>
<filter-name>encodingFilter </filter-name>
<url-pattern>*.do </url-pattern>
</filter-mapping>
千万要注意他们了的先后顺序,顺序颠倒了就不管用了哦
- struts终极解决方案
- struts国际化问题"——终极解决方案
- struts中文问题国际化问题终极解决方案
- "struts中文问题","struts国际化问题"的终极解决方案(转)
- "struts中文问题","struts国际化问题"的终极解决方案
- "struts中文问题","struts国际化问题"——终极解决方案
- struts中文问题","struts国际化问题"的终极解决方案
- "struts中文问题","struts国际化问题"的终极解决方案[转载]
- "struts中文问题","struts国际化问题"的终极解决方案 (转)
- "struts中文问题","struts国际化问题"——终极解决方案
- struts中文问题","struts国际化问题"——终极解决方案
- "struts中文问题","struts国际化问题"——终极解决方案
- struts中文问题","struts国际化问题"——终极解决方案
- "struts中文问题","struts国际化问题"的终极解决方案
- "struts中文问题","struts国际化问题"的终极解决方案
- "struts中文问题","struts国际化问题"??终极解决方案
- "struts中文问题","struts国际化问题"的终极解决方案 (转)
- struts中文问题和国际化问题的终极解决方案
- POJ围棋盘
- Boyer-Moore算法
- 每日学习总结:CSS:Clear属性的用法、重复交易提示框、弹出提示框后页面变形、asp.net调用smtp服务发送邮件问题
- linux页面回收浅析
- 也曾遇到 设备号冲突的问题
- struts终极解决方案
- hdu 1067 广搜+map
- Squid反向代理加速WEB
- linux 锁机制 pthread_mutex_t
- ARM汇编指令集
- [gdc13]《刺客信条3》渲染技术
- 怎么让erlang在服务器运行时隐藏shell
- sdut.acm 1188C语言实验——各位数字之和排序
- FreeMarker四种变量的用法