jsp文件
var $str=encodeURI($('#name1').val());
$.ajax({
url : '/springmvcHome/incom/saveHomeincom.do',
data : {
name : $str,
后台
/*
* 新增收入
*/
@RequestMapping("/saveHomeincom")
public String saveHomeIncom(HomeIncom homeIncom,HttpServletRequest request,HttpServletResponse response){
String username ;
String remarks;
try {
response.setContentType("text/html;charset=utf-8");
username = java.net.URLDecoder.decode(homeIncom.getName(), "utf-8");
System.out.println(username);