Problems with using Tomcat 5x/6X in eclipse Java ee ide (related to configuration and release)

Source: Internet
Author: User

Myeclipse has been used for previous studies and projects, because it involves copyrights. myeclipse is used in the name of "learning and communication. However, in actual commercial development, the team should consider the project cost and project needs (efficiency or functional needs), so eclipse should be sufficient for some small and medium projects, compared with the integrated ide of myeclipse, it is easier to say nothing, but performance may be a factor worth consideration. Therefore, eclipse can be used for development as a good choice.

I used to use myeclipse developers to develop web projects with eclipse. Suddenly I was not used to it. The javaweb project became a dynamic/static Web project, and tomcat project was installed after sysdeo's tomcatplugin. It makes people feel unaccustomed at once. In fact, I can understand the reason why myeclipse charges fees: For convenience, please spend money.

I will not discuss it here.

I recently used eclipse J2EE ide + Tomcat 5.5 to develop and deploy several small projects. I have some experiences to share with you. Many of them are found on the internet and solve many problems, thank you for your help!

1. Web project deployment

Prerequisites: (1) install and configure tomcat, environment variables, and tomcat_home.

(2) Configure installed jres of Eclipse IDE

(3) make sure Tomcat runs properly (% tomcat_home %/bin/startup. BAT)

Create a simple web project (such as a dynamic web project), write a simple project, add a JSP, and so on. After compilation, how can we publish it? Habitually open the sever view of Eclipse, but there is nothing in it. Right-click New --> server and follow the normal steps to create it. After the project is created, the project of the server is displayed in the project view and has its own configuration file. (There is a problem here, which will be discussed later)


In this case, run the project in Tomcat. After the console is properly started, open the browser and enter the Tomcat Homepage Address to test whether Tomcat runs normally. For example
Http: // localhost: 8080/, but the result is 404, which is surprising. Check the Tomcat console again. No problem! Check the webapp directory of % atat_home %. The root directory of the webapp has resources. However, no projects have just been released and no work directory has been found !! What's going on? Try to access resources of the test project, such
Http: // localhost: 8080/test/index. jsp, but it can be accessed normally !! Why!

If you used the server and tomcat created by eclipse to release the WEB Project, the default release path is not the original tomcat installation path, but the path strength set by eclipse, in addition, the configuration file of the server is used, that is, the configuration file of the legend on the right of the server. Therefore, the related configuration is set here and the configuration on Tomcat will not take effect.

Server publishing path: Workplace \. Metadata \. plugins \ org. Eclipse. WST. server. Core \ tmpx

Here, workplace is the workplace of eclipse. The name of X in tmpx starts from 0, that is, the name when multiple services are configured.

PS. For more information, see http: // localhost: 8080/. When you access the project resources, you can: http: // localhost: 8080/The "/" at the end of this address represents the root resource in Tomcat's webapp, and the related management interface is in the Manager, which is the default of Tomcat. However, when the eclipse server releases a Tomcat web project, it is equivalent to using a copy of Tomcat, which is processed according to its own configuration during use, all the information is copied to the workplace,
However, we found that the configuration file web in this copy of Tomcat (that is, the relevant configuration file behind. XML and root directory (workplace \. metadata \. plugins \ Org. eclipse. WST. server. core \ tmp0 \ wtpwebapps \ Root), Web. <welcome-file-List> is configured in XML, but there is no resource in the root directory, so package 404 is normal. If you need it to display the Tomcat home page, copy the docs, manager, and root directories to the webapp of % tomcat_home %.

Of course, you can modify the release directory. In the Server View, double-click the configured tomcat or right-click --> open. On the overview tab, you can see the configuration of the project, such as port, path, and name ,, in server location, the Tomcat container release path is changed as needed. The default address is the workplace address just mentioned. There is a problem here. When tomcat has loaded the project, it cannot be modified. You must clean Tomcat for modification.

This article is original and has your own experiences. Welcome to discuss and learn!

If you need to reprint it, please indicate the source address. Thank you! Cnblogs.com/lzsu1989

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.