Generally, this problem does not occur on the web. the servlet URL ing part of the XML configuration file, because this URL ing is often configured by Java Web users, and this ing degree of freedom is large here, you can have a directory string, or not, only the final file name matching method. Therefore, the problem generally lies in the definition of controller ing configuration, because if the dispatchservlet distributor cannot find the Controller controller corresponding to the request URL in its configuration file, the 404 Not Found error will also be returned. The URL definition in the controller, whether it is the name attribute in the beannameurlhandlermapping configuration or the key attribute in the simpleurlhandlermapping configuration, must show the absolute path of the server project of the URL when defining the URL location, that is to say, it is not necessary to omit imaging as long as the last part of the URL appears as described in some books or documents that are not rigorous or outdated. In fact, this is not the case, the definition here must be written to the absolute path of the server project, that is, the part following the project deployment name in the URL. Some web projects are directly deployed under the domain name root directory, it is the part after the domain name. To put it simply, it is in the web. the pattern in the URL in which the servlet ing is defined in XML
References: http://blog.csdn.net/wangyaoheng/article/details/2465834