如何用在controller里返回jsonp
1个回答
2017-05-04
展开全部
Java代码 收藏代码
@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;
}
@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;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询