Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The requested URL /save was not found on this server in spring MVC

Tags:

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

like image 202
Rick Avatar asked Mar 27 '17 13:03

Rick


People also ask

How do you the requested URL was not found on this server?

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.

Why 404 error occurs in Spring boot?

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.


2 Answers

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

like image 116
Gary Avatar answered Sep 25 '22 13:09

Gary


may be your Spring web application doesn't deploy correctly. please follow this link.

like image 21
Tharaka Avatar answered Sep 24 '22 13:09

Tharaka