myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jak...@apache.org
Subject svn commit: r980499 - in /myfaces/current20/test-webapp/webapp: ./ src/main/java/org/apache/myfaces/flash/ src/main/resources/org/apache/myfaces/examples/resource/ src/main/webapp/ src/main/webapp/WEB-INF/
Date Thu, 29 Jul 2010 16:25:14 GMT
Author: jakobk
Date: Thu Jul 29 16:25:14 2010
New Revision: 980499

URL: http://svn.apache.org/viewvc?rev=980499&view=rev
Log:
display the current jsf implementation in home.xhtml + added another flash example

Added:
    myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep1.xhtml   (with props)
    myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep2.xhtml   (with props)
    myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep3.xhtml   (with props)
Modified:
    myfaces/current20/test-webapp/webapp/pom.xml
    myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/flash/HelloWorldFlashBean.java
    myfaces/current20/test-webapp/webapp/src/main/resources/org/apache/myfaces/examples/resource/build.properties
    myfaces/current20/test-webapp/webapp/src/main/webapp/WEB-INF/faces-config.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=980499&r1=980498&r2=980499&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/pom.xml (original)
+++ myfaces/current20/test-webapp/webapp/pom.xml Thu Jul 29 16:25:14 2010
@@ -77,6 +77,13 @@
     </dependencies>
 
     <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+    
         <finalName>test-webapp</finalName>
         <plugins>
             <plugin>
@@ -177,6 +184,9 @@
                     <name>!jsf</name>
                 </property>
             </activation>
+            <properties>
+                <jsfImpl>MyFaces ${jsf-myfaces.version}</jsfImpl>
+            </properties>
             <dependencies>
                 <dependency>
                     <groupId>org.apache.myfaces.core</groupId>
@@ -200,6 +210,9 @@
                     <value>ri</value>
                 </property>
             </activation>
+            <properties>
+                <jsfImpl>Mojarra ${jsf-ri.version}</jsfImpl>
+            </properties>
             <dependencies>
                 <dependency>
                     <groupId>com.sun.faces</groupId>

Modified: myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/flash/HelloWorldFlashBean.java
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/flash/HelloWorldFlashBean.java?rev=980499&r1=980498&r2=980499&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/flash/HelloWorldFlashBean.java
(original)
+++ myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/flash/HelloWorldFlashBean.java
Thu Jul 29 16:25:14 2010
@@ -112,6 +112,29 @@ public class HelloWorldFlashBean {
         
         return "success";
     }
