我使用spring 3.2.2.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("/");
.

有帮助吗?

解决方案

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

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top