springmvc 怎么把jsonobject类型数据返回 页面
1个回答
展开全部
@RequestMapping(value = "/signin", method = RequestMethod.POST)
@ResponseBody
public String signin(String code, String password, ModelMap model){
String message = "";
User user = new User();
if(!code.equalsIgnoreCase("000001"))
message = "code:帐号不存在";
else if(!password.equalsIgnoreCase("123"))
message = "password:密码错误";
else{
model.addAttribute(Constants.SESSION_USER, user);
message = "redirect:index.html";
}
return message;
}
@ResponseBody
public String signin(String code, String password, ModelMap model){
String message = "";
User user = new User();
if(!code.equalsIgnoreCase("000001"))
message = "code:帐号不存在";
else if(!password.equalsIgnoreCase("123"))
message = "password:密码错误";
else{
model.addAttribute(Constants.SESSION_USER, user);
message = "redirect:index.html";
}
return message;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询