How to create Dynamic Web project projects (Eclipse for EE)

Source: Internet
Author: User
Tags tomcat apache tomcat

New version Http://code.google.com/p/helloj2ee/wiki/dynamic_web_project 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 facilitate the launch and debugging of Dynamic Web project in Eclipse, and we took the example of creating a server that uses Tomcat, basically following the screenshot step-by-step: Create a new server project we chose Tomcat6, and associated to our Tomcat directory in the following image, if your project has a Dynamic Web project, then it will be automatically listed in the left box, you can choose one or several to the right of the box, after the finish, Eclipse will register these items with the server, that is, in the server's server.xml to add a similar

<context docbase= "simplejee\webcontent" path= "/simplejee" >
</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 in the image above 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: Like creating other projects, or from file->new->other->web->dynamic Web project, fill in the information about 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 relevant, the diagram is navigator under the display) you can also modify the project according to your habits of the relevant configuration, I am accustomed to compiling Java files into webcontent\web-inf\classes, which you can click on the tab of source to modify the contents of the default output folder. Also note the following image of Apache Tomcat v6.0 which is the introduction of the server corresponding to a bunch of jar packages, 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, you need to write a script to Tomcat again Debug.bat

SET Catalina_opts=-server-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,server=y,suspend=n, address=5888 Call 
Startup.bat
Little Tricks

As follows, will continue to add: when your project is larger and want to start Tomcat in eclipse to run, often because of time-out to fail, you can double-click on the servers view of a server, this will appear, the next image of the upper half of the content, The time-out can be extended in the 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.