[webbeans-commits] Webbeans SVN: r1806 - in examples/trunk/conversations: WebContent/WEB-INF and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sat Mar 7 15:22:13 EST 2009


Author: pete.muir at jboss.org
Date: 2009-03-07 15:22:12 -0500 (Sat, 07 Mar 2009)
New Revision: 1806

Modified:
   examples/trunk/conversations/WebContent/WEB-INF/faces-config.xml
   examples/trunk/conversations/WebContent/WEB-INF/web.xml
   examples/trunk/conversations/WebContent/home.xhtml
   examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java
Log:
A couple of redirect tests

Modified: examples/trunk/conversations/WebContent/WEB-INF/faces-config.xml
===================================================================
--- examples/trunk/conversations/WebContent/WEB-INF/faces-config.xml	2009-03-07 19:44:42 UTC (rev 1805)
+++ examples/trunk/conversations/WebContent/WEB-INF/faces-config.xml	2009-03-07 20:22:12 UTC (rev 1806)
@@ -1,11 +1,18 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<faces-config version="1.2"
-              xmlns="http://java.sun.com/xml/ns/javaee"
-              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
-    
-    <application>
-        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
-    </application>
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
 
+   <navigation-rule>
+      <from-view-id>/home.xhtml</from-view-id>
+      <navigation-case>
+         <from-outcome>home</from-outcome>
+         <to-view-id>/home.xhtml</to-view-id>
+         <redirect/>
+      </navigation-case>
+   </navigation-rule>
+   
+   <application>
+      <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+   </application>
 </faces-config>

Modified: examples/trunk/conversations/WebContent/WEB-INF/web.xml
===================================================================
--- examples/trunk/conversations/WebContent/WEB-INF/web.xml	2009-03-07 19:44:42 UTC (rev 1805)
+++ examples/trunk/conversations/WebContent/WEB-INF/web.xml	2009-03-07 20:22:12 UTC (rev 1806)
@@ -28,5 +28,16 @@
    <session-config>
       <session-timeout>10</session-timeout>
    </session-config>
+   
+   <filter>
+      <filter-name>Web Beans Conversation Propagation Filter</filter-name>
+      <filter-class>org.jboss.webbeans.servlet.ConversationPropagationFilter</filter-class>
+   </filter>
+   
+   <filter-mapping>
+      <filter-name>Web Beans Conversation Propagation Filter</filter-name>
+      <servlet-name>Faces Servlet</servlet-name>
+      <url-pattern>*.jsf</url-pattern>
+   </filter-mapping>
 
 </web-app>

Modified: examples/trunk/conversations/WebContent/home.xhtml
===================================================================
--- examples/trunk/conversations/WebContent/home.xhtml	2009-03-07 19:44:42 UTC (rev 1805)
+++ examples/trunk/conversations/WebContent/home.xhtml	2009-03-07 20:22:12 UTC (rev 1806)
@@ -12,9 +12,11 @@
 				<h:outputText value="Long-running: #{conversations.conversationList}"/>
 	    		<h:outputText value="Current: #{conversation}"/>
 	    		<h:panelGroup>
-    				<h:commandButton action="#{conversation.begin}" value="begin"/>
+    				<h:commandButton action="#{conversations.begin}" value="begin"/>
+    				<h:commandButton action="#{conversations.beginAndRedirect}" value="beginAndRedirect"/>
     				<h:commandButton action="#{conversations.noop}" value="noop"/>
-    				<h:commandButton action="#{conversation.end}" value="end"/>
+    				<h:commandButton action="#{conversations.noopAndRedirect}" value="noopAndRedirect"/>
+    				<h:commandButton action="#{conversations.end}" value="end"/>
     			   <h:outputLink value="#{facesContext.externalContext.requestContextPath}/home.jsf">Abandon</h:outputLink>
     				<h:commandButton action="#{data.longop}" value="longop"/>
     			</h:panelGroup>

Modified: examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java
===================================================================
--- examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java	2009-03-07 19:44:42 UTC (rev 1805)
+++ examples/trunk/conversations/src/main/java/org/jboss/webbeans/examples/conversations/Conversations.java	2009-03-07 20:22:12 UTC (rev 1806)
@@ -1,5 +1,6 @@
 package org.jboss.webbeans.examples.conversations;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -10,9 +11,6 @@
 import javax.inject.Current;
 import javax.inject.Produces;
 
-import java.io.Serializable;
-
-import org.jboss.webbeans.WebBean;
 import org.jboss.webbeans.conversation.ConversationIdGenerator;
 import org.jboss.webbeans.conversation.ConversationManager;
 import org.jboss.webbeans.conversation.bindings.ConversationInactivityTimeout;
@@ -38,16 +36,33 @@
    {
       return 10000;
    }   
+
+   public String end()
+   {
+      conversation.end();
+      return "home";
+   }
    
-   public void abandon() 
+   public void begin()
    {
-      conversation.begin(id.nextId());
+      conversation.begin();
    }
    
+   public String beginAndRedirect()
+   {
+      conversation.begin();
+      return "home";
+   }
+   
    public void noop()
    {   
    }
    
+   public String noopAndRedirect()
+   {   
+      return "home";
+   }
+   
    public Iterable<Conversation> getConversationList() 
    {
       return conversationManager.getLongRunningConversations(); 




More information about the weld-commits mailing list