Eclipse Publishing Path changes

Source: Internet
Author: User
Tags tomcat server apache tomcat

But its default access to the directory is the Eclipse temp directory, not the Tomcat directory,

It is recommended to double-click Tomcat to enter the configuration Interface service Locations

The modification options are:
Use Tomcat installation (takes control of Tomcat installation) (It is recommended to change the configuration and press Ctrl+s to save)

It's better to deploy the path below.

Background: When a beginner learns JSP, Tomcat is always paired with the best companion. Most people will choose myeclipse for development and testing because she automatically integrates the publishing features and can be automatically posted to tomcat. MyEclipse as a paid-for software, humanized design is convenient for our JSP development testing, but the existence of crack version of the presence of a certain degree of damage to the interests of software developers. I myself as the advocate of genuine software, but also support the application of open source software. In fact, Eclipse also has the automatic release feature, where we talk about the configuration of the JSP release test in Eclipse.

Test environment:

Operating system: Windows 7 Ultimate Edition

JDK:JDK1.8.0_92 (64-bit)

Eclipse:mars.2 Release (4.5.2)

tomcat:apache-tomcat-8.0.35

Our setup steps are as follows:

1. Configure the Tomcat environment variable.

2. Test whether Tomcat is configured correctly and starts normally. (Recommended steps)

3. Start Eclipse and configure Tomcat.

4. Create a new dynamic Web Project and set the Tomcat publishing parameters.

5. New JSP file (MyEclipse can be checked to create index.jsp).

6, display servers components, and improve the project configuration parameters (release parameters).

7, release the test.

1, other development software environment variable configuration is not in one by one details, specific can search online.

The following two should be configured in the APACHE-TOMCAT-8.0.35 environment variable:

Configure the 1:path entry with the value of add Tomcat to the bin directory in the installation directory, ending with punctuation semicolon (;).

Configure 2:catalina_home, whose value is the Tomcat installation root directory.

2. The following steps are recommended options, only do the test tomcat configuration is correct and functioning properly. First enter startup in the DOS interface to see if Tomcat can start normally.

After the boot is complete, you can turn tomcat off at the Tomcat boot interface Ctrl + C shortcut.

During the above test, there may be a flash of the boot interface. Personal advice in the Tomcat installation directory bin directory, locate Startup.bat right-click Notepad or notepad++ open, add pause at the end of the file (PS: Startup.bat and Shutdown.bat are DOS batch commands, pause is also a DOS command, the function is to output the message "Press any key to continue ...", and then the user randomly hit a key after the program continues to run), Such a flashing interface will stop to allow us to view the error message. As shown in the following:

3. Start Eclipse and configure Tomcat. Click Select Window---->preference, locate and select server---->runtime environment on the left (note that each version of Eclipse may be different, search Runtime, etc.) as shown in:

Select the add ..., pop-up window, select Apache Tomcat V8.0, which is typically the version number for the installed Tomcat version. Click Next >

In the pop-up window, click Browse ..., locate the Tomcat installation root directory, and then select back. JRE drop-down Select the version that will be used, in this test take jdk1.8.0_92 as an example, select can. Click Finish to complete this step setup. At this point, the servers project file should appear in the Project Explorer on the left of Eclipse.

4. Click to select File---->new---->other ... In the pop-up window, select dynamic Web Project, such as:

Click Next >

PS: Here is recommended to select Next >,next, tick generate Web. XML deployment descriptor, click Finish. At this point, the new first project file is displayed in the Project Explorer on the left. Ps:eclipse New Dynamic Web project does not automatically create JSP files, which differs from MyEclipse.

5. Create a new ijsp file under the project file subdirectory webcontent in step 4th and name it index.jsp (default home page).

6, display servers components, and improve the project configuration parameters (release parameters).

The default configuration of Eclipse does not show the servers component, in Eclipse, click Window---->show View---->other Find servers click Select.

At this point, eclipse will display the servers component, and you can drag the servers component to the appropriate location. (both Ps:eclipse and myeclipse can be used to construct layouts that fit their habits by dragging components).

Click the link to add the server. Such as:

In the popup screen, confirm the Tomcat server created in step 3rd. Click Next >

Add the project file to the server, and when you are done, click Finish. Such as:

When the above steps are completed successfully, the Servers component view appears as follows:

The following sections are key settings, or a variety of exceptions will occur.

The following sections are key settings, or a variety of exceptions will occur.

Important things say three times, the following sections are key settings, otherwise there will be various exceptions.

1) Select the servers component, double-click the Tomcat server or press the F3 key to bring up the following interface:

2) in Server locations, select Use Tomcat installation (take control of Tomcat installation).

Deploy path: Change to WebApps, or choose Tomcat to hold the application directory.

In the Server options:

Server modules without Publishing: checked, the specific explanation also requires in-depth learning.

Publish module contexts to separate XML files: Select to automatically modify the XML configuration file.

3) automatically publish when the resources change: automatically post after modifying a JSP file Tomcat can be loaded automatically. Confirm Parameters:

7, release the test.

Click the Start button (green Circle button) in the servers component and wait for the following message to appear in the console window: Server startup in xxxx MS, which means that Tomcat boot is complete.

You can display index.jsp by entering Localhost:8080/first in the address bar in the browser.

Ps:

1) First in the Address bar is the project file name, which is case sensitive. This place has a question, the address bar input is generally case-insensitive, but is case-sensitive here.

2) The following warning appears in console when you start Tomcat in the servers component

Warning: [Setpropertiesrule]{server/service/engine/host/context} Setting Property ' source ' to ' org.eclipse.jst.jee.server : First ' did not ' find a matching property.

The reason is: Publish module contexts to separate XML files is not selected, according to step 6, tick publish module contexts to separate XML files.

Eclipse Publishing Path changes

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.