struts2中jsp页面表单提交到action中文乱码问题
?? ? ?struts2中默认提交的格式是UTF-8格式的,故需要把中文字符转码后才能正常显示,解决方法:
直接在struts.xml文件中<struts> 标签内部添加一句如下代码:??
? ? ? ? ? ? ? ? ? ? ? ? ???<constant name="struts.i18n.encoding" value="gbk" />
?
注意:如果你jsp页面中使用的是utf-8格式,那么此处也写成utf-8格式。