HTTP Status 404 Spring rest The requested resource is not available
-
21-12-2019 - |
Question
I am using spring 3.2.2.RELEASE and have a problem on sending request to server :
http://asdsda:8080/spr-mvc-hib/user/userHizmet.html?userId=19
HTTP Status 404 The requested resource is not available.
@RequestMapping(value = "/userHizmet/{userId}", method = RequestMethod.GET)
public ModelAndView userHizmet(@PathVariable String userId)
{
ModelAndView mav = new ModelAndView("userte");
where i called :
success: function (data) {
alert(data);
window.location.href="${pageContext. request. contextPath}/user/userHizmet.html?userId="+data;
},
dispatcher :
Dynamic servlet = servletContext.addServlet("dispatcher", new DispatcherServlet(ctx));
servlet.addMapping("/");
Solution
localhost:8080/spr-mvc-hib/user/userHizmet.html?userId=19
removing .html
and using requestparam
solved my problem
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow