Various Patches
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEInit.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEInit.java
index 232113b..4a707f7 100644
--- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEInit.java
+++ b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/internal/J2EEInit.java
@@ -43,6 +43,9 @@
 import org.eclipse.jst.j2ee.webservice.wsdd.WsddResourceFactory;
 import org.eclipse.wst.common.emf.utilities.AdapterFactoryDescriptor;
 import org.eclipse.wst.common.emf.utilities.ExtendedEcoreUtil;
+import org.eclipse.wst.common.internal.emf.resource.EMF2DOMRenderer;
+import org.eclipse.wst.common.internal.emf.resource.EMF2DOMRendererFactory;
+import org.eclipse.wst.common.internal.emf.resource.RendererFactory;
 import org.eclipse.wst.common.internal.emf.utilities.DOMUtilities;
 import org.eclipse.wst.common.internal.emf.utilities.EncoderDecoderRegistry;
 import org.eclipse.wst.common.internal.emf.utilities.PasswordEncoderDecoder;
@@ -96,6 +99,9 @@
 					return new EJBAttributeMaintenanceFactoryImpl();
 				}
 			});
+			//TODO: Remove this line after SED Adapter is restored.
+			RendererFactory.getDefaultRendererFactory().setValidating(false);
+
 		}
 	}
 
