geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r126409 - /geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java /geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Date Tue, 25 Jan 2005 18:35:54 GMT
Author: djencks
Date: Tue Jan 25 10:35:53 2005
New Revision: 126409

URL: http://svn.apache.org/viewcvs?view=rev&rev=126409
Log:
fix GERONIMO-551, make welcome files work.  Jetty sets the welcome files to null in doStart,
so we have to set them after doStart is called
Modified:
   geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&rev=126409&p1=geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java&r1=126408&p2=geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java&r2=126409
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Tue Jan 25 10:35:53 2005
@@ -377,7 +377,7 @@
             Set securityRoles = collectRoleNames(webApp);
             if (jettyWebApp.isSetSecurityRealmName()) {
                 String securityRealmName = jettyWebApp.getSecurityRealmName().trim();
-                Security security = SecurityBuilder.buildSecurityConfig(Collections.singleton(securityRealmName),
 jettyWebApp.getSecurity(), securityRoles, localSecurityRealms, kernel);
+                Security security = SecurityBuilder.buildSecurityConfig(Collections.singleton(securityRealmName),
jettyWebApp.getSecurity(), securityRoles, localSecurityRealms, kernel);
                 webModuleData.setAttribute("securityRealmName", securityRealmName);
                 webModuleData.setAttribute("securityConfig", security);
 
@@ -436,14 +436,20 @@
 
             WelcomeFileListType[] welcomeFileArray = webApp.getWelcomeFileListArray();
             //not clear if the default welcome files should get added if explicit ones supplied...
-            List welcomeFiles = new ArrayList(defaultWelcomeFiles);
-            for (int i = 0; i < welcomeFileArray.length; i++) {
-                String[] welcomeFileListType = welcomeFileArray[i].getWelcomeFileArray();
-                for (int j = 0; j < welcomeFileListType.length; j++) {
-                    String welcomeFile = welcomeFileListType[j];
-                    welcomeFiles.add(welcomeFile);
+            List welcomeFiles;
+            if (welcomeFileArray.length > 0) {
+                welcomeFiles = new ArrayList();
+                for (int i = 0; i < welcomeFileArray.length; i++) {
+                    String[] welcomeFileListType = welcomeFileArray[i].getWelcomeFileArray();
+                    for (int j = 0; j < welcomeFileListType.length; j++) {
+                        String welcomeFile = welcomeFileListType[j];
+                        welcomeFiles.add(welcomeFile);
+                    }
                 }
+            } else {
+                welcomeFiles = new ArrayList(defaultWelcomeFiles);
             }
+
             webModuleData.setAttribute("welcomeFiles", (String[]) welcomeFiles.toArray(new
String[welcomeFiles.size()]));
 
             LocaleEncodingMappingListType[] localeEncodingMappingListArray = webApp.getLocaleEncodingMappingListArray();

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?view=diff&rev=126409&p1=geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java&r1=126408&p2=geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java&r2=126409
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Tue Jan 25 10:35:53 2005
@@ -72,6 +72,7 @@
     private final URI webAppRoot;
     private final WebApplicationHandler handler;
     private String displayName;
+    private final String[] welcomeFiles;
 
     private final  BeforeAfter chain;
     private final  int contextLength;
@@ -88,6 +89,8 @@
         chain = null;
         contextLength = 0;
         securityInterceptor = null;
+        welcomeFiles = null;
+
     }
 
     public JettyWebAppContext(URI uri,
@@ -164,7 +167,7 @@
         setListenerClassNames(listenerClassNames);
         setDistributable(distributable);
         setMimeMap(mimeMap);
-        setWelcomeFiles(welcomeFiles);
+        this.welcomeFiles = welcomeFiles;
         setLocaleEncodingMapping(localeEncodingMapping);
         setErrorPages(errorPages);
         setAuthenticator(authenticator);
@@ -237,6 +240,8 @@
         } finally {
             leaveContextScope(null, null, context);
         }
+        //super.doStart sets welcomefiles to null!!
+        setWelcomeFiles(welcomeFiles);
 
         log.info("JettyWebAppContext started");
     }

Mime
View raw message