springMVC怎么获取前台post过来的对象

2024-12-01 07:23:30
推荐回答(1个)
回答1:

function post3(){
var para={'name':"name",'password'唯世:"password"指敬肢};
$.ajax({
url: 'vote/post3.html',
data:para,
success: function(data){
alert(data);
}});
}
后台稿差:

@RequestMapping(value="/post3")
public void post3(User user,PrintWriter out){
System.out.println(user.getPassword());
out.write(user.getName());
out.flush();
out.close();
}