请求SpringMVC的Controller,出现404的错误

u013904882 u013904882 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区


Controller文件代码:
@Controller
@RequestMapping("/login")
public class LoginController {
@Resource
private UserServiceDaoImplement userServiceDaoImpl;
@RequestMapping(value="/userLogin", method = RequestMethod.POST)
@ResponseBody
public Map userLogin(HttpServletRequest request,
@RequestParam(value="username") String username,
@RequestParam(value = "password") String password,Map maps) throws Exception{

前端login.HTML的js代码:
$.ajax({
type: "POST",
dataType: "json",
url: "login/userLogin",
data: {"password":password,"username":username},
success: function (data, textStatus) {
alert(data+"==="+textStatus);
window.location.href = 'index.html';
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("登录失败:用户名或密码错误");
}
});


请问大神,可能那里出问题了?
...全文
评论 6
收藏 已收藏
分享
返回顶部
u013904882
Web 开发 81,108 成员 341,721 内容