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/12/02 19:42:15 UTC
svn commit: r600354 - in /myfaces/current12/test-webapp: pom.xml
src/main/java/org/apache/myfaces/blank/HelloWorldBacking.java
src/main/webapp/WEB-INF/web.xml src/main/webapp/helloWorld.jsp
Author: baranda
Date: Sun Dec 2 10:42:09 2007
New Revision: 600354
URL: http://svn.apache.org/viewvc?rev=600354&view=rev
Log:
Attempt to reproduce MYFACES-1765 (h:selectOneMenu doesn't call setter) - but couldn't reproduce, it works
Modified:
myfaces/current12/test-webapp/pom.xml
myfaces/current12/test-webapp/src/main/java/org/apache/myfaces/blank/HelloWorldBacking.java
myfaces/current12/test-webapp/src/main/webapp/WEB-INF/web.xml
myfaces/current12/test-webapp/src/main/webapp/helloWorld.jsp
Modified: myfaces/current12/test-webapp/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/current12/test-webapp/pom.xml?rev=600354&r1=600353&r2=600354&view=diff
==============================================================================
--- myfaces/current12/test-webapp/pom.xml (original)
+++ myfaces/current12/test-webapp/pom.xml Sun Dec 2 10:42:09 2007
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<parent>
<artifactId>myfaces-base</artifactId>
<groupId>org.apache.myfaces</groupId>
@@ -83,20 +85,55 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>myfaces</id>
+ <activation>
+ <property>
+ <name>!jsf</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>1.2.1-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>1.2.1-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>jsf-ri</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>ri</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_04</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_04</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-api</artifactId>
- <version>1.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-impl</artifactId>
- <version>1.2.0</version>
- <scope>compile</scope>
- </dependency>
- <!--
+
+ <!--
<dependency>
<groupId>org.apache.myfaces.tomahawk</groupId>
<artifactId>tomahawk</artifactId>
@@ -165,6 +202,11 @@
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.12</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
</dependency>
</dependencies>
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?rev=600354&r1=600353&r2=600354&view=diff
==============================================================================
--- 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 Sun Dec 2 10:42:09 2007
@@ -24,8 +24,10 @@
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
import java.util.Arrays;
import java.util.List;
+import java.util.ArrayList;
/**
* A typical simple backing bean, that is backed to <code>helloworld.jsp</code>
@@ -42,11 +44,17 @@
private Double testDouble;
private List<String> numbers = Arrays.asList(new String[] {"One", "Two", "Three"});
+ private List<SelectItem> numbersToSelect;
/**
* default empty constructor
*/
public HelloWorldBacking(){
greeting = "Hello";
+
+ numbersToSelect = new ArrayList<SelectItem>();
+ for (String strNum : numbers) {
+ numbersToSelect.add(new SelectItem(strNum));
+ }
}
@PostConstruct()
@@ -94,5 +102,13 @@
public void updateGreeting(ActionEvent evt)
{
greeting = "Bye!";
+ }
+
+ public List<SelectItem> getNumbersToSelect() {
+ return numbersToSelect;
+ }
+
+ public void setNumbersToSelect(List<SelectItem> numbersToSelect) {
+ this.numbersToSelect = numbersToSelect;
}
}
Modified: myfaces/current12/test-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/current12/test-webapp/src/main/webapp/WEB-INF/web.xml?rev=600354&r1=600353&r2=600354&view=diff
==============================================================================
--- myfaces/current12/test-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/current12/test-webapp/src/main/webapp/WEB-INF/web.xml Sun Dec 2 10:42:09 2007
@@ -152,9 +152,9 @@
-->
<!-- Listener, to allow Jetty serving MyFaces apps -->
- <listener>
- <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
- </listener>
+ <!--<listener>-->
+ <!--<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>-->
+ <!--</listener> -->
<!-- Faces Servlet -->
<servlet>
@@ -175,14 +175,14 @@
<welcome-file>index.html</welcome-file>
</welcome-file-list>
- <env-entry>
- <env-entry-name>testDouble</env-entry-name>
- <env-entry-type>java.lang.Double</env-entry-type>
- <env-entry-value>0.99</env-entry-value>
- <injection-target>
- <injection-target-class>org.apache.myfaces.blank.HelloWorldBacking</injection-target-class>
- <injection-target-name>testDouble</injection-target-name>
- </injection-target>
- </env-entry>
+ <env-entry>
+ <env-entry-name>testDouble</env-entry-name>
+ <env-entry-type>java.lang.Double</env-entry-type>
+ <env-entry-value>0.99</env-entry-value>
+ <injection-target>
+ <injection-target-class>org.apache.myfaces.blank.HelloWorldBacking</injection-target-class>
+ <injection-target-name>testDouble</injection-target-name>
+ </injection-target>
+ </env-entry>
</web-app>
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?rev=600354&r1=600353&r2=600354&view=diff
==============================================================================
--- myfaces/current12/test-webapp/src/main/webapp/helloWorld.jsp (original)
+++ myfaces/current12/test-webapp/src/main/webapp/helloWorld.jsp Sun Dec 2 10:42:09 2007
@@ -29,6 +29,19 @@
<h:messages />
+ <hr/>
+
+ <h:selectOneMenu value="#{lala}" onchange="submit();">
+ <f:selectItem itemLabel="Choose One" itemValue="choose_one"/>
+ <f:selectItems value="#{helloWorldBacking.numbersToSelect}" />
+ </h:selectOneMenu>
+
+ <br/>
+
+ <h:outputText value="Number selected in the menu: #{lala}"/>
+
+ <hr/>
+
</h:form>
</f:view>
</body>