Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 51217 invoked from network); 29 Sep 2010 08:55:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Sep 2010 08:55:13 -0000 Received: (qmail 65982 invoked by uid 500); 29 Sep 2010 08:55:13 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 65891 invoked by uid 500); 29 Sep 2010 08:55:12 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 65785 invoked by uid 99); 29 Sep 2010 08:55:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Sep 2010 08:55:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Sep 2010 08:55:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3D0C123889BB; Wed, 29 Sep 2010 08:54:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1002525 [1/2] - in /geronimo/server/trunk/plugins: j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/ jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/ jetty8/geronimo-jetty8... Date: Wed, 29 Sep 2010 08:54:48 -0000 To: scm@geronimo.apache.org From: djencks@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100929085448.3D0C123889BB@eris.apache.org> Author: djencks Date: Wed Sep 29 08:54:47 2010 New Revision: 1002525 URL: http://svn.apache.org/viewvc?rev=1002525&view=rev Log: GERONIMO-5624 better default web app merging, and make jetty use more of the info tree Removed: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/StartupOrderComparatorTest.java Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/StandardWebAppInfoFactory.java geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/history/dependencies.xml geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml geronimo/server/trunk/plugins/tomcat/tomcat7-deployer/src/main/plan/plan.xml Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/StandardWebAppInfoFactory.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/StandardWebAppInfoFactory.java?rev=1002525&r1=1002524&r2=1002525&view=diff ============================================================================== --- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/StandardWebAppInfoFactory.java (original) +++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/StandardWebAppInfoFactory.java Wed Sep 29 08:54:47 2010 @@ -21,6 +21,9 @@ package org.apache.geronimo.web25.deployment; import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import org.apache.geronimo.web.info.FilterInfo; import org.apache.geronimo.web.info.SecurityConstraintInfo; @@ -44,18 +47,53 @@ public class StandardWebAppInfoFactory e @Override public void complete(WebAppInfo webAppInfo) { for (ServletInfo servletInfo : defaultWebAppInfo.servlets) { - webAppInfo.servlets.add(copy(servletInfo)); + if (noServlet(servletInfo.servletName, webAppInfo.servlets)) { + webAppInfo.servlets.add(copy(servletInfo)); + } } for (FilterInfo filterInfo : defaultWebAppInfo.filters) { - webAppInfo.filters.add(copy(filterInfo)); + if (noFilter(filterInfo.filterName, webAppInfo.filters)) { + webAppInfo.filters.add(copy(filterInfo)); + } } webAppInfo.listeners.addAll(defaultWebAppInfo.listeners); - webAppInfo.contextParams.putAll(defaultWebAppInfo.contextParams); - webAppInfo.contextRoot = defaultWebAppInfo.contextRoot; + + for (Map.Entry entry: defaultWebAppInfo.contextParams.entrySet()) { + if (!webAppInfo.contextParams.containsKey(entry.getKey())) { + webAppInfo.contextParams.put(entry.getKey(), entry.getValue()); + } + + } for (SecurityConstraintInfo securityConstraintInfo : defaultWebAppInfo.securityConstraints) { webAppInfo.securityConstraints.add(copy(securityConstraintInfo)); } webAppInfo.securityRoles.addAll(defaultWebAppInfo.securityRoles); + if (webAppInfo.welcomeFiles.isEmpty()) { + webAppInfo.welcomeFiles.addAll(defaultWebAppInfo.welcomeFiles); + } + webAppInfo.errorPages.addAll(defaultWebAppInfo.errorPages); + for (Map.Entry entry: defaultWebAppInfo.mimeMappings.entrySet()) { + if (!webAppInfo.mimeMappings.containsKey(entry.getKey())) { + webAppInfo.mimeMappings.put(entry.getKey(), entry.getValue()); + } + } + } + + private boolean noServlet(String servletName, List servlets) { + for (ServletInfo servletInfo: servlets) { + if (servletName.equals(servletInfo.servletName)) { + return false; + } + } + return true; + } + private boolean noFilter(String filterName, List filters) { + for (FilterInfo filterInfo: filters) { + if (filterName.equals(filterInfo.filterName)) { + return false; + } + } + return true; } @Override Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java?rev=1002525&r1=1002524&r2=1002525&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java (original) +++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java Wed Sep 29 08:54:47 2010 @@ -17,16 +17,12 @@ package org.apache.geronimo.jetty8.deployment; -import static java.lang.Boolean.FALSE; -import static java.lang.Boolean.TRUE; - import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.Serializable; import java.net.URI; import java.net.URL; -import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -36,7 +32,6 @@ import java.util.Map; import java.util.jar.JarFile; import javax.xml.bind.JAXBException; - import org.apache.geronimo.common.DeploymentException; import org.apache.geronimo.deployment.Deployable; import org.apache.geronimo.deployment.DeployableBundle; @@ -88,6 +83,7 @@ import org.apache.geronimo.security.jaas import org.apache.geronimo.security.jacc.ComponentPermissions; import org.apache.geronimo.web.WebAttributeName; import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter; +import org.apache.geronimo.web.info.LoginConfigInfo; import org.apache.geronimo.web.info.ServletInfo; import org.apache.geronimo.web.info.WebAppInfo; import org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder; @@ -103,15 +99,10 @@ import org.apache.geronimo.xbeans.geroni import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppDocument; import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType; import org.apache.geronimo.xbeans.geronimo.web.jetty.config.GerJettyDocument; -import org.apache.openejb.jee.ErrorPage; -import org.apache.openejb.jee.FormLoginConfig; import org.apache.openejb.jee.JaxbJavaee; import org.apache.openejb.jee.LocaleEncodingMapping; import org.apache.openejb.jee.LocaleEncodingMappingList; -import org.apache.openejb.jee.LoginConfig; -import org.apache.openejb.jee.MimeMapping; import org.apache.openejb.jee.WebApp; -import org.apache.openejb.jee.WelcomeFileList; import org.apache.xbean.osgi.bundle.util.BundleUtils; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlObject; @@ -122,6 +113,9 @@ import org.osgi.service.packageadmin.Pac import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static java.lang.Boolean.FALSE; +import static java.lang.Boolean.TRUE; + /** * @version $Rev:385659 $ $Date$ */ @@ -160,22 +154,15 @@ public class JettyModuleBuilder extends protected final NamespaceDrivenBuilderCollection clusteringBuilders; - private final List defaultWelcomeFiles; private final Integer defaultSessionTimeoutSeconds; - private final Map defaultLocaleEncodingMappings; - private final Map defaultMimeTypeMappings; private static final String JETTY_NAMESPACE = JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI(); public JettyModuleBuilder(@ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment, @ParamAttribute(name = "defaultSessionTimeoutSeconds") Integer defaultSessionTimeoutSeconds, - @ParamAttribute(name = "defaultWelcomeFiles") List defaultWelcomeFiles, @ParamAttribute(name = "jettyContainerObjectName") AbstractNameQuery jettyContainerName, @ParamAttribute(name = "defaultWebApp") WebAppInfo defaultWebApp, @ParamAttribute(name = "jspServlet") WebAppInfo jspServlet, - @ParamAttribute(name = "defaultJspServletName") String defaultJspServletName, - @ParamAttribute(name = "defaultLocaleEncodingMappings") Map defaultLocaleEncodingMappings, - @ParamAttribute(name = "defaultMimeTypeMappings") Map defaultMimeTypeMappings, @ParamReference(name = "PojoWebServiceTemplate", namingType = NameFactory.SERVLET_WEB_SERVICE_TEMPLATE) Object pojoWebServiceTemplate, @ParamReference(name = "WebServiceBuilder", namingType = NameFactory.MODULE_BUILDER) Collection webServiceBuilder, @ParamReference(name = "ClusteringBuilders", namingType = NameFactory.MODULE_BUILDER) Collection clusteringBuilders, @@ -200,9 +187,6 @@ public class JettyModuleBuilder extends this.pojoWebServiceTemplate = getGBeanData(kernel, pojoWebServiceTemplate); this.clusteringBuilders = new NamespaceDrivenBuilderCollection(clusteringBuilders);//, GerClusteringDocument.type.getDocumentElementName()); - this.defaultWelcomeFiles = defaultWelcomeFiles == null ? new ArrayList() : defaultWelcomeFiles; - this.defaultLocaleEncodingMappings = defaultLocaleEncodingMappings == null ? new HashMap() : defaultLocaleEncodingMappings; - this.defaultMimeTypeMappings = defaultMimeTypeMappings == null ? new HashMap() : defaultMimeTypeMappings; ServiceReference sr = bundleContext.getServiceReference(PackageAdmin.class.getName()); } @@ -536,20 +520,8 @@ public class JettyModuleBuilder extends configureNoClustering(moduleContext, webModuleData); } - // configure mime mappings. - configureMimeMappings(webApp, webModuleData); - - // configure welcome file lists. - configureWelcomeFileLists(webApp, webModuleData); - - // configure local encoding mapping lists. - configureLocaleEncodingMappingLists(webApp, webModuleData); - - // configure error pages. - configureErrorPages(webApp, webModuleData); - // configure login configs. - configureAuthentication(module, webApp, jettyWebApp, webModuleData); + configureAuthentication(module, webAppInfo.loginConfig, jettyWebApp, webModuleData); if (jettyWebApp.isSetSecurityRealmName()) { configureSecurityRealm(earContext, webApp, jettyWebApp, bundle, webModuleData); @@ -629,14 +601,10 @@ public class JettyModuleBuilder extends } - private void configureAuthentication(Module module, WebApp webApp, JettyWebAppType jettyWebApp, GBeanData webModuleData) throws DeploymentException, GBeanAlreadyExistsException { + private void configureAuthentication(Module module, LoginConfigInfo loginConfigInfo, JettyWebAppType jettyWebApp, GBeanData webModuleData) throws DeploymentException, GBeanAlreadyExistsException { EARContext moduleContext = module.getEarContext(); - List loginConfigs = webApp.getLoginConfig(); - if (loginConfigs.size() > 1) { - throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element. Currently has " + loginConfigs.size() + " login-config elements."); - } JettyAuthenticationType authType = jettyWebApp.getAuthentication(); - if (loginConfigs.size() == 1 || authType != null || jettyWebApp.isSetSecurityRealmName()) { + if (loginConfigInfo != null || authType != null || jettyWebApp.isSetSecurityRealmName()) { AbstractName factoryName = moduleContext.getNaming().createChildName(module.getModuleName(), "securityHandlerFactory", GBeanInfoBuilder.DEFAULT_J2EE_TYPE); webModuleData.setReferencePattern("SecurityHandlerFactory", factoryName); @@ -651,24 +619,22 @@ public class JettyModuleBuilder extends configureLocalJaspicProvider(new JettyAuthenticationWrapper(authType), contextPath, module, securityFactoryData); //otherwise rely on pre-configured jaspi } else { - LoginConfig loginConfig = loginConfigs.size() == 1 ? loginConfigs.get(0) : null; GBeanData securityFactoryData = new GBeanData(factoryName, JettySecurityHandlerFactory.class); - configureConfigurationFactory(jettyWebApp, loginConfig, securityFactoryData); + configureConfigurationFactory(jettyWebApp, loginConfigInfo, securityFactoryData); BuiltInAuthMethod auth = BuiltInAuthMethod.NONE; - if (loginConfig != null) { - if (loginConfig.getAuthMethod() != null) { - String authMethod = loginConfig.getAuthMethod().trim(); + if (loginConfigInfo != null) { + if (loginConfigInfo.authMethod != null) { + String authMethod = loginConfigInfo.authMethod.trim(); auth = BuiltInAuthMethod.getValueOf(authMethod); if (auth == BuiltInAuthMethod.BASIC) { - securityFactoryData.setAttribute("realmName", loginConfig.getRealmName()); + securityFactoryData.setAttribute("realmName", loginConfigInfo.realmName); } else if (auth == BuiltInAuthMethod.DIGEST) { - securityFactoryData.setAttribute("realmName", loginConfig.getRealmName()); + securityFactoryData.setAttribute("realmName", loginConfigInfo.realmName); } else if (auth == BuiltInAuthMethod.FORM) { - if (loginConfig.getFormLoginConfig() != null) { - FormLoginConfig formLoginConfig = loginConfig.getFormLoginConfig(); - securityFactoryData.setAttribute("loginPage", formLoginConfig.getFormLoginPage()); - securityFactoryData.setAttribute("errorPage", formLoginConfig.getFormErrorPage()); + if (loginConfigInfo.formLoginPage != null) { + securityFactoryData.setAttribute("loginPage", loginConfigInfo.formLoginPage); + securityFactoryData.setAttribute("errorPage", loginConfigInfo.formErrorPage); } } else if (auth == BuiltInAuthMethod.CLIENTCERT) { //nothing to do @@ -679,8 +645,8 @@ public class JettyModuleBuilder extends } else { throw new DeploymentException("No auth method configured and no jaspi configured"); } - if (loginConfig.getRealmName() != null) { - webModuleData.setAttribute("realmName", loginConfig.getRealmName()); + if (loginConfigInfo.realmName != null) { + webModuleData.setAttribute("realmName", loginConfigInfo.realmName); } } securityFactoryData.setAttribute("authMethod", auth); @@ -729,69 +695,18 @@ public class JettyModuleBuilder extends } } - private void configureConfigurationFactory(JettyWebAppType jettyWebApp, LoginConfig loginConfig, GBeanData securityFactoryData) { + private void configureConfigurationFactory(JettyWebAppType jettyWebApp, LoginConfigInfo loginConfigInfo, GBeanData securityFactoryData) { String securityRealmName; if (jettyWebApp.isSetSecurityRealmName()) { securityRealmName = jettyWebApp.getSecurityRealmName().trim(); } else { - if (loginConfig == null) return; - securityRealmName = loginConfig.getRealmName().trim(); + if (loginConfigInfo == null) return; + securityRealmName = loginConfigInfo.realmName.trim(); } AbstractNameQuery configurationFactoryName = new AbstractNameQuery(null, Collections.singletonMap("name", securityRealmName), ConfigurationFactory.class.getName()); securityFactoryData.setReferencePattern("ConfigurationFactory", configurationFactoryName); } - private void configureErrorPages(WebApp webApp, GBeanData webModuleData) { - List errorPageArray = webApp.getErrorPage(); - Map errorPageMap = new HashMap(); - for (ErrorPage errorPage : errorPageArray) { - if (errorPage.getErrorCode() != null) { - errorPageMap.put(errorPage.getErrorCode() + "", errorPage.getLocation().trim()); - } else { - errorPageMap.put(errorPage.getExceptionType().trim(), errorPage.getLocation().trim()); - } - } - webModuleData.setAttribute("errorPages", errorPageMap); - } - - private void configureLocaleEncodingMappingLists(WebApp webApp, GBeanData webModuleData) { - List localeEncodingMappingListArray = webApp.getLocaleEncodingMappingList(); - Map localeEncodingMappingMap = new HashMap(defaultLocaleEncodingMappings); - for (LocaleEncodingMappingList aLocaleEncodingMappingListArray : localeEncodingMappingListArray) { - List localeEncodingMappingArray = aLocaleEncodingMappingListArray.getLocaleEncodingMapping(); - for (LocaleEncodingMapping localeEncodingMapping : localeEncodingMappingArray) { - localeEncodingMappingMap.put(localeEncodingMapping.getLocale().trim(), localeEncodingMapping.getEncoding().trim()); - } - } - webModuleData.setAttribute("localeEncodingMapping", localeEncodingMappingMap); - } - - private void configureWelcomeFileLists(WebApp webApp, GBeanData webModuleData) { - List welcomeFileArray = webApp.getWelcomeFileList(); - List welcomeFiles; - if (welcomeFileArray.size() > 0) { - welcomeFiles = new ArrayList(); - for (WelcomeFileList aWelcomeFileArray : welcomeFileArray) { - List welcomeFileList = aWelcomeFileArray.getWelcomeFile(); - for (String welcomeFile : welcomeFileList) { - welcomeFiles.add(welcomeFile.trim()); - } - } - } else { - welcomeFiles = new ArrayList(defaultWelcomeFiles); - } - webModuleData.setAttribute("welcomeFiles", welcomeFiles.toArray(new String[welcomeFiles.size()])); - } - - private void configureMimeMappings(WebApp webApp, GBeanData webModuleData) { - List mimeMappingArray = webApp.getMimeMapping(); - Map mimeMappingMap = new HashMap(defaultMimeTypeMappings); - for (MimeMapping mimeMapping : mimeMappingArray) { - mimeMappingMap.put(mimeMapping.getExtension().trim(), mimeMapping.getMimeType().trim()); - } - webModuleData.setAttribute("mimeMap", mimeMappingMap); - } - private void configureHosts(EARContext earContext, JettyWebAppType jettyWebApp, GBeanData webModuleData) throws GBeanAlreadyExistsException { String[] hosts = jettyWebApp.getHostArray(); for (int i = 0; i < hosts.length; i++) { @@ -816,45 +731,4 @@ public class JettyModuleBuilder extends return JETTY_NAMESPACE; } - static class StartupOrderComparator implements Comparator, Serializable { - /** - * comparator that compares first on the basis of startup order, and then on the lexicographical - * ordering of servlet name. Since the servlet names have a uniqueness constraint, this should - * provide a total ordering consistent with equals. All servlets with no startup order are after - * all servlets with a startup order. - * - * @param s1 first Servlet object - * @param s2 second Servlet object - * @return an int < 0 if o1 precedes o2, 0 if they are equal, and > 0 if o2 preceeds o1. - */ - public int compare(org.apache.openejb.jee.Servlet s1, org.apache.openejb.jee.Servlet s2) { - - // load-on-startup is set for neither. the - // ordering at this point doesn't matter, but we - // should return "0" only if the two objects say - // they are equal - if (s1.getLoadOnStartup() == null && s2.getLoadOnStartup() == null) { - return s1.equals(s2) ? 0 : s1.getServletName().trim().compareTo(s2.getServletName().trim()); - } - - // load-on-startup is set for one but not the - // other. whichever one is set will be "less - // than", i.e. it will be loaded first - if (s1.getLoadOnStartup() != null && s2.getLoadOnStartup() == null) { - return -1; - } - if (s1.getLoadOnStartup() == null && s2.getLoadOnStartup() != null) { - return 1; - } - - // load-on-startup is set for both. whichever one - // has a smaller value is "less than" - int comp = new Integer(s1.getLoadOnStartup()).compareTo(s2.getLoadOnStartup()); - if (comp == 0) { - return s1.getServletName().trim().compareTo(s2.getServletName().trim()); - } - return comp; - } - } - } Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java?rev=1002525&r1=1002524&r2=1002525&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java (original) +++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java Wed Sep 29 08:54:47 2010 @@ -349,13 +349,10 @@ public class JettyModuleBuilderTest exte bundleContext.registerService(PackageAdmin.class.getName(), packageAdmin, null); builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), - Collections.EMPTY_LIST, new AbstractNameQuery(containerName), //new AbstractNameQuery(containerName), new WebAppInfo(), null, - "jsp", null, - null, pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), null, Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java?rev=1002525&r1=1002524&r2=1002525&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java (original) +++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java Wed Sep 29 08:54:47 2010 @@ -145,12 +145,9 @@ public class PlanParsingTest extends Xml bundleContext.registerService(PackageAdmin.class.getName(), packageAdmin, null); builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), - null, jettyContainerObjectName, new WebAppInfo(), null, - "jsp", null, - null, pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), null, Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java?rev=1002525&r1=1002524&r2=1002525&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java (original) +++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java Wed Sep 29 08:54:47 2010 @@ -54,6 +54,7 @@ import org.apache.geronimo.management.ge import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager; import org.apache.geronimo.security.jacc.RunAsSource; import org.apache.geronimo.transaction.GeronimoUserTransaction; +import org.apache.geronimo.web.info.ErrorPageInfo; import org.apache.geronimo.web.info.WebAppInfo; import org.eclipse.jetty.http.MimeTypes; import org.eclipse.jetty.security.SecurityHandler; @@ -103,14 +104,7 @@ public class WebAppContextWrapper implem @ParamAttribute(name = "workDir") String workDir, @ParamAttribute(name = "unshareableResources") Set unshareableResources, @ParamAttribute(name = "applicationManagedSecurityResources") Set applicationManagedSecurityResources, - @ParamAttribute(name = "displayName") String displayName, - @ParamAttribute(name = "contextParamMap") Map contextParamMap, -// @ParamAttribute(name = "listenerClassNames") Collection listenerClassNames, @ParamAttribute(name = "distributable") boolean distributable, - @ParamAttribute(name = "mimeMap") Map mimeMap, - @ParamAttribute(name = "welcomeFiles") String[] welcomeFiles, - @ParamAttribute(name = "localeEncodingMapping") Map localeEncodingMapping, - @ParamAttribute(name = "errorPages") Map errorPages, @ParamAttribute(name = "tagLibMap") Map tagLibMap, @ParamAttribute(name = "compactPath") boolean compactPath, @@ -203,7 +197,7 @@ public class WebAppContextWrapper implem } MimeTypes mimeTypes = new MimeTypes(); - mimeTypes.setMimeMap(mimeMap); + mimeTypes.setMimeMap(webAppInfo.mimeMappings); webAppContext.setMimeTypes(mimeTypes); this.server = server; @@ -228,15 +222,26 @@ public class WebAppContextWrapper implem } //stuff from spec dd - setDisplayName(displayName); - if (contextParamMap != null) { - webAppContext.getInitParams().putAll(contextParamMap); - } + setDisplayName(webAppInfo.displayName); + webAppContext.getInitParams().putAll(webAppInfo.contextParams); webAppContext.setDistributable(distributable); - webAppContext.setWelcomeFiles(welcomeFiles); - setLocaleEncodingMapping(localeEncodingMapping); - setErrorPages(errorPages); - setTagLibMap(tagLibMap); + webAppContext.setWelcomeFiles(webAppInfo.welcomeFiles.toArray(new String[webAppInfo.welcomeFiles.size()])); + for (Map.Entry entry : webAppInfo.localeEncodingMappings.entrySet()) { + this.webAppContext.addLocaleEncoding(entry.getKey(), entry.getValue()); + } + ErrorPageErrorHandler errorHandler = (ErrorPageErrorHandler) this.webAppContext.getErrorHandler(); + for (ErrorPageInfo errorPageInfo: webAppInfo.errorPages) { + if (errorPageInfo.exceptionType != null) { + errorHandler.addErrorPage(errorPageInfo.exceptionType, errorPageInfo.location); + } else { + errorHandler.addErrorPage(errorPageInfo.errorCode, errorPageInfo.location); + } + } + if (tagLibMap != null) { + for (Map.Entry entry : tagLibMap.entrySet()) { + this.webAppContext.setResourceAlias(entry.getKey(), entry.getValue()); + } + } if (!distributable) { setSessionTimeoutSeconds(sessionTimeoutSeconds); @@ -310,40 +315,6 @@ public class WebAppContextWrapper implem log.warn("WebAppContextWrapper failed"); } - //pass through attributes. They should be constructor params - - public void setLocaleEncodingMapping(@ParamAttribute(name = "localeEncodingMapping")Map localeEncodingMap) { - if (localeEncodingMap != null) { - for (Map.Entry entry : localeEncodingMap.entrySet()) { - this.webAppContext.addLocaleEncoding(entry.getKey(), entry.getValue()); - } - } - } - -// public void setListenerClassNames(@ParamAttribute(name = "listenerClassNames")Collection eventListeners) throws ClassNotFoundException, IllegalAccessException, InstantiationException { -// if (eventListeners != null) { -// Collection listeners = new ArrayList(); -// for (String listenerClassName : eventListeners) { -// EventListener listener = (EventListener) newInstance(listenerClassName); -// listeners.add(listener); -// } -// webAppContext.setEventListeners(listeners.toArray(new EventListener[listeners.size()])); -// } -// } - - public void setErrorPages(Map errorPageMap) { - if (errorPageMap != null) { - ((ErrorPageErrorHandler) this.webAppContext.getErrorHandler()).setErrorPages(errorPageMap); - } - } - - public void setTagLibMap(Map tagLibMap) { - if (tagLibMap != null) { - for (Map.Entry entry : tagLibMap.entrySet()) { - this.webAppContext.setResourceAlias(entry.getKey(), entry.getValue()); - } - } - } public void setSessionTimeoutSeconds(int seconds) { this.webAppContext.getSessionHandler().getSessionManager().setMaxInactiveInterval(seconds); Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java?rev=1002525&r1=1002524&r2=1002525&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java (original) +++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java Wed Sep 29 08:54:47 2010 @@ -160,14 +160,8 @@ public class AbstractWebModuleTest exten bundle, null, null, null, - "context", - null, false, null, - null, - null, - null, - null, false, 0, sessionHandlerFactory, Modified: geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/history/dependencies.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/history/dependencies.xml?rev=1002525&r1=1002524&r2=1002525&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/history/dependencies.xml (original) +++ geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/history/dependencies.xml Wed Sep 29 08:54:47 2010 @@ -26,4 +26,29 @@ geronimo-jetty8-builder jar + + org.apache.geronimo.modules + geronimo-web + jar + + + org.apache.geronimo.specs + geronimo-jacc_1.4_spec + jar + + + org.apache.geronimo.specs + geronimo-jaspic_1.0_spec + jar + + + org.apache.geronimo.specs + geronimo-osgi-locator + jar + + + org.apache.xbean + xbean-bundleutils + jar + Modified: geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml?rev=1002525&r1=1002524&r2=1002525&view=diff ============================================================================== --- geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml (original) +++ geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml Wed Sep 29 08:54:47 2010 @@ -22,52 +22,48 @@ 1800 - index.html,index.htm,index.jsp ?name=JettyWebContainer - - ar=ISO-8859-6 - be=ISO-8859-5 - bg=ISO-8859-5 - ca=ISO-8859-1 - cs=ISO-8859-2 - da=ISO-8859-1 - de=ISO-8859-1 - el=ISO-8859-7 - en=ISO-8859-1 - es=ISO-8859-1 - et=ISO-8859-1 - fi=ISO-8859-1 - fr=ISO-8859-1 - hr=ISO-8859-2 - hu=ISO-8859-2 - is=ISO-8859-1 - it=ISO-8859-1 - iw=ISO-8859-8 - ja=Shift_JIS - ko=EUC-KR - lt=ISO-8859-2 - lv=ISO-8859-2 - mk=ISO-8859-5 - nl=ISO-8859-1 - no=ISO-8859-1 - pl=ISO-8859-2 - pt=ISO-8859-1 - ro=ISO-8859-2 - ru=ISO-8859-5 - sh=ISO-8859-5 - sk=ISO-8859-2 - sl=ISO-8859-2 - sq=ISO-8859-2 - sr=ISO-8859-5 - sv=ISO-8859-1 - tr=ISO-8859-9 - uk=ISO-8859-5 - zh=GB2312 - zh_TW=Big5 - - - wsdl=text/xml - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -104,6 +100,730 @@ / + + index.html + index.htm + index.jsp + + + abs + audio/x-mpeg + + + ai + application/postscript + + + aif + audio/x-aiff + + + aifc + audio/x-aiff + + + aiff + audio/x-aiff + + + aim + application/x-aim + + + art + image/x-jg + + + asf + video/x-ms-asf + + + asx + video/x-ms-asf + + + au + audio/basic + + + avi + video/x-msvideo + + + avx + video/x-rad-screenplay + + + bcpio + application/x-bcpio + + + bin + application/octet-stream + + + bmp + image/bmp + + + body + text/html + + + cdf + application/x-cdf + + + cer + application/x-x509-ca-cert + + + class + application/java + + + cpio + application/x-cpio + + + csh + application/x-csh + + + css + text/css + + + dib + image/bmp + + + doc + application/msword + + + dtd + application/xml-dtd + + + dv + video/x-dv + + + dvi + application/x-dvi + + + eps + application/postscript + + + etx + text/x-setext + + + exe + application/octet-stream + + + gif + image/gif + + + gtar + application/x-gtar + + + gz + application/x-gzip + + + hdf + application/x-hdf + + + hqx + application/mac-binhex40 + + + htc + text/x-component + + + htm + text/html + + + html + text/html + + + hqx + application/mac-binhex40 + + + ief + image/ief + + + jad + text/vnd.sun.j2me.app-descriptor + + + jar + application/java-archive + + + java + text/plain + + + jnlp + application/x-java-jnlp-file + + + jpe + image/jpeg + + + jpeg + image/jpeg + + + jpg + image/jpeg + + + js + text/javascript + + + jsf + text/plain + + + jspf + text/plain + + + kar + audio/x-midi + + + latex + application/x-latex + + + m3u + audio/x-mpegurl + + + mac + image/x-macpaint + + + man + application/x-troff-man + + + mathml + application/mathml+xml + + + me + application/x-troff-me + + + mid + audio/x-midi + + + midi + audio/x-midi + + + mif + application/x-mif + + + mov + video/quicktime + + + movie + video/x-sgi-movie + + + mp1 + audio/x-mpeg + + + mp2 + audio/x-mpeg + + + mp3 + audio/x-mpeg + + + mp4 + video/mp4 + + + mpa + audio/x-mpeg + + + mpe + video/mpeg + + + mpeg + video/mpeg + + + mpega + audio/x-mpeg + + + mpg + video/mpeg + + + mpv2 + video/mpeg2 + + + ms + application/x-wais-source + + + nc + application/x-netcdf + + + oda + application/oda + + + + odb + application/vnd.oasis.opendocument.database + + + + odc + application/vnd.oasis.opendocument.chart + + + + odf + application/vnd.oasis.opendocument.formula + + + + odg + application/vnd.oasis.opendocument.graphics + + + + odi + application/vnd.oasis.opendocument.image + + + + odm + application/vnd.oasis.opendocument.text-master + + + + odp + application/vnd.oasis.opendocument.presentation + + + + ods + application/vnd.oasis.opendocument.spreadsheet + + + + odt + application/vnd.oasis.opendocument.text + + + + otg + application/vnd.oasis.opendocument.graphics-template + + + + oth + application/vnd.oasis.opendocument.text-web + + + + otp + application/vnd.oasis.opendocument.presentation-template + + + + ots + application/vnd.oasis.opendocument.spreadsheet-template + + + + ott + application/vnd.oasis.opendocument.text-template + + + + ogx + application/ogg + + + ogv + video/ogg + + + oga + audio/ogg + + + ogg + audio/ogg + + + spx + audio/ogg + + + flac + audio/flac + + + anx + application/annodex + + + axa + audio/annodex + + + axv + video/annodex + + + xspf + application/xspf+xml + + + pbm + image/x-portable-bitmap + + + pct + image/pict + + + pdf + application/pdf + + + pgm + image/x-portable-graymap + + + pic + image/pict + + + pict + image/pict + + + pls + audio/x-scpls + + + png + image/png + + + pnm + image/x-portable-anymap + + + pnt + image/x-macpaint + + + ppm + image/x-portable-pixmap + + + ppt + application/vnd.ms-powerpoint + + + pps + application/vnd.ms-powerpoint + + + ps + application/postscript + + + psd + image/x-photoshop + + + qt + video/quicktime + + + qti + image/x-quicktime + + + qtif + image/x-quicktime + + + ras + image/x-cmu-raster + + + rdf + application/rdf+xml + + + rgb + image/x-rgb + + + rm + application/vnd.rn-realmedia + + + roff + application/x-troff + + + rtf + application/rtf + + + rtx + text/richtext + + + sh + application/x-sh + + + shar + application/x-shar + + + + smf + audio/x-midi + + + sit + application/x-stuffit + + + snd + audio/basic + + + src + application/x-wais-source + + + sv4cpio + application/x-sv4cpio + + + sv4crc + application/x-sv4crc + + + svg + image/svg+xml + + + svgz + image/svg+xml + + + swf + application/x-shockwave-flash + + + t + application/x-troff + + + tar + application/x-tar + + + tcl + application/x-tcl + + + tex + application/x-tex + + + texi + application/x-texinfo + + + texinfo + application/x-texinfo + + + tif + image/tiff + + + tiff + image/tiff + + + tr + application/x-troff + + + tsv + text/tab-separated-values + + + txt + text/plain + + + ulw + audio/basic + + + ustar + application/x-ustar + + + vxml + application/voicexml+xml + + + xbm + image/x-xbitmap + + + xht + application/xhtml+xml + + + xhtml + application/xhtml+xml + + + xls + application/vnd.ms-excel + + + xml + application/xml + + + xpm + image/x-xpixmap + + + xsl + application/xml + + + xslt + application/xslt+xml + + + xul + application/vnd.mozilla.xul+xml + + + xwd + image/x-xwindowdump + + + vsd + application/x-visio + + + wav + audio/x-wav + + + + wbmp + image/vnd.wap.wbmp + + + + wml + text/vnd.wap.wml + + + + wmlc + application/vnd.wap.wmlc + + + + wmls + text/vnd.wap.wmlscript + + + + wmlscriptc + application/vnd.wap.wmlscriptc + + + wmv + video/x-ms-wmv + + + wrl + x-world/x-vrml + + + wspolicy + application/wspolicy+xml + + + Z + application/x-compress + + + z + application/x-compress + + + zip + application/zip + + + wsdl + text/xml + + @@ -135,7 +855,6 @@ - jsp GBeanBuilder