You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ba...@apache.org on 2007/04/28 23:52:08 UTC

svn commit: r533432 - in /myfaces/current12/test-webapp/src/main: java/org/apache/myfaces/blank/HelloWorldBacking.java webapp/helloWorld.jsp

Author: baranda
Date: Sat Apr 28 14:52:07 2007
New Revision: 533432

URL: http://svn.apache.org/viewvc?view=rev&rev=533432
Log:
updated test

Modified:
    myfaces/current12/test-webapp/src/main/java/org/apache/myfaces/blank/HelloWorldBacking.java
    myfaces/current12/test-webapp/src/main/webapp/helloWorld.jsp

Modified: myfaces/current12/test-webapp/src/main/java/org/apache/myfaces/blank/HelloWorldBacking.java
URL: http://svn.apache.org/viewvc/myfaces/current12/test-webapp/src/main/java/org/apache/myfaces/blank/HelloWorldBacking.java?view=diff&rev=533432&r1=533431&r2=533432
==============================================================================
--- myfaces/current12/test-webapp/src/main/java/org/apache/myfaces/blank/HelloWorldBacking.java (original)
+++ myfaces/current12/test-webapp/src/main/java/org/apache/myfaces/blank/HelloWorldBacking.java Sat Apr 28 14:52:07 2007
@@ -21,9 +21,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.faces.event.ActionEvent;
 import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
+import javax.faces.event.ActionEvent;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * A typical simple backing bean, that is backed to <code>helloworld.jsp</code>
@@ -38,6 +40,8 @@
     private String greeting;
     @Resource(name="testDouble")
     private Double testDouble;
+
+    private List<String> numbers = Arrays.asList(new String[] {"One", "Two", "Three"});
     /**
      * default empty constructor
      */
@@ -67,6 +71,16 @@
     public void setGreeting(String greeting)
     {
         this.greeting = greeting;
+    }
+
+    public List<String> getNumbers()
+    {
+        return numbers;
+    }
+
+    public void setNumbers(List<String> numbers)
+    {
+        this.numbers = numbers;
     }
 
     /**

Modified: myfaces/current12/test-webapp/src/main/webapp/helloWorld.jsp
URL: http://svn.apache.org/viewvc/myfaces/current12/test-webapp/src/main/webapp/helloWorld.jsp?view=diff&rev=533432&r1=533431&r2=533432
==============================================================================
--- myfaces/current12/test-webapp/src/main/webapp/helloWorld.jsp (original)
+++ myfaces/current12/test-webapp/src/main/webapp/helloWorld.jsp Sat Apr 28 14:52:07 2007
@@ -1,7 +1,6 @@
-<%@ page contentType="application/xhtml+xml" %>
 <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<html>
     <head>
         <title>Hello World</title>
     </head>
@@ -10,13 +9,20 @@
         <f:view>
             <h:form id="form">
               <h:panelGrid id="grid" columns="2">
-                <h:outputText id="output1" value="Please enter your name"/>
-                <h:inputText id="input1" value="#{helloWorldBacking.name}" required="true"/>
                 <h:outputText value="#{helloWorldBacking.greeting}"/>
-                <h:commandButton id="button1" value="press me" action="#{helloWorldBacking.send}"/>
                 <h:commandLink value="Update greeting" actionListener="#{helloWorldBacking.updateGreeting}"/>
-                <h:message id="message1" for="input1"/>
+
               </h:panelGrid>
+
+                <h:dataTable var="num" value="#{helloWorldBacking.numbers}">
+                    <h:column>
+                        <f:facet name="header">
+                            <h:outputText value="Some numbers"/>
+                        </f:facet>
+                        <h:outputText value="#{num}"/>
+                    </h:column>
+                </h:dataTable>
+
             </h:form>
         </f:view>
     </body>