springmvc前台ajax中url怎么写0
var json = {"username":username,"password":password};
alert("/userLoginController/userLoginCheck");
$.ajax({
url:'userLoginController/userLoginCheck',
data:json,
type:'post',
cache : false,
dataType : 'json',
success:function(result){
if(result=="false"){
alert("用户名或密码输入有误");
return false;
}
if(result=="true"){
alert("通过验证");
return true;
}
},
error : function() {
alert("系统错误,请联系管理员!");
}
});
其中 url:'userLoginController/userLoginCheck', 里面写的是后台controller里面的方法名 但是死活进不去方法 还一直报错 "系统错误,请联系管理员!") 求解!!! 没有财富值了。。。@Controller
@RequestMapping("/userLoginController")
public class UserLoginController {
@Autowired
private UserLoginService userLoginService;
private static final String VIEW = "menu/mainMenu";
@RequestMapping(value="/userLoginCheck", method={RequestMethod.GET, RequestMethod.POST})
public String userCheck(HttpServletRequest request, HttpServletResponse response){
String username = request.getParameter("username");
String password = request.getParameter("password");
}