Create a Web project in Eclipse (non-myeclipse)

Source: Internet
Author: User
Tags apache tomcat

How to create Dynamic Web project projects

The demonstration in this article is to create Dynamic Web project from a local file, similar to creating Dynamic Web project from SVN checkout. We recommend using the tomcat6.x version of the decompression version as the server. can be downloaded to http://tomcat.apache.org. Before creating a Dynamic Web project, let's create a server to run and debug the Web project in Eclipse.

Create a server

The server was created to make it easier to start and debug Dynamic Web project in Eclipse, and to create a server that uses Tomcat, for example, basically follow a step-by-step approach:

      • Create a new server project

      • We select Tomcat6 and link to our Tomcat directory

      • In, if your project has a project with Dynamic Web project, it is automatically listed in the box on the left, you can select one or several to the right of the box, after finish, eclipse will register these items to the server, That is, add similar <context docbase= "simplejeewebcontent" path= "/simplejee" in the server.xml of the server ></context>

        The content. If you are familiar with Tomcat, you must be familiar with this.

      • When you're done, you'll see a window like the one below, and if you can't see it, you can open the view as shown in the second picture.

      • Such a server is well-equipped. Click the Green Run button to run your tomcat using the configuration under Server.

Create a Dynamic Web project

The Dynamic Web project of Eclipse itself is similar to MyEclipse Web project, and if you create Dynamic Web project in MyEclipse, you need to check show all when creating a new project. Wizards:

      • Similar to creating other projects, or from File->new->other->web->dynamic Web project,

      • Fill in the relevant information for the project. In this interface there is a project contents, the mode is under your workspace, you can also choose any other location, or the existing file. I am accustomed to putting project files in separate folders.

Note here that if you are using MyEclipse Web project, the value of content directory defaults to Webroot and you need to change to webcontent because our scripts are written in WebContent.

When you click OK, the following warning box may pop up asking if you want to switch to the Java EE view associated with the project type. The so-called simple view is the combination of view.

      • Project creation This is done, in the left side of the project bar will appear the following (the specific display and you are in what view is related, the diagram is navigator under the display form)

      • You can also modify the relevant configuration of the project according to your habits, I am accustomed to the Java files compiled into webcontentweb-infclasses, this you can click on the Source tab, modify the default output folder content. Also note in Apache Tomcat v6.0 This is a bunch of jar packages that are introduced by the server, while Web App libraries refers to all the jar packages under Webcontent/lib under your project when you are in webcontent/ When adding a new jar under LIB, you don't need to add jars yourself.

      • You can run the project in Eclipse by right-clicking on the project root and then run as and selecting run on server.

Breakpoint Debugging

After you have created server and dynamic Web project, debug your Java code as long as you choose Debug as when you run the project, and in another way, Remote Java project.

This way, we need to write a script to Tomcat.

Debug.bat

View Source1SET Catalina_opts=-server-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket, Server=y,suspend=n,address=58882call startup.bat Tips

As follows, will continue to supplement:

      • When your project is large and you want to start Tomcat in eclipse, it often fails because of a timeout, when you can double-click a server in the servers view, and the contents of the upper part can be extended in timeouts.

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.