Solution to JSP 404 errors

Source: Internet
Author: User

JSP program 404 error is a common problem, so how to deal with such a problem? Let's take a look

When did JSP program 404 errors 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, the 404 error of JSP program may be caused by the application itself. For example, it is not properly deployed, the name is wrong, or the file is faulty. the JSP file does not exist, the name is incorrect, or the Servle is not configured.

According to these situations, the solution to JSP program 404 error is as follows:

1. The web application is not successfully deployed.: Check the status of deployments in the console (http: // 127.0.0.1: 7001/console. If the deployment is not successful, you can go to the console to start the server's command line window) to view the error. If Tomcat is used, Use http: // 127.0.0.1: 8080, and then select the management interface.

2. The Web application name is actually the access method, usually context-root ),View method: Right-click the project, select "Properties", and select MyEclipse à Web. The Web Context-root Interface is displayed.

3. Resource Name JSP and servlet)

For JSP files, check whether the file name is incorrect. During MyEclipse development, 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:

 
 
  1. ﹤servlet-mapping﹥  
  2.  
  3.   ﹤servlet-name﹥LoginServlet﹤/servlet-name﹥  
  4.  
  5.   ﹤url-pattern﹥/login﹤/url-pattern﹥  
  6.  
  7. ﹤/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 existIt may be a system cache problem, including temporary files in the client browser and server. Solution: restart the browser, re-compile Project à Clean), redeploy, close the application server, restart the application server, and re-access the application server.

We will introduce the issue of JSP program 404 errors here, hoping to help you in the actual operation process.

  1. What are servlets and common Servlet APIs?
  2. Automatic jump to error page for JSP Servlet instance
  3. 8-point discussion on optimizing JSP Servlet applications
  4. Servlet import event-driven technology in JSP development
  5. What is JSP and comparison with Servlet?

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.