myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r929875 - in /myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main: java/org/apache/myfaces/tobago/example/reference/ webapp/WEB-INF/ webapp/reference/
Date Thu, 01 Apr 2010 07:49:31 GMT
Author: lofwyr
Date: Thu Apr  1 07:49:30 2010
New Revision: 929875

URL: http://svn.apache.org/viewvc?rev=929875&view=rev
Log:
clean up sample

Added:
    myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBeanList.java
      - copied, changed from r918040, myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java
Modified:
    myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java
    myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/sheet.jsp

Modified: myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java?rev=929875&r1=929874&r2=929875&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java
Thu Apr  1 07:49:30 2010
@@ -17,10 +17,15 @@ package org.apache.myfaces.tobago.exampl
  * limitations under the License.
  */
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import java.util.Date;
 
 public class SimpleBean {
 
+  private static final Log LOG = LogFactory.getLog(SimpleBean.class);
+
   private int number;
   private String value;
   private Date date;
@@ -31,6 +36,11 @@ public class SimpleBean {
     this.date = new Date();
   }
 
+  public String tick() {
+    LOG.info("SimpleBean was ticked: " + value);
+    return null;
+  }
+  
   public int getNumber() {
     return number;
   }

Copied: myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBeanList.java
(from r918040, myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBeanList.java?p2=myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBeanList.java&p1=myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java&r1=918040&r2=929875&rev=929875&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBeanList.java
Thu Apr  1 07:49:30 2010
@@ -17,41 +17,22 @@ package org.apache.myfaces.tobago.exampl
  * limitations under the License.
  */
 
-import java.util.Date;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
-public class SimpleBean {
+import java.util.ArrayList;
 
-  private int number;
-  private String value;
-  private Date date;
+public class SimpleBeanList extends ArrayList<SimpleBean> {
 
-  public SimpleBean(int number, String value) {
-    this.number = number;
-    this.value = value;
-    this.date = new Date();
-  }
-
-  public int getNumber() {
-    return number;
-  }
-
-  public void setNumber(int number) {
-    this.number = number;
-  }
-
-  public String getValue() {
-    return value;
-  }
-
-  public void setValue(String value) {
-    this.value = value;
-  }
-
-  public Date getDate() {
-    return date;
-  }
+  private static final Log LOG = LogFactory.getLog(SimpleBeanList.class);
 
-  public void setDate(Date date) {
-    this.date = date;
+  public SimpleBeanList() {
+    add(new SimpleBean(1, "One"));
+    add(new SimpleBean(2, "Two"));
+    add(new SimpleBean(3, "Three"));
+    add(new SimpleBean(4, "Four"));
+    add(new SimpleBean(5000000, "Five Million"));
+    
+    LOG.info("Created!");
   }
 }

Modified: myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/WEB-INF/faces-config.xml?rev=929875&r1=929874&r2=929875&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/WEB-INF/faces-config.xml
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/WEB-INF/faces-config.xml
Thu Apr  1 07:49:30 2010
@@ -295,7 +295,13 @@
     <managed-bean-class>org.apache.myfaces.tobago.example.reference.Upload</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>
-  
+
+  <managed-bean>
+    <managed-bean-name>simpleList</managed-bean-name>
+    <managed-bean-class>org.apache.myfaces.tobago.example.reference.SimpleBeanList</managed-bean-class>
+    <managed-bean-scope>request</managed-bean-scope>
+  </managed-bean>
+
   <navigation-rule>
     <navigation-case>
       <from-outcome>reference/intro</from-outcome>

Modified: myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/sheet.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/sheet.jsp?rev=929875&r1=929874&r2=929875&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/sheet.jsp
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/sheet.jsp
Thu Apr  1 07:49:30 2010
@@ -14,23 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 --%>
-<%@ page import="org.apache.myfaces.tobago.example.reference.SimpleBean" %>
-
-<%
-  SimpleBean[] simpleList = (SimpleBean[]) session.getAttribute("simpleList");
-  System.out.println("1" + session.getAttribute("simpleList"));
-  if (simpleList == null) {
-    simpleList = new SimpleBean[]{
-        new SimpleBean(1, "One"),
-        new SimpleBean(2, "Two"),
-        new SimpleBean(3, "Three"),
-        new SimpleBean(4, "Four"),
-        new SimpleBean(5000000, "Five Million")};
-  }
-  session.setAttribute("simpleList", simpleList);
-  System.out.println("2" + session.getAttribute("simpleList"));
-%>
-
 <%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
 <%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>



Mime
View raw message