HTTP status code Error 404

Source: Internet
Author: User

 

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.