Create a WEB Project (not myeclipse) in eclipse)

Source: Internet
Author: User
Tags apache tomcat

How to create a dynamic web project

This article demonstrates how to create a dynamic web project from a local file, and create a dynamic web project while checking out from SVN. We recommend that you use the unzip version of Tomcat 6.x as the server. You can download from the http://tomcat.apache.org. Before creating a dynamic web project, create a server to run and debug the WEB Project in eclipse.

Create a server

The server is created to enable and debug the dynamic Web project in eclipse. Let's create a server that uses Tomcat as an example and follow the steps below:

    • Create a server project

    • Select tomcat6 and associate it with our tomcat directory.

    • If you have a dynamic web project in your project, it will be automatically listed in the box on the left. You can select one or more items to the right, after finishing, eclipse registers these projects to the server, that is, the server on the server. add <context docbase = "simplejeewebcontent" Path = "/simplejee"> </context>

      . If you are familiar with tomcat, you must be familiar with this.

    • After that, you will see the following window. If you cannot see it, you can open the corresponding view as shown in the second figure.

    • Such a server is configured. Click the green running button to run your Tomcat using the configuration under the server.

 

Create dynamic
WEB Project

Eclipse's dynamic web project is similar to myeclipse's web project. If you create a dynamic web project in myeclipse, You need to select Show All wizards when creating a new project:

    • Similar to creating other projects, choose File> New> Other> Web> dynamic web project,

    • Enter information about the project. There is a project contents in this interface. The mode is in your workspace. You can also select other locations or an existing file. I am used to placing project files in other separate folders.

Note that if you are using the myeclipse web project, the default value of content directory is webroot. You need to change it to webcontent, because our scripts are all written according to webcontent.

After you click OK, the following warning box may pop up asking if you want to switch to the javaee view associated with the project type. The so-called view is simply a combination of views.

    • After the project is created, the following content appears in the project bar on the left. (The specific display method is related to the view in which you view the content, the figure shows the display form under navigator)

    • You can also modify the configuration of the project according to your habits. I am used to compiling java files to webcontentweb-infclasses. You can click the "Source" tab, modify the content of default Output Folder. In addition, note that Apache Tomcat v6.0 is a bunch of jar packages corresponding to the introduced server, while web app libraries refers to all jar packages under webcontent/lib under your project, when you add a new jar under webcontent/lib, you do not need to add
      Jars.

    • Right-click the project root directory, run as, and select run on server to run the project in eclipse.

 

Breakpoint debugging

After creating a server and dynamic web project, debug the Java code by selecting debug as when running the project. In addition, you can also use remote Java project.

In this way, you need to write a script for Tomcat again.

Debug. bat

 

View source1set
Catalina_opts =-server-xdebug-xnoagent-djava. compiler = none-xrunjdwp: Transport = dt_socket, Server = Y, suspend = N, address = 58882 call startup. Bat tips

As follows:

    • When your project is large and you want to start Tomcat to run in eclipse, it will often fail due to timeout. You can double-click a server in the View of servers, the content in the upper part can be extended in timeouts.

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.