When did the 404 error occur? When we request a resource on the server through a browser, it may be a JSP or servlet. If the resource to be accessed does not exist, a 404 error will be generated, 404 error may be caused by application problems, such as the absence of normal deployment, name writing error, or file problems. The JSP file does not exist, the name is incorrect, or the servle is not configured.
According to these situations, the solution to the 404 error is as follows:
1. The web application is not deployed successfully: Check the status under deployments in the console (http: // 127.0.0.1: 7001/console. If the deployment is not successful, you can go to the console (the command line window for starting the server) to view the error. If Tomcat is used, Use http: // 127.0.0.1: 8080, and then select the management interface.
2. Web Application name (actually access method, usually context-root). View method: Right-click the project, select "properties", and select myeclipse à web, web context-root.
3. Resource Name (JSP and Servlet)
For JSP files, check whether the file name is incorrect. (When developing in myeclipse, the JSP file is placed in Web-root and cannot be put incorrectly. If there are other folders, write the folder in the access method.) If there is no error, check whether other files are accessed through access methods such as JSP: forward or JSP: Include to check whether other files exist.
For servlet, view the Web. xml file:
<Servlet-mapping>
<Servlet-Name> loginservlet </servlet-Name>
<URL-pattern>/login </url-pattern>
</Servlet-mapping>
The URL-pattern Content determines the access method.
If the servlet configuration is correct, check whether other files are accessed in the Servlet File and whether the accessed files exist.
4. If none of the above errors occur, it may be a system cache problem, including temporary files in the client browser and server. Solution: restart the browser, re-compile the project (project à clean), redeploy, close the application server, restart the application server, and re-access the application server.
Li xucheng csdn blog:Http://blog.csdn.net/javaeeteacher