blob: c11742e6ce11ed17fd77db309b09d9edff3bf4f0 [file] [log] [blame]
<?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 lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2009 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 https://www.eclipse.org/legal/epl-2.0/. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2009" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Creating Web fragment projects" />
<meta name="abstract" content="You can use the Web fragment project wizard to create Web fragment projects in your workspace." />
<meta name="description" content="You can use the Web fragment project wizard to create Web fragment projects in your workspace." />
<meta content="Java EE, Web fragment projects, creating" name="DC.subject" />
<meta content="Java EE, Web fragment projects, creating" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/ph-projects.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="webfragmentproj" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Creating Web fragment projects</title>
</head>
<body id="webfragmentproj"><a name="webfragmentproj"><!-- --></a>
<h1 class="topictitle1">Creating Web fragment projects</h1>
<div><p>You can use the Web fragment project wizard to create Web
fragment projects in your workspace.</p>
<div class="p"><p>A web fragment is a logical partitioning of the web application
in such a way that the frameworks being used within the web application
can define all the artifacts without requiring you to edit or add
information in the web.xml. It can include almost all the same elements
that the web.xml descriptor uses, with these requirements:</p>
<ul>
<li>The top level element for the descriptor must be web-fragment</li>
<li>The corresponding descriptor file must be called web-fragment.xml</li>
</ul>
<p>If a framework is packaged as a jar file and has metadata
information in the form of deployment descriptor, then the web-fragment.xml
descriptor must be in the META-INF/ directory of the jar file.</p>
<p>A
web fragment is a mechanism for either defining or extending the deployment
descriptor of a web application by means of pluggable library jars
that contain both the incremental deployment information (in the web-fragment.xml)
and potentially any related or relevant classes. The web fragment
is also packaged as a library (jar), with the web-fragment.xml in
the META-INF directory. Consequently, the web fragment project is
essentially a Utility project, with the addition of a web fragment
facet to it. The web fragment facet enables you to add relevant context-sensitive
functionality to the fragment project.</p>
</div>
<ol>
<li class="stepexpand"><span>In the Java EE perspective,
select <span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">New</span>
&gt; <span class="uicontrol">Web Fragment Project</span></span>. Alternatively,
right-click the Enterprise Explorer context menu, and select <span class="menucascade">
<span class="uicontrol">New</span> &gt; <span class="uicontrol">Web Fragment Project</span>
</span>. The Web fragment wizard opens.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Name</span> field, type a name for
the Web fragment project. To change the default <span class="uicontrol">Project
contents</span>, click the <span class="uicontrol">Browse</span> button
to select a new location.</span> <p>If you specify a non-default
project location that is already being used by another project, the
project creation fails.</p>
</li>
<li class="stepexpand"><span>The <span class="uicontrol">Target runtime</span> field is pre-populated
with the selection from the enterprise project.</span></li>
<li class="stepexpand"><strong>Optional: </strong><span>Select a pre-defined project configuration
from the <span class="uicontrol">Configurations</span> drop-down list.</span>
</li>
<li class="stepexpand"><strong>Optional: </strong><span>If you want to modify the configuration
details, click <span class="uicontrol">modify</span>:</span></li>
<li class="stepexpand"><strong>Optional: </strong><span>Select one or more project facets
from the <span class="uicontrol">Project Facets</span> list. To specify server
runtime environments, click <span class="uicontrol">Show Runtimes</span> and
select one or more runtimes. After making your selections, you can
save your custom configuration by clicking <span class="uicontrol">Save</span>.</span>
</li>
<li class="stepexpand"><strong>Optional: </strong><span>Select the <span class="uicontrol">Add project
to Dynamic Web project</span> check box to add the new module
to an enterprise module (WAR) project.</span> Type a new project
name or select an existing enterprise module project from the drop-down
list in the <span class="uicontrol">Dynamic Web project name</span> combination
box. Or, click <span class="uicontrol">New</span> to launch the New EAR module
Project wizard.</li>
<li class="stepexpand"><span>Select <span class="uicontrol">Add project to working sets</span> to
add the Web fragment project to an existing working set, or click <span class="uicontrol">Select</span> to
locate a working set, and click <span class="uicontrol">Next</span>.</span>
</li>
<li class="stepexpand"><span>On the Configure project for building a Java application page, on the <span class="uicontrol">Source
folders on build path</span> field, click <span class="uicontrol">Add Folder...</span> to
add folders for your source on the build path, or accept the default
value (src).</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Default output Folder:</span> field,
specify a folder for your output files or accept the default value
(bin), and click <span class="uicontrol">Finish</span>.</span></li>
<li class="stepexpand"><span>In Package Explorer view, you see the resulting Web Fragment
project folders:</span> <br /><img src="../images/webfrag.jpg" alt="Web fragment folders" /><br />
</li>
</ol>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/ph-projects.html" title="The workbench can work with many different types of projects. The following topics cover creating and managing some of the types of projects related to J2EE development.">Working with projects</a></div>
</div>
</div>
</body>
</html>