myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1442929 - in /myfaces/tobago/trunk/tobago-example: ./ tobago-example-addressbook-cdi/ tobago-example-addressbook-cdi/resource/ tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/ tobago-example-addre...
Date Wed, 06 Feb 2013 12:34:13 GMT
Author: lofwyr
Date: Wed Feb  6 12:34:13 2013
New Revision: 1442929

URL: http://svn.apache.org/viewvc?rev=1442929&view=rev
Log:
make sample runnable with websphere 8.5

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-bnd.xmi
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-ext.xml
Removed:
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/resource/
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Log4jUtils.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/Test.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/AppenderModel.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/CategoryModel.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LoggingController.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/logging.xhtml
Modified:
    myfaces/tobago/trunk/tobago-example/pom.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/admin.xhtml

Modified: myfaces/tobago/trunk/tobago-example/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/pom.xml?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-example/pom.xml Wed Feb  6 12:34:13 2013
@@ -243,6 +243,28 @@
     </profile>
 
     <profile>
+      <id>jsf-provided</id>
+      <activation>
+        <property>
+          <name>jsf</name>
+          <value>provided</value>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.myfaces.core</groupId>
+          <artifactId>myfaces-api</artifactId>
+          <version>${myfaces20.version}</version>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.myfaces.core</groupId>
+          <artifactId>myfaces-impl</artifactId>
+          <version>${myfaces20.version}</version>
+        </dependency>
+      </dependencies>
+    </profile>
+
+    <profile>
       <id>myfaces-1.1</id>
       <activation>
         <property>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/pom.xml Wed Feb  6
12:34:13 2013
@@ -24,15 +24,13 @@
   </parent>
   <artifactId>tobago-example-addressbook-cdi</artifactId>
   <packaging>war</packaging>
-  <name>Tobago Example Addressbook CDI</name>
+  <name>Tobago Example Addressbook (Java EE 6)</name>
   <description>A simple, but full functional application with persistence.</description>
 
   <properties>
     <openjpa.version>1.0.4</openjpa.version>
     <openwebbeans.version>1.1.6</openwebbeans.version>
-<!--
     <myfaces-extcdi.version>1.0.5</myfaces-extcdi.version>
--->
   </properties>
   <build>
     <finalName>tobago-example-addressbook-cdi</finalName>
@@ -126,55 +124,74 @@
       <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-jcdi_1.0_spec</artifactId>
       <version>1.0</version>
+      <!-- XXX websphere-provided -->
+        <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-validation_1.0_spec</artifactId>
       <version>1.1</version>
+      <!-- XXX websphere-provided -->
+        <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-atinject_1.0_spec</artifactId>
       <version>1.0</version>
+      <!-- XXX websphere-provided -->
+        <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-interceptor_1.1_spec</artifactId>
       <version>1.0</version>
+      <!-- XXX websphere-provided -->
+        <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-annotation_1.1_spec</artifactId>
       <version>1.0.1</version>
+    <!-- XXX websphere-provided -->
+      <scope>provided</scope>
     </dependency>
 
     <dependency>
       <groupId>org.apache.openwebbeans</groupId>
       <artifactId>openwebbeans-impl</artifactId>
       <version>${openwebbeans.version}</version>
+    <!-- XXX websphere-provided -->
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>javassist</groupId>
       <artifactId>javassist</artifactId>
       <version>3.12.1.GA</version>
+    <!-- XXX websphere-provided -->
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.openwebbeans</groupId>
       <artifactId>openwebbeans-spi</artifactId>
       <version>${openwebbeans.version}</version>
+    <!-- XXX websphere-provided -->
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.openwebbeans</groupId>
       <artifactId>openwebbeans-web</artifactId>
       <version>${openwebbeans.version}</version>
+    <!-- XXX websphere-provided -->
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.openwebbeans</groupId>
       <artifactId>openwebbeans-resource</artifactId>
       <version>${openwebbeans.version}</version>
+      <!-- XXX websphere-provided -->
+        <scope>provided</scope>
     </dependency>
 
