im getting 404 error when i try to visit an url like:
GET: /test/{id}
PS.: id is a string that changes according users filter
I have "/test" already mapped in web.xml, but i dont know how to declare some value that "i dont know", in this case, "id".
Let me show an example:
@RequestMapping(value="/test/{id}", method = RequestMethod.GET)
public ModelAndView testingId(@PathVariable String id ){
System.out.println("id");
return new ModelAndView("returns", "returns", id);
}
Any Help?
What method are you using to configure your web application DispatcherServlet (web.xml or WebApplicationInitializer)
Your request needs to include the servlet context , servlet mapping and resource mapping. Assuming that your application is called sample.war and your DispatcherServlet is mapped to /app/* then your request should be
GET : /sample/app/test/4
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.