geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r933246 - /geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/MergeHelper.java
Date Mon, 12 Apr 2010 14:09:38 GMT
Author: xuhaihong
Date: Mon Apr 12 14:09:38 2010
New Revision: 933246

URL: http://svn.apache.org/viewvc?rev=933246&view=rev
Log:
Different prefix for a standalone war and a war in the ear

Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/MergeHelper.java

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/MergeHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/MergeHelper.java?rev=933246&r1=933245&r2=933246&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/MergeHelper.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/MergeHelper.java
Mon Apr 12 14:09:38 2010
@@ -272,6 +272,7 @@ public class MergeHelper {
     public static void processWebFragmentsAndAnnotations(EARContext earContext, Module module,
Bundle bundle, WebAppType webApp) throws DeploymentException {
         BundleResourceFinder bundleResourceFinder = new BundleResourceFinder(null, bundle,
"META-INF/", "web-fragment.xml");
         final Map<String, WebFragmentDocument> jarUrlWebFragmentDocumentMap = new LinkedHashMap<String,
WebFragmentDocument>();
+        final String validJarNamePrefix = module.isStandAlone() ? "WEB-INF" : module.getName()
+ "/WEB-INF";
         try {
             bundleResourceFinder.find(new ResourceFinderCallback() {
 
@@ -282,8 +283,7 @@ public class MergeHelper {
                     if (logger.isDebugEnabled()) {
                         logger.debug("Found web-fragment.xml in jarName = [" + jarName +
"] jarURL = [" + bundle.getEntry(jarName) + "]");
                     }
-                    //TODO Should be confirm the jarName url style while the war is hosted
in the ear
-                    if (jarName.indexOf("WEB-INF") == 0 && jarName.endsWith(".jar"))
{
+                    if (jarName.startsWith(validJarNamePrefix) && jarName.endsWith(".jar"))
{
                         WebFragmentDocument webFragmentDocument = (WebFragmentDocument) XmlBeansUtil.parse(in);
                         //Hopefully, XmlBeansUtil should help to check most of errors against
the schema files, like none null servlet-name etc.
                         XmlBeansUtil.validateDD(webFragmentDocument);



Mime
View raw message