HTTP状态404 Spring rest请求的资源不可用

时间:2014-04-11 12:17:43

标签: spring rest http-status-code-404 path-variables

我正在使用spring 3.2.2.RELEASE并且在向服务器发送请求时遇到问题:

http://asdsda:8080/spr-mvc-hib/user/userHizmet.html?userId=19 

HTTP状态404请求的资源不可用。

@RequestMapping(value = "/userHizmet/{userId}", method = RequestMethod.GET)
public ModelAndView userHizmet(@PathVariable String userId)
{
    ModelAndView mav = new ModelAndView("userte");

我打电话的地方:

success: function (data) {
                        alert(data);
                        window.location.href="${pageContext. request. contextPath}/user/userHizmet.html?userId="+data;
                    },

调度员:

Dynamic servlet = servletContext.addServlet("dispatcher", new DispatcherServlet(ctx));
    servlet.addMapping("/");

1 个答案:

答案 0 :(得分:1)

localhost:8080/spr-mvc-hib/user/userHizmet.html?userId=19

删除.html并使用requestparam解决了我的问题