"Turn" the requested resource (/) is not available

Source: Internet
Author: User

The HTTP Status 404 (The requested resource is not available) exception is mainly caused by path errors or misspellings, follow these steps to troubleshoot each:

1. Web Apps not deployed

2. URL input Error

A. Check that the IP address and port number of the URL are written correctly.

B. See if the context path is correct Project--------Properties------myelipse-----Web-----Web context-root Check that the path name is written correctly.

C. Check that the file name is written correctly.

3. Directory cannot be referenced

In Eclipse's Package explorer, check where the files are stored. Because the contents of the Meta-inf Web-inf folder cannot be published externally, it is certainly not allowed if you refer to files with these two directories.

Example: http://localhost:8080/guestbook/WEB-INF/index.html is wrong, file location is wrong


4. Problems with Web. XML in the Tomcat server
If you have multiple JSP pages for your Web application, you may get a 404 error when you click on the virtual root of your Web application, except that you only need to modify the. XML in the Tomcat server

<init-param>
<param-name>listings</param-name>
<param-value>false (This is true) </param-value>
</init-param>


5. Web-inf there must be a few fixed folders and files below
Web. XML configuration file for this app

Lib the library file used by the Web App

Classes to store compiled Servlets


Please pay attention to their names, I have been because of the classes written class, check the wrong half of the house has not been resolved, so write these when you must carefully, otherwise wasted more energy to check the wrong.


6. If you want to run a servlet (. Class) file instead of a. jsp file, configure Web. XML (which is, of course, web-inf below), plus the following fields:

<servlet>
<servlet-name>HelloWorldServlet</servlet-name>
<servlet-class>HelloWorldServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/HelloWorldServlet</url-pattern>
</servlet-mapping>


Where the "Helloworldservlet" changes to the file name you want to run

7. Other Solution Ideas

The above method has no effect, between the "HTTP Status 404 (The requested resource is not available" abnormal occurrence of the diversity, the use of replacement Dafa:

Steps:

A. Find a normal same environment (find classmates and colleagues the same development environment or download the normal demo)

B. Replace the problem project file in turn, and then exclude and locate it. Until resolved.

"Turn" the requested resource (/) is not available

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.