geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r990110 - in /geronimo/server/trunk: plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/ plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ testsuite/
Date Fri, 27 Aug 2010 11:51:01 GMT
Author: rickmcguire
Date: Fri Aug 27 11:51:01 2010
New Revision: 990110

URL: http://svn.apache.org/viewvc?rev=990110&view=rev
Log:
GERONIMO-5227 Add ValidatorFactory to servlet context for JSF usage. 


Modified:
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
    geronimo/server/trunk/testsuite/pom.xml

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java?rev=990110&r1=990109&r2=990110&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
Fri Aug 27 11:51:01 2010
@@ -26,6 +26,9 @@ import java.net.URL;
 import java.util.Enumeration;
 import java.util.EventListener;
 
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
 import javax.servlet.Filter;
 import javax.servlet.Servlet;
 import javax.servlet.ServletException;
@@ -67,6 +70,15 @@ public class GeronimoWebAppContext exten
         setClassLoader(classLoader);
         this.classLoader = classLoader;
         setAttribute(WebApplicationConstants.BUNDLE_CONTEXT_ATTRIBUTE, integrationContext.getBundle().getBundleContext());
+        // now set the module context ValidatorFactory in a context property. 
+        try {
+            javax.naming.Context ctx = integrationContext.getComponentContext();
+            Object validatorFactory = ctx.lookup("comp/ValidatorFactory");
+            setAttribute("javax.faces.validator.beanValidator.ValidatorFactory", validatorFactory);
+        } catch (NamingException e) {
+            setAttribute("javax.faces.validator.beanValidator.ValidatorFactory", e.getMessage());
+            // ignore.  We just don't set the property if it's not available. 
+        }
         this.modulePath = modulePath;
     }
 

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=990110&r1=990109&r2=990110&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
Fri Aug 27 11:51:01 2010
@@ -26,6 +26,7 @@ import java.util.Properties;
 
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
+import javax.naming.NamingException;
 import javax.security.auth.Subject;
 
 import org.apache.catalina.Container;
@@ -286,6 +287,16 @@ public class TomcatContainer implements 
         // set the bundle context attribute in the servlet context
         context.getServletContext().setAttribute(WebApplicationConstants.BUNDLE_CONTEXT_ATTRIBUTE,
                                                  contextInfo.getBundle().getBundleContext());
+        
+        // now set the module context ValidatorFactory in a context property. 
+        try {
+            javax.naming.Context ctx = contextInfo.getJndiContext(); 
+            Object validatorFactory = ctx.lookup("comp/ValidatorFactory");
+            context.getServletContext().setAttribute("javax.faces.validator.beanValidator.ValidatorFactory",
validatorFactory);
+        } catch (NamingException e) {
+            context.getServletContext().setAttribute("javax.faces.validator.beanValidator.ValidatorFactory",
e.getMessage());
+            // ignore.  We just don't set the property if it's not available. 
+        }
 
         // Set the context for the Tomcat implementation
         contextInfo.setContext(context);

Modified: geronimo/server/trunk/testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/pom.xml?rev=990110&r1=990109&r2=990110&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/pom.xml (original)
+++ geronimo/server/trunk/testsuite/pom.xml Fri Aug 27 11:51:01 2010
@@ -40,6 +40,43 @@
         Geronimo integration testsuite.
     </description>
 
+    <!--
+    NOTE: Override the following on the cmdline to only run specific
+          testsuite buckets.
+
+        *** To run all tests:
+          Against the default Jetty assembly -
+            mvn clean install -Pit
+
+          Against the Tomcat assembly - 
+            mvn clean install -Pit -DassemblyId=tomcat
+
+          Against the pre-installed assembly -
+            mvn clean install -Pit -DgeronimoHome=<Path to Geronimo Home>
+          
+          Against an already running server -
+            mvn clean install -Pit-manual
+
+        *** To run one of testsuites:         
+          Against the default Jetty assembly -
+            cd console-testsuite
+            mvn clean install -Pit
+
+          Against the pre-installed assembly -
+            cd console-testsuite
+            mvn clean install -Pit -DgeronimoHome=<Path to Geronimo Home>
+
+          Against an already running server -
+            cd console-testsuite
+            mvn clean install -Pit-manual
+
+        *** To only run one test backet:
+          Against an already running server-
+            cd console-testsuite/advanced
+            mvn clean install -Pchild
+
+    -->
+
     <properties>
         <!--
         NOTE: The default assembly is jetty, so exclude any tomcat tests by



Mime
View raw message