myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r1072194 - in /myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main: java/org/apache/myfaces/examples/jsf20/converter/ java/org/apache/myfaces/examples/jsf20/listsample/ webapp/converter/
Date Fri, 18 Feb 2011 23:29:35 GMT
Author: gpetracek
Date: Fri Feb 18 23:29:35 2011
New Revision: 1072194

URL: http://svn.apache.org/viewvc?rev=1072194&view=rev
Log:
EXTCDI-127 updated example and minor changes

Modified:
    myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/converter/PojoBean.java
    myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleList.java
    myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleListEntry.java
    myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/webapp/converter/index.xhtml

Modified: myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/converter/PojoBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/converter/PojoBean.java?rev=1072194&r1=1072193&r2=1072194&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/converter/PojoBean.java
(original)
+++ myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/converter/PojoBean.java
Fri Feb 18 23:29:35 2011
@@ -20,8 +20,6 @@ package org.apache.myfaces.examples.jsf2
 
 import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ViewAccessScoped;
 
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
 import javax.inject.Named;
 import java.io.Serializable;
 
@@ -35,12 +33,6 @@ public class PojoBean implements Seriali
 
     private Pojo selectedPojo;
 
-    public Converter getConverter()
-    {
-        // workaround for EXTCDI-127
-        return FacesContext.getCurrentInstance().getApplication().createConverter("pojoConverter");
-    }
-
     public Pojo getSelectedPojo()
     {
         return selectedPojo;

Modified: myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleList.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleList.java?rev=1072194&r1=1072193&r2=1072194&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleList.java
(original)
+++ myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleList.java
Fri Feb 18 23:29:35 2011
@@ -19,13 +19,14 @@
 package org.apache.myfaces.examples.jsf20.listsample;
 
 import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ViewAccessScoped;
+import org.apache.myfaces.extensions.cdi.core.api.logging.Logger;
 
 import javax.annotation.PostConstruct;
 import javax.inject.Named;
+import javax.inject.Inject;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.logging.Logger;
 
 /**
  * backing bean which holds the list of our SampleListEntry beans
@@ -35,8 +36,9 @@ import java.util.logging.Logger;
 public class SampleList implements Serializable
 {
     private static final long serialVersionUID = 5655240534902984821L;
-    
-    private Logger log = Logger.getLogger(SampleList.class.getName());
+
+    @Inject
+    private Logger logger;
 
     /**
      * This just logs a INFO for each bean creation
@@ -44,7 +46,7 @@ public class SampleList implements Seria
     @PostConstruct
     public void init()
     {
-        log.info("SampleList bean got created");
+        logger.info("SampleList bean got created");
     }
     
     public List<Integer> getEntryIds()

Modified: myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleListEntry.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleListEntry.java?rev=1072194&r1=1072193&r2=1072194&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleListEntry.java
(original)
+++ myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/java/org/apache/myfaces/examples/jsf20/listsample/SampleListEntry.java
Fri Feb 18 23:29:35 2011
@@ -19,11 +19,12 @@
 package org.apache.myfaces.examples.jsf20.listsample;
 
 import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ViewAccessScoped;
+import org.apache.myfaces.extensions.cdi.core.api.logging.Logger;
 
 import javax.annotation.PostConstruct;
 import javax.inject.Named;
+import javax.inject.Inject;
 import java.io.Serializable;
-import java.util.logging.Logger;
 
 /**
  * backing bean which holds one single SampleListEntry
@@ -33,8 +34,9 @@ import java.util.logging.Logger;
 public class SampleListEntry implements Serializable
 {
     private static final long serialVersionUID = 723390662860977802L;
-    
-    private Logger log = Logger.getLogger(SampleListEntry.class.getName());
+
+    @Inject
+    private Logger logger;
 
     private Integer id;
     private String value;
@@ -45,7 +47,7 @@ public class SampleListEntry implements 
     @PostConstruct
     public void init()
     {
-        log.info("SampleListEntry bean got created");
+        logger.info("SampleListEntry bean got created");
     }
 
     public Integer getId()

Modified: myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/webapp/converter/index.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/webapp/converter/index.xhtml?rev=1072194&r1=1072193&r2=1072194&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/webapp/converter/index.xhtml
(original)
+++ myfaces/extensions/cdi/trunk/examples/jsf-examples/hello_myfaces-codi_jsf20/src/main/webapp/converter/index.xhtml
Fri Feb 18 23:29:35 2011
@@ -38,7 +38,7 @@
 
         <h:form>
             <!-- converter="pojoConverter" does not work due to EXTCDI-127 -->
-            <h:selectOneMenu converter="#{pojoBean.converter}" value="#{pojoBean.selectedPojo}">
+            <h:selectOneMenu converter="pojoConverter" value="#{pojoBean.selectedPojo}">
                 <f:selectItems value="#{pojoFactory.pojos}" var="pojo" itemValue="#{pojo}"
itemLabel="#{pojo.name}" />
             </h:selectOneMenu>
 



Mime
View raw message