diff --git a/plugins/org.eclipse.jst.j2ee.jca/jcaedit/org/eclipse/jst/j2ee/internal/jca/archive/operations/RARProjectLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.jca/jcaedit/org/eclipse/jst/j2ee/internal/jca/archive/operations/RARProjectLoadStrategyImpl.java
index e458f96..b7aa131 100644
--- a/plugins/org.eclipse.jst.j2ee.jca/jcaedit/org/eclipse/jst/j2ee/internal/jca/archive/operations/RARProjectLoadStrategyImpl.java
+++ b/plugins/org.eclipse.jst.j2ee.jca/jcaedit/org/eclipse/jst/j2ee/internal/jca/archive/operations/RARProjectLoadStrategyImpl.java
@@ -110,7 +110,7 @@
 
 	private File createNestedArchive(List sourceIFiles, IFolder folder) {
 		NestedJARLoadStrategyImpl loader = new NestedJARLoadStrategyImpl(this, sourceIFiles, folder);
-		loader.setExportSource(exportSource);
+		loader.setExportSource(isExportSource());
 		ArchiveOptions options = ((Archive) getContainer()).getOptions().cloneWith(loader);
 		String uri = computeUniqueArchiveURI(folder);
 		try {
@@ -243,8 +243,8 @@
 		return ArchiveConstants.RAR_DD_URI.equals(path.toString());
 	}
 
-	public String getModuleFolderName() {
-		return moduleRoot.getName();
+	public IContainer getModuleContainer() {
+		return moduleRoot;
 	}
 
 	public IContainer getModuleRoot() {
diff --git a/plugins/org.eclipse.jst.j2ee.jca/plugin.xml b/plugins/org.eclipse.jst.j2ee.jca/plugin.xml
index 768148e..32de077 100644
--- a/plugins/org.eclipse.jst.j2ee.jca/plugin.xml
+++ b/plugins/org.eclipse.jst.j2ee.jca/plugin.xml
@@ -77,9 +77,9 @@
          point="org.eclipse.wst.common.emfworkbench.integration.adapterFactory">
       <adapterFactory
             functionGroupID="org.eclipse.jst.j2ee"
-            className="org.eclipse.jst.j2ee.internal.jca.provider.JcaItemProviderAdapterFactory"
+            className="org.eclipse.jst.j2ee.internal.jca.providers.JcaItemProviderAdapterFactory"
             packageURI="jca.xmi"
-            id="org.eclipse.jst.j2ee.jca.provider.JcaItemProviderAdapterFactory">
+            id="org.eclipse.jst.j2ee.jca.providers.JcaItemProviderAdapterFactory">
       </adapterFactory>
    </extension>
    <extension
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java
index 90a3785..eff874a 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java
+++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java
@@ -93,18 +93,24 @@
 	 */
 	public boolean isEnabled() {
 
-		DeployerRegistry reg = DeployerRegistry.instance();
+		try {
+			DeployerRegistry reg = DeployerRegistry.instance();
 
-		List modules = DeployerRegistry.getSelectedModules(selection.toArray());
-		for (int i = 0; i < modules.size(); i++) {
-			EObject module = (EObject) modules.get(i);
-			IProject proj = ProjectUtilities.getProject(module);
-			IRuntime runtime = ServerCore.getProjectProperties(proj).getRuntimeTarget();
-			if (proj == null || runtime == null)
-				return false;
-			List visitors = reg.getDeployModuleExtensions(module, runtime);
-			if (!visitors.isEmpty())
-				return true;
+			List modules = DeployerRegistry.getSelectedModules(selection.toArray());
+			for (int i = 0; i < modules.size(); i++) {
+				EObject module = (EObject) modules.get(i);
+				IProject proj = ProjectUtilities.getProject(module);
+				IRuntime runtime = ServerCore.getProjectProperties(proj).getRuntimeTarget();
+				if (proj == null || runtime == null)
+					return false;
+				List visitors = reg.getDeployModuleExtensions(module, runtime);
+				if (!visitors.isEmpty())
+					return true;
+			}
+			return false;
+		} catch (RuntimeException e) { 
+			System.out.println("Deploy Action recovering from problem verifying enablement.");
+			e.printStackTrace();
 		}
 		return false;
 	}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java
index b882011..0979f23 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java
+++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java
@@ -67,7 +67,7 @@
 	public static final String APP_CLIENT_EDITOR_ID = "org.eclipse.jst.j2ee.internal.internal.application.client.presentation.ApplicationClientEditor"; //$NON-NLS-1$
 	public static final String JAVA_EDITOR_ID = "org.eclipse.jst.j2ee.internal.internal.ejb.ui.java.EnterpriseBeanJavaEditor"; //$NON-NLS-1$
 	public static final String EJB_MAP_EDITOR_ID = "com.ibm.etools.ejbrdbmapping.presentation.EjbRdbMappingEditorID"; //$NON-NLS-1$
-	public static final String CONNECTOR_EDITOR_ID = "com.ibm.sse.editor.xml.StructuredTextEditorXML"; //$NON-NLS-1$
+	public static final String CONNECTOR_EDITOR_ID = "org.eclipse.wst.xml.ui.StructuredTextEditorXML"; //$NON-NLS-1$
 	public static final String WEB_SERVICE_EDITOR_ID = "org.eclipse.jst.j2ee.internal.internal.webservice.atk.ui.editor.ws.WebServicesEditor"; //$NON-NLS-1$
 	public static final String BASE_JAVA_EDITOR_ID = "org.eclipse.jdt.ui.CompilationUnitEditor"; //$NON-NLS-1$
 	public static final String WSDL_EDITOR_ID = "com.ibm.etools.wsdleditor.WSDLEditor"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.jst.j2ee.ui/plugin.xml b/plugins/org.eclipse.jst.j2ee.ui/plugin.xml
index c8aafa5..ed13739 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/plugin.xml
+++ b/plugins/org.eclipse.jst.j2ee.ui/plugin.xml
@@ -85,7 +85,7 @@
             category="org.eclipse.jst.j2ee.internal"
             class="org.eclipse.jst.j2ee.ui.AppClientModuleCreationWizard"
             project="true"
-            finalPerspective="org.eclipse.jst.j2ee.internal.J2EEPerspective"
+            finalPerspective="org.eclipse.jst.j2ee.J2EEPerspective"
             id="org.eclipse.jst.j2ee.ui.AppClientModuleCreationWizard">
          <description>
             %new.appclient.project.description_ui_
@@ -437,7 +437,7 @@
 <!-- ================================================== -->
 <!--          DEPLOY EXTENSIONS                         -->
 <!-- ================================================== -->
-   <extension
+<!--   <extension
          point="org.eclipse.ui.popupMenus">
       <objectContribution
             objectClass="java.lang.Object"
@@ -501,8 +501,7 @@
             </or>
          </visibility>
       </objectContribution>
-   </extension>
-
+   </extension> -->
 <!-- Navigator Object Contributions -->
 
    
diff --git a/plugins/org.eclipse.jst.j2ee.web/plugin.xml b/plugins/org.eclipse.jst.j2ee.web/plugin.xml
index 4212fdb..21ebc80 100644
--- a/plugins/org.eclipse.jst.j2ee.web/plugin.xml
+++ b/plugins/org.eclipse.jst.j2ee.web/plugin.xml
@@ -169,31 +169,31 @@
 <!-- ==================================================================== -->
    <extension
          point="org.eclipse.wst.server.core.moduleArtifactAdapters">
-      <moduleObjectAdapter
+      <moduleArtifactAdapter
             class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter"
             objectClass="org.eclipse.jst.j2ee.internal.webapplication.WebApp"
             id="org.eclipse.jst.web.server.webresource">
-      </moduleObjectAdapter>
-      <moduleObjectAdapter
+      </moduleArtifactAdapter>
+      <moduleArtifactAdapter
             objectClass="org.eclipse.jst.j2ee.internal.webapplication.Servlet"
             class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter"
             id="org.eclipse.jst.web.server.webresource2">
-      </moduleObjectAdapter>
-            <moduleObjectAdapter
+      </moduleArtifactAdapter>
+            <moduleArtifactAdapter
             objectClass="org.eclipse.core.resources.IProject"
             class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter"
             id="org.eclipse.jst.web.server.webresource3">
-      </moduleObjectAdapter>
-      <moduleObjectAdapter
+      </moduleArtifactAdapter>
+      <moduleArtifactAdapter
             objectClass="org.eclipse.core.resources.IFile"
             class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter"
             id="corg.eclipse.jst.web.server.webresource4">
-      </moduleObjectAdapter>
-      <moduleObjectAdapter
+      </moduleArtifactAdapter>
+      <moduleArtifactAdapter
             objectClass="org.eclipse.jdt.core.ICompilationUnit"
             class="org.eclipse.jst.j2ee.internal.web.deployables.WebDeployableObjectAdapter"
             id="org.eclipse.jst.web.server.webresource5">
-      </moduleObjectAdapter>
+      </moduleArtifactAdapter>
    </extension>
 <!-- =============================================================== -->
 <!-- Extension point: com.ibm.etools.server.core.moduleFactories -->
diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEWebDeployable.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEWebDeployable.java
index 3cc9b46..f4249aa 100644
--- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEWebDeployable.java
+++ b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEWebDeployable.java
@@ -42,7 +42,7 @@
  * @version 1.0
  * @author
  */
-public class J2EEWebDeployable extends J2EEDeployable implements IWebModule, ILooseArchiveSupport {
+public class J2EEWebDeployable extends J2EEDeployable implements IWebModule, ILooseArchiveSupport, IModuleType {
     protected String contextRoot;
 
     protected ILooseArchive[] archives;
@@ -57,6 +57,10 @@
         super(aNature, aFactoryId);
         this.contextRoot = getUncachedContextRoot();
     }
+    
+	public String getId() {
+		return getFactoryId() +":"+ getProject().getName();
+	}
 
     public String getContextRoot() {
         return this.contextRoot;
@@ -360,8 +364,31 @@
      * @see org.eclipse.wst.server.core.IModule#getModuleType()
      */
     public IModuleType getModuleType() {
+        return new IModuleType(){
+
+            public String getId() {
+                return "j2ee.web";
+            }
+
+            public String getName() {
+                // TODO Auto-generated method stub
+                return getModuleTypeName();
+            }
+
+            public String getVersion() {
+                // TODO Auto-generated method stub
+                return getModuleTypeVersion();
+            }};
         // TODO Auto-generated method stub
-        return null;
+       // return this;
+    }
+    
+    public String getModuleTypeName(){
+        return getName();
+    }
+    
+    public String getModuleTypeVersion(){
+        return getVersion();
     }
 
     /*
diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java
index 2f7dbcf..b532f42 100644
--- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java
+++ b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/WebDeployableFactory.java
@@ -79,6 +79,8 @@
      * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModules()
      */
     public IModule[] getModules() {
+        if (projects == null)
+            cacheModules();
         int i = 0;
         Iterator modules = projects.values().iterator();
         IModule[] modulesArray = new IModule[projects.values().size()];
diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategyImpl.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategyImpl.java
index 89cb81f..060edcc 100644
--- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategyImpl.java
+++ b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/archive/operations/WTProjectLoadStrategyImpl.java
@@ -37,11 +37,13 @@
 import org.eclipse.wst.web.internal.operation.IBaseWebNature;
 import org.eclipse.wst.web.internal.operation.ILibModule;
 
+import com.ibm.wtp.emf.workbench.ProjectUtilities;
 import com.ibm.wtp.emf.workbench.WorkbenchURIConverter;
 import com.ibm.wtp.emf.workbench.WorkbenchURIConverterImpl;
 
 public class WTProjectLoadStrategyImpl extends org.eclipse.jst.j2ee.internal.archive.operations.J2EELoadStrategyImpl {
 	private final static String SOURCE_DIR = "source"; //$NON-NLS-1$
+	private final static String CLASSES_DIR = "classes"; //$NON-NLS-1$
 
 	public static final String WEBSETTINGS_FILE_URI = ".j2ee"; //$NON-NLS-1$
 
@@ -74,7 +76,7 @@
 				String uri = new Path(iLibModule.getURI()).makeRelative().toString();
 				String projectName = iLibModule.getProjectName();
 				try {
-					Archive utilJAR = J2EEProjectUtilities.asArchive(uri, projectName, exportSource, includeProjectMetaFiles);
+					Archive utilJAR = J2EEProjectUtilities.asArchive(uri, projectName, isExportSource(), shouldIncludeProjectMetaFiles());
 					if (utilJAR == null)
 						continue;
 					filesList.add(utilJAR);
@@ -90,93 +92,70 @@
 	 * @see com.ibm.etools.archive.LoadStrategy
 	 */
 	public java.util.List getFiles() {
-
 		filesList.clear();
-
 		try {
 			// Determine if loose libs exist and set flag for meta files
-			if (areLooseLibJarsIncluded())
-				includeProjectMetaFiles = true;
-
+			if (areLooseLibJarsIncluded()) {
+				setIncludeProjectMetaFiles(true);
+			}
 			// First go through all of the files under the webApplication
 			// directory, omitting the ones that are imported classes jars.
-			List webAppFiles = null;
+			List webAppFiles = new ArrayList(Arrays.asList(getModuleContainer().members()));
+			if (shouldIncludeProjectMetaFiles()) {
+				webAppFiles.add(getProject().getFile(PROJECT_FILE_URI));
+				webAppFiles.add(getProject().getFile(CLASSPATH_FILE_URI));
+				webAppFiles.add(getProject().getFile(WEBSETTINGS_FILE_URI));
+			}
+			IContainer outputContainer = ProjectUtilities.getJavaProjectOutputContainer(getProject());
+			webAppFiles.addAll(Arrays.asList(outputContainer.members()));
 
 			// if the user has chosen not to export compiled JSP files, then we need to make sure
 			// that
 			// the compiled class files are excluded from the /WEB-INF/classes directory
 			if (isExcludeCompiledJspFiles()) {
-				webAppFiles = new ArrayList(Arrays.asList(getModuleFolder().members()));
-
 				try {
-					IBaseWebNature wnr = J2EEWebNatureRuntimeUtilities.getRuntime(project);
-					if (wnr != null) {
-
-						IPath modulePath = wnr.getWebModulePath();
-						IPath outputPath = J2EEWebNatureRuntimeUtilities.getWebOutputFolderPath(modulePath.toString());
-
-						// remove the WEB-INF folder from the list... we will get files from that
-						// directory
-						// after all others, in order to calculate which output files may exist,
-						// according
-						// to the JSPs in all other directories
-						IPath webInf = modulePath.append(IWebNatureConstants.INFO_DIRECTORY);
-						IResource outputDirResource = null;
-						int len = webAppFiles.size();
-						boolean found = false;
-						for (int i = 0; !found && i < len; i++) {
-							IResource res = (IResource) webAppFiles.get(i);
-							if (res.getFullPath().equals(webInf)) {
-								outputDirResource = (IResource) webAppFiles.remove(i);
-								found = true;
-							}
-						}
-
-						if (includeProjectMetaFiles) {
-							webAppFiles.add(getProject().getFile(PROJECT_FILE_URI));
-							webAppFiles.add(getProject().getFile(CLASSPATH_FILE_URI));
-							webAppFiles.add(getProject().getFile(WEBSETTINGS_FILE_URI));
-						}
-
-						// collect all the files (excluding those in /WEB-INF) and mark all of the
-						// JSPs' compiled files (.class,.java) to be excluded from the
-						webAppFiles = getFilesExcludeCompiledJsps(webAppFiles, outputPath);
-
-						// now collect the files from the /WEB-INF directory. All of the compiled
-						// JSP
-						// output files should not be picked up now, as they were placed into the
-						// visitedURIs
-						// list
-						ArrayList webInfList = new ArrayList(1);
-						webInfList.add(outputDirResource);
-						webInfList = getFiles(webInfList);
-						webAppFiles.addAll(webInfList);
-					} else {
-						webAppFiles = new ArrayList(Arrays.asList(getModuleFolder().members()));
-
-						if (includeProjectMetaFiles) {
-							webAppFiles.add(getProject().getFile(PROJECT_FILE_URI));
-							webAppFiles.add(getProject().getFile(CLASSPATH_FILE_URI));
-							webAppFiles.add(getProject().getFile(WEBSETTINGS_FILE_URI));
-						}
-						webAppFiles = getFiles(webAppFiles);
-					}
-
+					//					IBaseWebNature wnr = J2EEWebNatureRuntimeUtilities.getRuntime(project);
+					IPath outputPath = outputContainer.getProjectRelativePath();
+					//					if (wnr != null) {
+					//						IPath modulePath = wnr.getWebModulePath();
+					//						IPath outputPath =
+					// J2EEWebNatureRuntimeUtilities.getWebOutputFolderPath(modulePath.toString());
+					// remove the WEB-INF folder from the list... we will get files from that
+					// directory
+					// after all others, in order to calculate which output files may exist,
+					// according
+					// to the JSPs in all other directories
+					//						IPath webInf = modulePath.append(IWebNatureConstants.INFO_DIRECTORY);
+					//					IResource outputDirResource = null;
+					//					int len = webAppFiles.size();
+					//					boolean found = false;
+					//					for (int i = 0; !found && i < len; i++) {
+					//						IResource res = (IResource) webAppFiles.get(i);
+					//						if (res.getFullPath().equals(outputPath)) {
+					//							outputDirResource = (IResource) webAppFiles.remove(i);
+					//							found = true;
+					//						}
+					//					}
+					// collect all the files (excluding those in /WEB-INF) and mark all of the
+					// JSPs' compiled files (.class,.java) to be excluded from the
+					webAppFiles = getFilesExcludeCompiledJsps(webAppFiles, outputPath);
+					// now collect the files from the /WEB-INF directory. All of the compiled
+					// JSP
+					// output files should not be picked up now, as they were placed into the
+					// visitedURIs
+					// list
+					ArrayList webInfList = new ArrayList(1);
+					webInfList.add(outputContainer);
+					webInfList = getFiles(webInfList);
+					webAppFiles.addAll(webInfList);
+					//					} else {
+					//						webAppFiles = getFiles(webAppFiles);
+					//					}
 				} catch (Exception e) {
 					throw new ArchiveRuntimeException(e.getMessage(), e);
 				}
-
 			} else {
-				webAppFiles = new ArrayList(Arrays.asList(getModuleFolder().members()));
-
-				if (includeProjectMetaFiles) {
-					webAppFiles.add(getProject().getFile(PROJECT_FILE_URI));
-					webAppFiles.add(getProject().getFile(CLASSPATH_FILE_URI));
-					webAppFiles.add(getProject().getFile(WEBSETTINGS_FILE_URI));
-				}
-				//HashSet addedURIs = new HashSet();
 				webAppFiles = getFiles(webAppFiles);
-
 			}
 
 			HashSet addedURIs = new HashSet();
@@ -412,7 +391,7 @@
 	/**
 	 * @see com.ibm.etools.archive.LoadStrategy
 	 */
-	public IContainer getModuleFolder() {
+	public IContainer getModuleContainer() {
 
 		try {
 			IBaseWebNature wnr = J2EEWebNatureRuntimeUtilities.getRuntime(project);
@@ -423,13 +402,6 @@
 	}
 
 	/**
-	 * @see com.ibm.etools.archive.LoadStrategy
-	 */
-	public String getModuleFolderName() {
-		return getModuleFolder().getName();
-	}
-
-	/**
 	 * save method comment.
 	 */
 	public WorkbenchURIConverter getProjectURIConverter() {
@@ -463,20 +435,28 @@
 		J2EEWebNatureRuntime wnr = J2EEWebNatureRuntime.getRuntime(project);
 		String uri = aPath.toString();
 		if (uri.startsWith(wnr.getModuleServerRootName())) {
-			return new Path(uri).removeFirstSegments(1);
+			return new Path(uri).removeFirstSegments(wnr.getModuleServerRoot().getProjectRelativePath().segmentCount());
 		}
 		// If this is a source folder, stick it 'source' dir under the classes directory
 		List asourceFolders = getSourceFolders();
 		for (Iterator iterator = asourceFolders.iterator(); iterator.hasNext();) {
 			IFolder sourceFolder = (IFolder) iterator.next();
 			if (uri.startsWith(sourceFolder.getProjectRelativePath().toString())) {
-				IPath relPath = aPath.removeFirstSegments(1);
+				IPath relPath = aPath.removeFirstSegments(sourceFolder.getProjectRelativePath().segmentCount());
 				IPath retPath = new Path(J2EEConstants.WEB_INF);
 				retPath = retPath.append(SOURCE_DIR);
 				return retPath.append(relPath);
 			}
 		}
 
+		// If this is in an output folder, stick it in 'WEB-INF/classes
+		IPath outputPath = ProjectUtilities.getJavaProjectOutputContainer(getProject()).getProjectRelativePath();
+		if (aPath.segmentCount() > outputPath.segmentCount() && aPath.removeLastSegments(aPath.segmentCount() - outputPath.segmentCount()).equals(outputPath)) {
+			IPath retPath = new Path(J2EEConstants.WEB_INF);
+			retPath = retPath.append(CLASSES_DIR);
+			return retPath.append(aPath.removeFirstSegments(outputPath.segmentCount()));
+		}
+
 		return aPath;
 	}
 
diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IDynamicWebNature.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IDynamicWebNature.java
index 37cd6a7..b7b5adb 100644
--- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IDynamicWebNature.java
+++ b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/IDynamicWebNature.java
@@ -11,7 +11,6 @@
 package org.eclipse.jst.j2ee.internal.web.operations;
 
 import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.runtime.IPath;
 import org.eclipse.wst.web.internal.operation.IStaticWebNature;
 
 
diff --git a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebPropertiesUtil.java b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebPropertiesUtil.java
index bde1342..0fdf4a2 100644
--- a/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebPropertiesUtil.java
+++ b/plugins/org.eclipse.jst.j2ee.web/webproject/org/eclipse/jst/j2ee/internal/web/operations/WebPropertiesUtil.java
@@ -73,7 +73,7 @@
 			}
 
 			IPath newPath = new Path(webContentName);
-			if (webNature.getRootPublishableFolder().equals(newPath))
+			if (webNature.getRootPublishableFolder().getProjectRelativePath().equals(newPath))
 				return false;
 
 			if (project.exists(newPath)) {