表单提交后action获取到的中文为乱码排查步骤(提交的是action的属性): 1、需要在struts.xml中做i18n配置 <constant name="struts.i18n.encoding" value="utf-8" /> 2、配置后action中打印是否能够获取到中文,如果获取不到中文,在action中进行转码,如下:
1.、jsp页面提交表单后action获取到的中文为乱码,已经在struts中添加了i18n还是不行 解决方法: String name = new String(project.getName().getBytes("ISO-8859-1"),"UTF-8"); 为了方便管理也可以写一个final类
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号