-<!--
     <dependency>
       <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
       <artifactId>myfaces-extcdi-core-api</artifactId>
@@ -188,7 +205,6 @@
       <version>${myfaces-extcdi.version}</version>
       <scope>runtime</scope>
     </dependency>
--->
 
 <!-- which repository-->
 <!--
@@ -204,7 +220,13 @@
         <artifactId>tango-icon-theme</artifactId>
         <version>0.8.0</version>
     </dependency>
-   <!-- <dependency>
+    <dependency>
+    	<groupId>org.apache.geronimo.specs</groupId>
+    	<artifactId>geronimo-jpa_3.0_spec</artifactId>
+    	<version>1.1.1</version>
+      <scope>provided</scope>
+    </dependency>
+    <!-- <dependency>
       <groupId>org.apache.openjpa</groupId>
       <artifactId>openjpa</artifactId>
       <version>${openjpa.version}</version>
@@ -237,6 +259,10 @@
           <groupId>ant</groupId>
           <artifactId>ant</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>log4j</groupId>
+          <artifactId>log4j</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
     <!--dependency>
@@ -269,7 +295,6 @@
       <groupId>org.apache.myfaces.tobago</groupId>
       <artifactId>tobago-core</artifactId>
       <version>${project.version}</version>
-      <scope>compile</scope>
       <exclusions>
         <exclusion>
           <groupId>sun.jdk</groupId>
@@ -298,29 +323,53 @@
         </exclusion>
       </exclusions>
     </dependency>
+<!--
     <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
-      <scope>compile</scope>
     </dependency>
+-->
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
+<!--
+      <version>1.7.2</version>
+-->
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+<!--
+      <version>1.7.2</version>
+-->
+    </dependency>
+<!--
+    <dependency>
+      <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
+      &lt;!&ndash; XXX websphere-provided &ndash;&gt;
+        <scope>provided</scope>
     </dependency>
       <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>jcl-over-slf4j</artifactId>
+        &lt;!&ndash; XXX websphere-provided &ndash;&gt;
+          <scope>provided</scope>
     </dependency>
+-->
     <dependency>
       <groupId>org.apache.derby</groupId>
       <artifactId>derby</artifactId>
       <version>10.3.1.4</version>
     </dependency>
     <dependency>
+       <groupId>org.apache.geronimo.specs</groupId>
+       <artifactId>geronimo-servlet_3.0_spec</artifactId>
+       <version>1.0</version>
+       <scope>provided</scope>
+    </dependency>
+<!--
+    <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>jstl</artifactId>
       <exclusions>
@@ -334,40 +383,34 @@
       <groupId>taglibs</groupId>
       <artifactId>standard</artifactId>
     </dependency>
+-->
   </dependencies>
 
   <profiles>
 
     <profile>
-      <id>myfaces-1.2</id>
+      <id>jsf-provided</id>
       <activation>
         <property>
-          <name>!jsf</name>
+          <name>jsf</name>
+          <value>provided</value>
         </property>
       </activation>
       <dependencies>
 
         <dependency>
-          <groupId>org.apache.openwebbeans</groupId>
-          <artifactId>openwebbeans-jsf12</artifactId>
-          <version>${openwebbeans.version}</version>
-        </dependency>
-
-<!--
-        <dependency>
           <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
-          <artifactId>myfaces-extcdi-jsf12-module-api</artifactId>
+          <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
           <version>${myfaces-extcdi.version}</version>
           <scope>compile</scope>
         </dependency>
 
         <dependency>
           <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
-          <artifactId>myfaces-extcdi-jsf12-module-impl</artifactId>
+          <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
           <version>${myfaces-extcdi.version}</version>
           <scope>runtime</scope>
         </dependency>
--->
 
       </dependencies>
     </profile>
@@ -467,68 +510,6 @@
     </profile>
 
     <profile>
