前台jsp向后台Action传递String类型中文出现乱码,求解决
在同一项目里其他可以String传递中文到后台,页面也没问题<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
我的传递过程是:
页面写入数据: 名称: <input name="a1" id="a1" type="text" class="input150" value="" />
身份证号: <input name="a2" id="a2" type="text" class="input150" value="" />
状态: <select name="a3" id="a3" class="input100"> (注意除了中文,数字英文传递没问题,中文传到前台是乱码????之类的)
点击事件:<a href="#" onclick="searchUser()">查询</a>
function searchUser(){
var a1 = document.getElementById("a1").value;
var a2 = document.getElementById("a2").value;
var a3 = document.getElementById("a3").value;
if(a1==""&&a2==""&&a3==0){
return false;
}else{
window.location.href="<%=request.getContextPath() %>/inspection/Cgywjb_jbSsList.action?a1="+a1+"&a2="+a2+"&a3="+a3;
return true;
} }
Action:getset接收 System.out.println(a1);显示乱码,换成其他没问题
我的传递过程是:
页面写入数据: 名称: <input name="a1" id="a1" type="text" class="input150" value="" />
身份证号: <input name="a2" id="a2" type="text" class="input150" value="" />
状态: <select name="a3" id="a3" class="input100"> (注意除了中文,数字英文传递没问题,中文传到前台是乱码????之类的)
点击事件:<a href="#" onclick="searchUser()">查询</a>
function searchUser(){
var a1 = document.getElementById("a1").value;
var a2 = document.getElementById("a2").value;
var a3 = document.getElementById("a3").value;
if(a1==""&&a2==""&&a3==0){
return false;
}else{
window.location.href="<%=request.getContextPath() %>/inspection/Cgywjb_jbSsList.action?a1="+a1+"&a2="+a2+"&a3="+a3;
return true;
} }
Action:getset接收 System.out.println(a1);显示乱码,换成其他没问题
...全文
相关推荐
JSP中解决中文乱码的万能方法
jsp中出现的所有中文乱码都可以解决,没有做不得,只有想不到。
JSP中文乱码问题最优解决方法
JSP中文乱码问题的最优解决方法
jsp传值中文乱码问题解决方法示例介绍
在jsp中,我们经常从数据库读取数据返回客户端,但我们常常在制作时出现乱码现象,下面与大家分享下jsp传值乱码解决办法,有类似情况的朋友可以参考下哈,希望对大家有所帮助
分享JSP中文乱码解决方法
本文给大家分享的是4种jsp中出现中文乱码的解决方法,非常的细致全面,并附上具体的示例,推荐给大家,有需要的小伙伴可以参考下。
url传值到Action乱码解决方案
解决:delete.action?title=<%=ne.getTitle()%>传到action类出现乱码的问题


Web 开发
