| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE html |
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html> |
| <head> |
| <!-- /******************************************************************************* |
| * Copyright (c) 2000, 2005 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ --> |
| <link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" /> |
| <title>Creating a dynamic Web project</title> |
| </head> |
| <body id="twcreprj"><a name="twcreprj"><!-- --></a> |
| |
| <h1 class="topictitle1">Creating a dynamic Web project</h1> |
| <div><div class="skipspace"> <p>You create and maintain the resources for your Web applications |
| |
| in Web projects. Unlike with <a href="twcresta.html">static</a> Web projects, dynamic Web projects |
| enable you to create resources such as JavaServer Pages and servlets.</p> |
| <p>To create a new dynamic Web project, complete the following steps:</p> |
| </div> |
| <ol><li class="skipspace"><span>Open the J2EE perspective and select <span class="menucascade"><span class="uicontrol">File</span> > <span class="uicontrol">New</span> > <span class="uicontrol">Dynamic Web Project</span></span>.</span> The <span class="uicontrol">New Dynamic Web Project</span> wizard starts.</li> |
| <li class="skipspace"><span>Type a name for your Web project.</span> <p></p> |
| </li> |
| <li class="skipspace"><span>Accept the default value in the <span class="uicontrol">Project location</span> field |
| |
| (this is where your project is stored in your file system), or click <span class="uicontrol">Browse</span> to |
| |
| choose a location from the file system. Then click the <b>Show Advanced</b> button |
| |
| if the advanced options are not already displayed.</span> <p></p> |
| </li> |
| <li class="skipspace"><span>Select the servlet version number.</span> The servlet version |
| |
| determines the server level on which you can run your applications. Any new servlets and JSP files that you expect to create |
| |
| should adhere to the latest servlet specification level available. (Previous |
| |
| specification levels are offered to accommodate any legacy dynamic elements |
| |
| that you expect to import into the project). <div class="p"><b>Notes:</b> <ul><li>The servlet version determines the choice of target servers that appear |
| |
| in the drop-down list.</li> |
| <li>The following servlet versions correspond to the following J2EE levels: |
| |
| <ul><li>version 2.2 - J2EE 1.2</li> |
| <li>version 2.3 - J2EE 1.3</li> |
| <li>version 2.4 - J2EE 1.4</li> |
| </ul> |
| </li> |
| <li>Note that you can upgrade your servlet version using the <a href="../../org.eclipse.jst.j2eeapp.doc.user/topics/tjmigrate.html">J2EE Migration Wizard</a> but you can't go revert to an earlier |
| |
| level.</li> |
| </ul> |
| </div> |
| </li> |
| <li class="skipspace"><span>Select a target server from the drop-down list or create a new |
| |
| target server by selecting the <span class="uicontrol">New</span> button</span></li> |
| <li class="skipspace"><span>A new or existing Enterprise Application project (EAR Project) |
| |
| must be associated with your new Web project to facilitate deployment. If |
| |
| you want to override the default settings for the Enterprise Application project, |
| |
| click <span class="uicontrol">New</span>, and make your changes. When your Web project |
| |
| is created at the end of the wizard, the new Enterprise Application project |
| |
| is also created with the name specified in the EAR project field. Note that |
| |
| the default is the name of the web project appended with EAR (unless the ear |
| |
| project was selected when you opened the wizard.) If you want to use an existing |
| |
| Enterprise Application project, select the project from the <span class="uicontrol">EAR |
| |
| project</span> drop down list.</span> <p> If you want to add a Web |
| |
| project as a module to another Enterprise Application project in the future, |
| |
| you can open the <a href="../../org.eclipse.jst.j2eeapp.doc.user/topics/cjapped.html">application deployment descriptor editor</a> for the Enterprise |
| |
| Application project and select the <span><span class="uicontrol">Add</span></span> option |
| |
| in the <span><span class="uicontrol">Module</span></span> page.</p> |
| </li> |
| <li class="skipspace"><span> Specify a context root. (The context root is the Web application |
| |
| root, which is the top-level directory of your application when it is deployed |
| |
| to the Web server). You can change the context root after you create a project |
| |
| using the project <span><span class="uicontrol">Properties</span></span> dialog, which |
| |
| you access from the project's pop-up menu. The context root can also be used |
| |
| by the links builder to ensure that your links remain ready to publish as |
| |
| you move and rename files inside your project.</span></li> |
| <li class="skipspace"><span>To add support for annotated Java classes, select the appropriate |
| |
| check box.</span></li> |
| <li class="skipspace"><span> To specify or customize the project options, select the <span class="uicontrol">Next</span> check |
| |
| box .</span></li> |
| <li class="skipspace"><span>Select one or more of the <span><span class="uicontrol">Web Project features</span></span>. |
| |
| The box on the right displays a description of each feature as you select |
| |
| it on the left. </span> The default features are, <b>Default style sheet</b> (CSS |
| |
| file) and <a href="../../org.eclipse.wst.web.diagram.doc.user/topics/twebdia020.html"> web diagram</a>. Accepting the default style sheet creates |
| |
| a default CSS file called Master.css, which is used for any HTML and JSP files |
| |
| included in the project.<ul> |
| </ul> |
| </li> |
| <li class="skipspace"><span>Click <span class="uicontrol">Next</span>.</span></li> |
| <li class="skipspace"><span>Select <span class="uicontrol">Use a default Page Template for the Web Site</span> if |
| |
| you want your entire Web site to share a common page template. If you want |
| |
| to use one of the sample templates provided, select <span class="uicontrol">Sample Template</span> and |
| |
| then choose one of the templates shown in the <span class="uicontrol">Thumbnail</span> box. |
| |
| If you want to use a template of your own, select <span class="uicontrol">User-defined |
| |
| Template</span> and then click <span class="uicontrol">Browse</span> to select |
| |
| the template from the file system. The selected template is copied into your project for use when creating web pages. </span></li> |
| <li class="skipspace"><span>Click <span class="uicontrol">Finish</span>. The wizard creates a new project that reflects the |
| |
| J2EE folder structure that specifies the location of web content files, class |
| |
| files, class paths, the deployment descriptor, and supporting metadata. </span></li> |
| </ol> |
| <div class="skipspace"><p>You can now begin creating or importing content for your Web project |
| |
| using Web resource editors, the New File wizards, or the Import wizards available from |
| |
| the <span class="uicontrol">File</span> menu.</p> |
| </div> |
| </div> |
| <div><p><b class="relconceptshd">Related concepts</b><br /> |
| <a href="ccwebprj.html">Dynamic Web projects and applications</a><br /> |
| <a href="ccstatic.html">Static Web projects</a><br /> |
| </p> |
| <p><b class="reltaskshd">Related tasks</b><br /> |
| <a href="tjcrehtm.html" title="">Creating HTML or XHTML files</a><br /> |
| <a href="tjcrejsp.html" title="">Creating JSP files</a><br /> |
| </p> |
| </div> |
| </body> |
| </html> |