-      <id>websphere-provided</id>
-      <activation>
-        <property>
-          <name>jsf</name>
-          <value>websphere-provided</value>
-        </property>
-      </activation>
-      <dependencies>
-<!--
-        <dependency>
-          <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
-          <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
-          <version>${myfaces-extcdi.version}</version>
-          <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-          <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
-          <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
-          <version>${myfaces-extcdi.version}</version>
-          <scope>runtime</scope>
-        </dependency>
--->
-      </dependencies>
-    </profile>
-
-    <profile>
-      <id>mojarra-1.2</id>
-      <activation>
-        <property>
-          <name>jsf</name>
-          <value>mojarra-1.2</value>
-        </property>
-      </activation>
-      <dependencies>
-
-        <dependency>
-          <groupId>org.apache.openwebbeans</groupId>
-          <artifactId>openwebbeans-jsf12</artifactId>
-          <version>${openwebbeans.version}</version>
-        </dependency>
-
-<!--
-        <dependency>
-          <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
-          <artifactId>myfaces-extcdi-jsf12-module-api</artifactId>
-          <version>${myfaces-extcdi.version}</version>
-          <scope>compile</scope>
-        </dependency>
-
-        <dependency>
-          <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
-          <artifactId>myfaces-extcdi-jsf12-module-impl</artifactId>
-          <version>${myfaces-extcdi.version}</version>
-          <scope>runtime</scope>
-        </dependency>
--->
-
-      </dependencies>
-    </profile>
-
-    <profile>
       <id>mojarra-2.0</id>
       <activation>
         <property>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/DerbyShutdownServletContextListener.java
Wed Feb  6 12:34:13 2013
@@ -24,13 +24,10 @@ import org.slf4j.LoggerFactory;
 
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
+import javax.servlet.annotation.WebListener;
 import java.sql.DriverManager;
 
-/*
- * User: bommel
- * Date: Mar 17, 2007
- * Time: 9:18:20 AM
- */
+@WebListener
 public class DerbyShutdownServletContextListener implements ServletContextListener {
 
   private static final Logger LOG = LoggerFactory.getLogger(DerbyShutdownServletContextListener.class);
@@ -39,7 +36,7 @@ public class DerbyShutdownServletContext
 
   }
 
