jquery高手来帮下忙,在线等
我用jquery提交表单到struts2的action
因为出现过乱码问题,所以在serialize()表单时,加了个decodeURIComponent方法
$('#medForm').submit(function(){
jQuery.ajax({
url: path+"/insertMzMed.action",
data:
decodeURIComponent($('#medForm').serialize(),true),
type: "POST",
beforeSend: function()
{
},
error: function(request) {
alert("表单提交出错,请稍候再试");
},
success: function(data) {
}
});
return false;
});
现在出现的情况是,在jboss上的时候,如果表单中出现'%('这个符号时(如:姓名文本框中输入'张三%('),就会报错,而我试过了,如果去掉decodeURIComponent方法,就不会出问题,有没有两全其美的方法,即不出乱码,在提交时也不会出问题
java.lang.IllegalStateException: Parameters processing failed.
org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:407)
org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:229)
org.apache.catalina.connector.Request.parseParameters(Request.java:2874)
org.apache.catalina.connector.Request.getParameter(Request.java:1291)
org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:363)
javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:180)
org.jasig.cas.client.util.CommonUtils.safeGetParameter(CommonUtils.java:279)
org.jasig.cas.client.session.SingleSignOutHandler.isLogoutRequest(SingleSignOutHandler.java:101)
org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:57)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
org.springframework.security.web.Fi