I am trying to save a data in DB through spring MVC. when I hit save button it redirects me to a page where the error is as follows:
The requested URL /save was not found on this server.
Same code is working on DEV on localhost, I think there is some problem with standalone
In Controller.java
:
@RequestMapping(value="/save", params="save")
public ModelAndView save(@RequestParam("save") String save) {.....}
The save pages updates/delete the data from data base
The HTTP error 404, more commonly called “404 error”, means that the page you are trying to open could not be found on the server. This is a client-side incident which means either the page has been deleted or moved, and the URL has not been modified accordingly, or that you have misspelled the URL.
We went through the two most common reasons for receiving a 404 response from our Spring application. The first was using an incorrect URI while making the request. The second was mapping the DispatcherServlet to the wrong url-pattern in web. xml.
I wonder if your application is actually deployed, but just at a URL you don't expect. It is quite common for app servers to add a context url with the name of the war file. For example, if you war file is named myapp.war
, your /save
url might be visible like
http://www.example.com/myapp/save
may be your Spring web application doesn't deploy correctly. please follow this link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With