-  // todo: should not be shutted down in case of the "InMemoryAddressDao" alternative
+  // todo: should not be shut down in case of the "InMemoryAddressDao" alternative
 
   public void contextDestroyed(ServletContextEvent servletContextEvent) {
     try {

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/KillSession.java
Wed Feb  6 12:34:13 2013
@@ -23,12 +23,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
 
+@WebServlet("/KillSession")
 public class KillSession extends HttpServlet {
 
   private static final Logger LOG = LoggerFactory.getLogger(KillSession.class);

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
Wed Feb  6 12:34:13 2013
@@ -20,6 +20,7 @@
 package org.apache.myfaces.tobago.example.addressbook.web;
 
 import org.apache.commons.fileupload.FileItem;
+import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.WindowScoped;
 import org.apache.myfaces.tobago.component.UIColumn;
 import org.apache.myfaces.tobago.component.UISheet;
 import org.apache.myfaces.tobago.config.TobagoConfig;
@@ -28,7 +29,6 @@ import org.apache.myfaces.tobago.context
 import org.apache.myfaces.tobago.event.SortActionEvent;
 import org.apache.myfaces.tobago.example.addressbook.Address;
 import org.apache.myfaces.tobago.example.addressbook.AddressDao;
-import org.apache.myfaces.tobago.example.addressbook.JpaAddressDao;
 import org.apache.myfaces.tobago.example.addressbook.Picture;
 import org.apache.myfaces.tobago.model.SheetState;
 import org.apache.myfaces.tobago.util.VariableResolverUtils;
@@ -36,7 +36,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.annotation.PostConstruct;
-import javax.enterprise.context.SessionScoped;
 import javax.faces.application.Application;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIComponent;
@@ -56,7 +55,7 @@ import java.util.List;
 import java.util.Locale;
 
 @Named("controller")
-@SessionScoped
+@WindowScoped
 public class Controller implements Serializable {
 
   private static final Logger LOG = LoggerFactory.getLogger(Controller.class);
@@ -94,10 +93,6 @@ public class Controller implements Seria
   private FileItem uploadedFile;
   private boolean renderFileUploadPopup;
 
-  public Controller() {
-    LOG.info("controller constructor ****************************************************************************************************");
-  }
-
   @PostConstruct
   public void init() {
     FacesContext facesContext = FacesContext.getCurrentInstance();

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java
Wed Feb  6 12:34:13 2013
@@ -19,11 +19,6 @@
 
 package org.apache.myfaces.tobago.example.addressbook.web;
 
-/*
- * Created 03.12.2004 00:08:01.
- * $Id: EmailAddressConverter.java 1368242 2012-08-01 20:47:33Z lofwyr $
- */
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.myfaces.tobago.example.addressbook.EmailAddress;
@@ -32,7 +27,9 @@ import javax.faces.component.UIComponent
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
 
+@FacesConverter(forClass = EmailAddress.class)
 public class EmailAddressConverter implements Converter {
 
   private static final Logger LOG = LoggerFactory.getLogger(EmailAddressConverter.class);
@@ -44,14 +41,12 @@ public class EmailAddressConverter imple
     }
     String[] parts = reference.split("@");
     if (parts == null || parts.length != 2) {
-      throw new ConverterException(MessageUtils.createErrorMessage(
-          "converterEmailParts", facesContext));
+      throw new ConverterException(MessageUtils.createErrorMessage("converterEmailParts",
facesContext));
     }
     return new EmailAddress(reference);
   }
 
-  public String getAsString(
-      FacesContext facesContext, UIComponent component, Object object) {
+  public String getAsString(FacesContext facesContext, UIComponent component, Object object)
{
     return object.toString();
   }
 

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java
Wed Feb  6 12:34:13 2013
@@ -23,29 +23,30 @@ import org.apache.myfaces.tobago.example
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
+import javax.faces.validator.FacesValidator;
 import javax.faces.validator.Validator;
 import javax.faces.validator.ValidatorException;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+@FacesValidator("EmailAddressValidator")
 public class EmailAddressValidator implements Validator {
 
-  private static final String EMAIL_ATOM
-      = "[^()<>@,;:\\\\.\\[\\]\\\"]";
-  private static final String LOCAL_PART_SPEC
-      = EMAIL_ATOM + "+(\\." + EMAIL_ATOM + "+)*";
-  private static final String DOMAIN_SPEC
-      = EMAIL_ATOM + "+(\\." + EMAIL_ATOM + "+)+";
-
-  private static final Pattern LOCAL_PART_PATTERN
-      = Pattern.compile(LOCAL_PART_SPEC);
-  private static final Pattern DOMAIN_PATTERN
-      = Pattern.compile(DOMAIN_SPEC);
+  private static final String EMAIL_ATOM = "[^()<>@,;:\\\\.\\[\\]\\\"]";
+  private static final String LOCAL_PART_SPEC = EMAIL_ATOM + "+(\\." + EMAIL_ATOM + "+)*";
+  private static final String DOMAIN_SPEC = EMAIL_ATOM + "+(\\." + EMAIL_ATOM + "+)+";
 
-  public void validate(
-      FacesContext facesContext, UIComponent uiComponent, Object value)
+  private static final Pattern LOCAL_PART_PATTERN = Pattern.compile(LOCAL_PART_SPEC);
+  private static final Pattern DOMAIN_PATTERN = Pattern.compile(DOMAIN_SPEC);
+
+  public void validate(FacesContext facesContext, UIComponent uiComponent, Object value)
       throws ValidatorException {
-    EmailAddress emailAddress = (EmailAddress) value;
+
+    if (value == null) {
+      return;
+    }
+
+    final EmailAddress emailAddress = (EmailAddress) value;
 
     Matcher matcher = LOCAL_PART_PATTERN.matcher(emailAddress.getLocalPart());
     if (!matcher.matches()) {

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java
Wed Feb  6 12:34:13 2013
@@ -23,8 +23,10 @@ import javax.faces.component.UIComponent
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
 import java.util.Locale;
 
+@FacesConverter(forClass = Locale.class)
 public class LocaleConverter implements Converter {
 
   public Object getAsObject(

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java
Wed Feb  6 12:34:13 2013
@@ -20,19 +20,20 @@
 package org.apache.myfaces.tobago.example.addressbook.web;
 
 import org.apache.commons.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.myfaces.tobago.example.addressbook.Address;
 import org.apache.myfaces.tobago.example.addressbook.Picture;
 import org.apache.myfaces.tobago.servlet.NonFacesRequestServlet;
 import org.apache.myfaces.tobago.util.VariableResolverUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.faces.context.FacesContext;
+import javax.servlet.annotation.WebServlet;
 import javax.servlet.http.HttpServletResponse;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 
-
+@WebServlet("/faces/picture")
 public class PictureServlet extends NonFacesRequestServlet {
   private static final Logger LOG = LoggerFactory.getLogger(PictureServlet.class);
 

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml
Wed Feb  6 12:34:13 2013
@@ -17,11 +17,10 @@
  * limitations under the License.
 -->
 
-<!DOCTYPE faces-config PUBLIC
-    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
-    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-<faces-config>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+              version="2.0">
 
   <application>
      <locale-config>
@@ -41,21 +40,6 @@
     <phase-listener>org.apache.myfaces.tobago.example.addressbook.web.StartupPhaseListener</phase-listener>
   </lifecycle>
 
-  <converter>
-    <converter-for-class>java.util.Locale</converter-for-class>
-    <converter-class>org.apache.myfaces.tobago.example.addressbook.web.LocaleConverter</converter-class>
-  </converter>
-
-  <validator>
-    <validator-id>EmailAddressValidator</validator-id>
-    <validator-class>org.apache.myfaces.tobago.example.addressbook.web.EmailAddressValidator</validator-class>
-  </validator>
-
-  <converter>
-    <converter-for-class>org.apache.myfaces.tobago.example.addressbook.EmailAddress</converter-for-class>
-    <converter-class>org.apache.myfaces.tobago.example.addressbook.web.EmailAddressConverter</converter-class>
-  </converter>
-
   <navigation-rule>
     <navigation-case>
       <from-outcome>editor</from-outcome>

Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-bnd.xmi
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-bnd.xmi?rev=1442929&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-bnd.xmi
(added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-bnd.xmi
Wed Feb  6 12:34:13 2013
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<webappbnd:WebAppBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:webappbnd="webappbnd.xmi"
xmlns:webapplication="webapplication.xmi" xmi:id="WebAppBinding_1" virtualHostName="default_host">
+
+  <!-- Needed for WebSphere 8.5 auto deployment
+       Must match the display-name from the web.xml
+  -->
+
+  <webapp href="WEB-INF/web.xml#A simple address-book demo (Java EE 6)"/>
+</webappbnd:WebAppBinding>

Added: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-ext.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-ext.xml?rev=1442929&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-ext.xml
(added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/ibm-web-ext.xml
Wed Feb  6 12:34:13 2013
@@ -0,0 +1,11 @@
+<web-ext
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns="http://websphere.ibm.com/xml/ns/javaee"
+      xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_0.xsd"
+      version="1.0">
+
+  <!-- Needed for WebSphere 8.5 auto deployment -->
+
+   <context-root uri="/tobago-example-addressbook-cdi"/>
+
+</web-ext>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml
Wed Feb  6 12:34:13 2013
@@ -17,19 +17,16 @@
  * limitations under the License.
 -->
 
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
-    version="2.4">
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+    version="3.0">
 
-  <display-name>A simple addressbook demo with Tobago</display-name>
+  <display-name>A simple address-book demo (Java EE 6)</display-name>
 
   <context-param>
     <param-name>javax.faces.PROJECT_STAGE</param-name>
-<!--
     <param-value>Development</param-value>
--->
-    <param-value>Production</param-value>
   </context-param>
 
   <context-param>
@@ -58,47 +55,10 @@
     <param-value>.xhtml</param-value>
   </context-param>
 
-  <!--  workaround for a bug in Oracle AS (e.g. 10.1.2.0.0)-->
-<!--
-  <listener>
-    <listener-class>org.apache.myfaces.tobago.webapp.TobagoServletContextListener</listener-class>
-  </listener>
--->
-
-  <listener>
-    <listener-class>org.apache.myfaces.tobago.example.addressbook.DerbyShutdownServletContextListener</listener-class>
-  </listener>
-
-    <listener>
-      <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
-    </listener>
-
-  <!-- this is an alternative to the WebBeansConfigurationListener
-       you need it e.g. for Tomcat 5.5 or WebSphere 6.1 (see TOBAGO-1043)
-  -->
-<!--
-    <filter>
-        <filter-name>webbeans</filter-name>
-        <filter-class>org.apache.webbeans.servlet.WebBeansConfigurationFilter</filter-class>
-      </filter>
-
-    <filter-mapping>
-        <filter-name>webbeans</filter-name>
-        <servlet-name>FacesServlet</servlet-name>
-        <dispatcher>REQUEST</dispatcher>
-        <dispatcher>ERROR</dispatcher>
-    </filter-mapping>
-
-    <listener>
-      <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationHttpSessionListener</listener-class>
-    </listener>
--->
-
-<!--
-  <listener>
-    <listener-class>org.apacheExtras.myfaces.codi.addon.openwebbeans.startup.OpenWebBeansAwareConfigurationListener</listener-class>
-  </listener>
--->
+  <context-param>
+    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
+    <param-value>true</param-value>
+  </context-param>
 
   <!-- servlet -->
 
@@ -109,11 +69,6 @@
   </servlet>
 
   <servlet>
-    <servlet-name>PictureServlet</servlet-name>
-    <servlet-class>org.apache.myfaces.tobago.example.addressbook.web.PictureServlet</servlet-class>
-  </servlet>
-
-  <servlet>
     <servlet-name>ResourceServlet</servlet-name>
     <servlet-class>org.apache.myfaces.tobago.servlet.ResourceServlet</servlet-class>
     <init-param>
@@ -123,40 +78,25 @@
     </init-param>
   </servlet>
 
-  <servlet>
-    <servlet-name>KillSessionServlet</servlet-name>
-    <servlet-class>org.apache.myfaces.tobago.example.addressbook.KillSession</servlet-class>
-  </servlet>
-
-  <servlet-mapping>
-    <servlet-name>KillSessionServlet</servlet-name>
-    <url-pattern>/KillSession</url-pattern>
-  </servlet-mapping>
-
   <servlet-mapping>
     <servlet-name>FacesServlet</servlet-name>
     <url-pattern>/faces/*</url-pattern>
   </servlet-mapping>
 
   <servlet-mapping>
-    <servlet-name>PictureServlet</servlet-name>
-    <url-pattern>/faces/picture</url-pattern>
-  </servlet-mapping>
-
-  <servlet-mapping>
     <servlet-name>ResourceServlet</servlet-name>
     <url-pattern>/org/apache/myfaces/tobago/renderkit/*</url-pattern>
   </servlet-mapping>
 
-  <!--servlet-mapping>
+  <servlet-mapping>
     <servlet-name>ResourceServlet</servlet-name>
     <url-pattern>/addressbook-resource/*</url-pattern>
-  </servlet-mapping-->
+  </servlet-mapping>
 
-  <!--servlet-mapping>
+  <servlet-mapping>
     <servlet-name>ResourceServlet</servlet-name>
     <url-pattern>/org/tango-project/*</url-pattern>
-  </servlet-mapping-->
+  </servlet-mapping>
 
   <!-- Welcome File List -->
 

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/admin.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/admin.xhtml?rev=1442929&r1=1442928&r2=1442929&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/admin.xhtml
(original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/addressbook/admin/admin.xhtml
Wed Feb  6 12:34:13 2013
@@ -31,8 +31,7 @@
       <tc:tab label="Memory">
         <ui:include src="memory.xhtml"/>
       </tc:tab>
-      <tc:tab label="Logging">
-        <ui:include src="logging.xhtml"/>
+      <tc:tab label="Logging (removed)" disabled="true">
       </tc:tab>
     </tc:tabGroup>
     <tc:panel>



Mime
View raw message