+    
+    public String keepRedirect()
+    {
+        FacesContext facesContext = FacesContext.getCurrentInstance();
+        ExternalContext externalContext = facesContext.getExternalContext();
+        Flash flash = externalContext.getFlash();
+        
+        flash.putNow("name", getName());
+        flash.keep("name");
+        
+        return "flashKeep2.xhtml?faces-redirect=true";
+    }
+    
+    public String keepPostback()
+    {
+        FacesContext facesContext = FacesContext.getCurrentInstance();
+        ExternalContext externalContext = facesContext.getExternalContext();
+        Flash flash = externalContext.getFlash();
+        
+        flash.keep("name"); // does not work here anymore
+        
+        return "flashKeep3.xhtml";
+    }
 
     
     public String back(){

Modified: myfaces/current20/test-webapp/webapp/src/main/resources/org/apache/myfaces/examples/resource/build.properties
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/resources/org/apache/myfaces/examples/resource/build.properties?rev=980499&r1=980498&r2=980499&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/resources/org/apache/myfaces/examples/resource/build.properties
(original)
+++ myfaces/current20/test-webapp/webapp/src/main/resources/org/apache/myfaces/examples/resource/build.properties
Thu Jul 29 16:25:14 2010
@@ -1,4 +1,3 @@
 # Do not edit this file, as it will be completed automatically
 # by maven during the build process
-tomahawk_version=${pom.version}
-jsf_implementation=${jsf_implementation}
+jsfImpl=${jsfImpl}

Modified: myfaces/current20/test-webapp/webapp/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/WEB-INF/faces-config.xml?rev=980499&r1=980498&r2=980499&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/WEB-INF/faces-config.xml Thu Jul
29 16:25:14 2010
@@ -320,6 +320,10 @@
    <base-name>org.apache.myfaces.examples.resource.example_messages</base-name>
    <var>bundle</var>
   </resource-bundle>
+  <resource-bundle>
+     <base-name>org.apache.myfaces.examples.resource.build</base-name>
+     <var>build</var>
+  </resource-bundle>
  </application>
     
 </faces-config>
\ No newline at end of file

Added: myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep1.xhtml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep1.xhtml?rev=980499&view=auto
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep1.xhtml (added)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep1.xhtml Thu Jul 29 16:25:14
2010
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+    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:c="http://java.sun.com/jsp/jstl/core">
+<h:head>
+</h:head>
+<h:body>
+	<h:outputStylesheet name="basic.css" />
+	<h1>Myfaces Examples</h1>
+	<h:form id="mainForm">
+		<h3><h:outputText value="Flash Keep" /></h3>
+		<h:panelGrid columns="2">
+		    <h:outputLabel value="Name" for="name" />
+		    <h:inputText id="name" value="#{helloWorldFlashBean.name}" />
+		</h:panelGrid>
+		<h:commandButton action="#{helloWorldFlashBean.keepRedirect}" 
+		        value="Keep over Redirect" />
+	</h:form>
+</h:body>
+</html>

Propchange: myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep1.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep1.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep2.xhtml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep2.xhtml?rev=980499&view=auto
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep2.xhtml (added)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep2.xhtml Thu Jul 29 16:25:14
2010
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+    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:c="http://java.sun.com/jsp/jstl/core">
+<h:head>
+</h:head>
+<h:body>
+	<h:outputStylesheet name="basic.css" />
+	<h1>Myfaces Examples</h1>
+	<h:form id="mainForm">
+		<h3><h:outputText value="Flash Keep" /></h3>
+		
+		Your name is: #{flash.name} <br/>
+		<h:commandButton action="#{helloWorldFlashBean.keepPostback}" 
+		        value="Do another postback" />
+	</h:form>
+</h:body>
+</html>

Propchange: myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep2.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep2.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep3.xhtml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep3.xhtml?rev=980499&view=auto
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep3.xhtml (added)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep3.xhtml Thu Jul 29 16:25:14
2010
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+    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:c="http://java.sun.com/jsp/jstl/core">
+<h:head>
+</h:head>
+<h:body>
+	<h:outputStylesheet name="basic.css" />
+	<h1>Myfaces Examples</h1>
+	<h:form id="mainForm">
+		<h3><h:outputText value="Flash Keep" /></h3>
+		
+		This is now empty: #{flash.name}
+	</h:form>
+</h:body>
+</html>

Propchange: myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep3.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/current20/test-webapp/webapp/src/main/webapp/flashKeep3.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=980499&r1=980498&r2=980499&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/home.xhtml (original)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/home.xhtml Thu Jul 29 16:25:14 2010
@@ -10,7 +10,9 @@
 <h:body>
     <h:outputStylesheet name="basic.css"/>
 
-    <h1>Myfaces Examples JSF 2.0 Additions</h1>
+    <h1>MyFaces Examples running on #{build.jsfImpl}</h1>
+
+    <h2>Myfaces Examples JSF 2.0 Additions</h2>
     <h:form id="form2">
         <h:panelGrid id="grid" columns="1">
             <h:outputLink value="flash1.jsf">
@@ -25,6 +27,9 @@
             <h:outputLink value="flashg1.jsf">
                 <h:outputText value="Flash using GET" />
             </h:outputLink>
+            <h:outputLink value="flashKeep1.jsf">
+                <h:outputText value="Flash keep()" />
+            </h:outputLink>
             <h:outputLink value="ajax1n.jsf">
                 <h:outputText value="Ajax 1" />
             </h:outputLink>
@@ -43,7 +48,7 @@
         </h:panelGrid>
     </h:form>
         
-    <h1>Myfaces Examples JSF 1.2 Additions</h1>
+    <h2>Myfaces Examples JSF 1.2 Additions</h2>
 	<h:form id="form">
 		<h:panelGrid id="grid" columns="1">
 			<h:outputLink value="helloWorld.jsf">



Mime
View raw message