Eclipse uses built-in Tomcat and settings that use external tomcat

Source: Internet
Author: User

Recently because the JSP in the project requests to access files other than the project, direct access written as "C:\xxx\xxx.mp4" to access is not authorized and cannot complete existing requirements. After the query found that you can configure the virtual directory in Tomcat to set the local file to "Http://localhost:8080/xxx.mp4", the local file after such a virtual mapping can be accessed in the project.

The idea above is very correct, but the implementation of the problem, and eventually after the project and the local tomcat found that the Eclipse project started, just use a part of the native Tomcat components, and did not fully load all the configuration in Tomcat. The simplest way to verify this is that after the Eclipse project is started, entering Http://localhost:8080/prjName on the browser address can run the project correctly, but enter http://localhost:8080/directly in the browser But you can't see the Tomcat admin page, which is very weird. To solve the problem of using address mapping correctly in your project, you must understand why the http://localhost:8080/address cannot be accessed after the Eclipse project is started . After searching I got the following solution:

The server option is available after you load the project with eclipse normally

The left mouse button double-click the Red box, a configuration screen will appear,


Eclipse defaults to the choice of the first red box option, which is "Use workspace metadata (...)", which means that when the project is launched, Eclipse calls the core components of Tomcat, built into Eclipse, Startup and deployment are not related to real Tomcat, so when you use the Eclipse defaults, Access http://localhost:8080/is inaccessible and access to http://localhost:8080/xxx Your project will be able to access it normally.

If you want to achieve the same effect as Tomcat used when starting the Eclipse project and manually booting the machine, you need to select the option in the second red box above, which is "use Tomcat installation (...)", which After you start eclipse, you can access http://localhost:8080/, and the Tomcat configuration page appears, and the virtual address configuration that is added to Tomcat will work in the project.

Eclipse uses built-in Tomcat and settings that use external tomcat

Related Article

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.