You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ja...@apache.org on 2010/12/17 19:59:17 UTC

svn commit: r1050468 - in /myfaces/current20/test-webapp/webapp: pom.xml src/main/java/org/apache/myfaces/viewparam/ src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java src/main/webapp/home.xhtml src/main/webapp/viewparam.xhtml

Author: jakobk
Date: Fri Dec 17 18:59:16 2010
New Revision: 1050468

URL: http://svn.apache.org/viewvc?rev=1050468&view=rev
Log:
MYFACES-3002 FaceletComponsitionContextImpl drops viewParams (example for this issue on test-webapp)

Added:
    myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/
    myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java
    myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml
Modified:
    myfaces/current20/test-webapp/webapp/pom.xml
    myfaces/current20/test-webapp/webapp/src/main/webapp/home.xhtml

Modified: myfaces/current20/test-webapp/webapp/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/pom.xml?rev=1050468&r1=1050467&r2=1050468&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/pom.xml (original)
+++ myfaces/current20/test-webapp/webapp/pom.xml Fri Dec 17 18:59:16 2010
@@ -367,7 +367,7 @@
     <properties>
         <!-- 2.0.3-20100630 -->
         <jsf-ri.version>2.0.3-20100630</jsf-ri.version>
-        <jsf-myfaces.version>2.0.3-SNAPSHOT</jsf-myfaces.version>
+        <jsf-myfaces.version>2.0.4-SNAPSHOT</jsf-myfaces.version>
         <maven.jetty.plugin.version>6.1.16</maven.jetty.plugin.version>
         <log4j.version>1.2.13</log4j.version>
         <cargo.version>1.0</cargo.version>

Added: myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java?rev=1050468&view=auto
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java (added)
+++ myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java Fri Dec 17 18:59:16 2010
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.viewparam;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import java.io.Serializable;
+
+/**
+ * Managed bean for viewparam.xhtml
+ *
+ * @author Jakob Korherr
+ */
+@ManagedBean
+@RequestScoped
+public class RequestViewParamBean implements Serializable
+{
+
+    private String input;
+
+    public String getInput()
+    {
+        return input;
+    }
+
+    public void setInput(String input)
+    {
+        this.input = input;
+    }
+}

Modified: myfaces/current20/test-webapp/webapp/src/main/webapp/home.xhtml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/home.xhtml?rev=1050468&r1=1050467&r2=1050468&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/home.xhtml (original)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/home.xhtml Fri Dec 17 18:59:16 2010
@@ -45,6 +45,9 @@
             <h:outputLink value="commandParams.jsf">
                 <h:outputText value="h:commandButton with f:param" />
             </h:outputLink>
+            <h:outputLink value="viewparam.jsf?input=abc">
+                <h:outputText value="f:viewParam with @RequestScoped bean (test for MYFACES-3002)" />
+            </h:outputLink>
         </h:panelGrid>
     </h:form>
         

Added: myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml?rev=1050468&view=auto
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml (added)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml Fri Dec 17 18:59:16 2010
@@ -0,0 +1,56 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ *
+   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:f="http://java.sun.com/jsf/core"
+	xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<f:metadata>
+    <f:viewParam name="input" value="#{requestViewParamBean.input}" />
+</f:metadata>
+
+<h:head>
+	<title>f:viewParam example for MYFACES-3002</title>
+</h:head>
+<h:body>
+	<h1>f:viewParam example for MYFACES-3002</h1>
+
+    <p>
+        <b>Instructions:</b> Call this page with ?input=abc and it should display "Viewparam: input=abc".
+        Then click the button "Postback" to generate a non-navigation postback to this page and
+        it should still display "Viewparam: input=abc", because the value is stored in the state.
+        However in MyFaces core 2.0.2 and 2.0.3 the view-param value is gone...
+    </p>
+
+	<h:form>
+	   <h:messages id="messages" />
+
+	   <h:outputText id="output" value="Viewparam: input=#{requestViewParamBean.input}" />
+
+       <br />
+
+       <h:commandButton value="Postback" />
+
+	</h:form>
+
+	<ui:debug />
+</h:body>
+</html>