You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2006/11/07 22:03:58 UTC

svn commit: r472261 - in /myfaces/tomahawk/trunk/sandbox: core/src/main/java/org/apache/myfaces/custom/conversation/ core/src/main/tld/ core/src/main/tld/entities/ examples/src/main/java/org/apache/myfaces/examples/conversation/ examples/src/main/webap...

Author: imario
Date: Tue Nov  7 13:03:57 2006
New Revision: 472261

URL: http://svn.apache.org/viewvc?view=rev&rev=472261
Log:
allow to elevate beans to conversation scope within a startConversation tag,
introduced ConversatinBeanElevator interface so a user can plugin a custom bean finder e.g. to be able to deal with aliased beans

Added:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationBeanElevator.java   (with props)
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/DefaultConversationBeanElevator.java   (with props)
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/startConversation.jsp   (with props)
Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/AbstractConversationActionListener.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/Conversation.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIConversation.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIStartConversation.java
    myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/standard_conversation_attributes.xml
    myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld
    myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/conversation/WizardController.java
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/home.jsp
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/wizardPage3.jsp

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/AbstractConversationActionListener.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/AbstractConversationActionListener.java?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/AbstractConversationActionListener.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/AbstractConversationActionListener.java Tue Nov  7 13:03:57 2006
@@ -20,14 +20,18 @@
 import javax.faces.event.AbortProcessingException;
 import javax.faces.event.ActionEvent;
 import javax.faces.event.ActionListener;
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
 
 /**
  * base class to handle actions events
  * @author imario@apache.org 
  */
-public abstract class AbstractConversationActionListener implements ActionListener, Serializable
+public abstract class AbstractConversationActionListener implements ActionListener, StateHolder
 {
 	private String conversationName;
+
+	private transient boolean isTransient;
 	
 	public AbstractConversationActionListener()
 	{
@@ -49,6 +53,31 @@
 	public void setConversationName(String conversationName)
 	{
 		this.conversationName = conversationName;
+	}
+
+
+	public Object saveState(FacesContext context)
+	{
+		return new Object[]
+		{
+			conversationName
+		};
+	}
+
+	public void restoreState(FacesContext context, Object state)
+	{
+		Object[] states = (Object[]) state;
+		conversationName = (String) states[0];
+	}
+
+	public boolean isTransient()
+	{
+		return isTransient;
+	}
+
+	public void setTransient(boolean newTransientValue)
+	{
+		isTransient = newTransientValue;
 	}
 
 	public void processAction(ActionEvent actionEvent) throws AbortProcessingException

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/Conversation.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/Conversation.java?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/Conversation.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/Conversation.java Tue Nov  7 13:03:57 2006
@@ -56,9 +56,8 @@
 	 * Add the given valueBinding to the context map. <br/>
 	 * This will also resolve the value of the binding.
 	 */
-	public void putBean(FacesContext context, ValueBinding vb)
+	public void putBean(FacesContext context, String name, Object value)
 	{
-		String name = ConversationUtils.extractBeanName(vb);
 		if (name.indexOf('.') > -1)
 		{
 			throw new IllegalArgumentException("you cant put a property under conversation control. name: " + name);
@@ -72,7 +71,7 @@
 		{
 			log.debug("put bean to conversation:" + name + "(bean=" + name + ")");
 		}
-		beans.put(name, vb.getValue(context));
+		beans.put(name, value);
 	}
 
 	/**

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationBeanElevator.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationBeanElevator.java?view=auto&rev=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationBeanElevator.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationBeanElevator.java Tue Nov  7 13:03:57 2006
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.custom.conversation;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * Interface used by the system to instruct the elevator to find and elevate a bean into the
+ * conversation scope 
+ */
+public interface ConversationBeanElevator
+{
+	public void elevateBean(FacesContext context, Conversation conversation, ValueBinding valueBinding);
+}

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationBeanElevator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationBeanElevator.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationBeanElevator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/ConversationManager.java Tue Nov  7 13:03:57 2006
@@ -45,6 +45,7 @@
 
 	private final static String INIT_PERSISTENCE_MANAGER_FACOTRY = "org.apache.myfaces.conversation.PERSISTENCE_MANAGER_FACTORY";
 	private final static String INIT_MESSAGER = "org.apache.myfaces.conversation.MESSAGER";
+	private final static String INIT_BEAN_ELEVATOR = "org.apache.myfaces.conversation.BEAN_ELEVATOR";
 
 	private final static String CONVERSATION_MANAGER_KEY = "org.apache.myfaces.ConversationManager";
 	private final static String CONVERSATION_CONTEXT_REQ = "org.apache.myfaces.ConversationManager.conversationContext";
@@ -53,6 +54,7 @@
 
 	private PersistenceManagerFactory persistenceManagerFactory;
 	private ConversationMessager conversationMessager;
+	private ConversationBeanElevator conversationBeanElevator;
 
 	private final Map conversationContexts = new HashMap();
 
@@ -146,6 +148,9 @@
 		// initialize the messager
 		conversationManager.createMessager();
 
+		// initialize the bean elevator
+		conversationManager.createBeanElevator();
+
 		return conversationManager;
 	}
 
@@ -422,6 +427,40 @@
 	}
 
 	/**
+	 * Create the BeanElevator used to find a bean within the different contexts and elevate it
+	 * into the conversation scope.<br />
+	 * You can configure it in your web.xml using the init parameter named
+	 * <code>org.apache.myfaces.conversation.BEAN_ELEVATOR</code>
+	 */
+	protected void createBeanElevator()
+	{
+		String conversationBeanElevatorName = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(INIT_BEAN_ELEVATOR);
+		if (conversationBeanElevatorName == null)
+		{
+			conversationBeanElevator = new DefaultConversationBeanElevator();
+		}
+		else
+		{
+			try
+			{
+				conversationBeanElevator = (DefaultConversationBeanElevator) ClassUtils.classForName(conversationBeanElevatorName).newInstance();
+			}
+			catch (InstantiationException e)
+			{
+				throw new FacesException("error creating bean elevator: " + conversationBeanElevatorName, e);
+			}
+			catch (IllegalAccessException e)
+			{
+				throw new FacesException("error creating bean elevator: " + conversationBeanElevatorName, e);
+			}
+			catch (ClassNotFoundException e)
+			{
+				throw new FacesException("error creating bean elevator: " + conversationBeanElevatorName, e);
+			}
+		}
+	}
+
+	/**
 	 * Get the persistenceManagerFactory.<br />
 	 * The factory can be configured in your web.xml using the init parameter named
 	 * <code>org.apache.myfaces.conversation.PERSISTENCE_MANAGER_FACTORY</code>
@@ -505,6 +544,15 @@
 				}
 			}
 		}
+	}
+
+
+	/**
+	 * the bean elevator used to get beans int the conversation scope
+	 */
+	public ConversationBeanElevator getConversationBeanElevator()
+	{
+		return conversationBeanElevator;
 	}
 
 	private void writeObject(java.io.ObjectOutputStream out) throws IOException

Added: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/DefaultConversationBeanElevator.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/DefaultConversationBeanElevator.java?view=auto&rev=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/DefaultConversationBeanElevator.java (added)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/DefaultConversationBeanElevator.java Tue Nov  7 13:03:57 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.custom.conversation;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+/**
+ * Simple elevator. Can't deal with aliased beans. 
+ */
+public class DefaultConversationBeanElevator implements ConversationBeanElevator
+{
+	public void elevateBean(FacesContext context, Conversation conversation, ValueBinding valueBinding)
+	{
+		String name = ConversationUtils.extractBeanName(valueBinding);
+
+		conversation.putBean(context, name, valueBinding.getValue(context));
+
+		// remove it from the other contexts
+		context.getExternalContext().getRequestMap().remove(name);
+		context.getExternalContext().getSessionMap().remove(name);
+	}
+}

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/DefaultConversationBeanElevator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/DefaultConversationBeanElevator.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/DefaultConversationBeanElevator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIConversation.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIConversation.java?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIConversation.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIConversation.java Tue Nov  7 13:03:57 2006
@@ -22,6 +22,7 @@
 
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
+import javax.faces.component.UIComponent;
 
 /**
  * add a bean under context control
@@ -38,25 +39,34 @@
 	{
 		super.encodeBegin(context);
 
-		elevateBean(context);
+		UIComponent cmp = getParent();
+		if (cmp instanceof UIStartConversation)
+		{
+			// start conversation should to the work
+			return;
+		}
+
+		if (getName() == null)
+		{
+			throw new IllegalArgumentException("conversation name (attribute name=) required if used outside of startConversation tag");
+		}
+
+		elevateBean(context, getName(), getBeanBinding());
 	}
 
-	public void elevateBean(FacesContext context)
+	ValueBinding getBeanBinding()
 	{
-		ValueBinding vb = getValueBinding("value");
-		String name = ConversationUtils.extractBeanName(vb);
-
-		Conversation conversation = ConversationManager.getInstance().getConversation(getName());
+		return getValueBinding("value");
+	}
+	
+	public static void elevateBean(FacesContext context, String conversationName, ValueBinding valueBinding)
+	{
+		Conversation conversation = ConversationManager.getInstance().getConversation(conversationName);
 		if (conversation == null)
 		{
-			log.debug("no conversation named '" + getName() + "' running - can't elevate bean '" + name);
+			log.debug("no conversation named '" + conversationName + "' running - can't elevate bean '" + valueBinding.getExpressionString());
 			return;
 		}
-
-		conversation.putBean(context, vb);
-
-		// remove it from the other contexts
-		context.getExternalContext().getRequestMap().remove(name);
-		context.getExternalContext().getSessionMap().remove(name);
+		ConversationManager.getInstance().getConversationBeanElevator().elevateBean(context, conversation, valueBinding);
 	}
 }

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIStartConversation.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIStartConversation.java?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIStartConversation.java (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/java/org/apache/myfaces/custom/conversation/UIStartConversation.java Tue Nov  7 13:03:57 2006
@@ -16,6 +16,9 @@
 package org.apache.myfaces.custom.conversation;
 
 import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
 
 import javax.faces.application.ViewHandler;
 import javax.faces.component.UICommand;
@@ -39,11 +42,27 @@
 	public static class ConversationStartAction extends AbstractConversationActionListener
 	{
 		private boolean persistence;
+		private List beanToElevate;
 	    
 		public void doConversationAction(AbstractConversationComponent abstractConversationComponent)
 		{
 			ConversationManager conversationManager = ConversationManager.getInstance();
 			conversationManager.startConversation(getConversationName(), isPersistence());
+
+			if (beanToElevate != null)
+			{
+				FacesContext context = FacesContext.getCurrentInstance();
+
+				Iterator iterBeans = beanToElevate.iterator();
+				while (iterBeans.hasNext())
+				{
+					String vb = (String) iterBeans.next();
+					UIConversation.elevateBean(
+						context,
+						getConversationName(),
+						context.getApplication().createValueBinding(vb));
+				}
+			}
 		}
 
 		public boolean isPersistence()
@@ -55,11 +74,39 @@
 		{
 			this.persistence = persistence;
 		}
+
+		public void addBeanToElevate(String beanBinding)
+		{
+			if (beanToElevate == null)
+			{
+				beanToElevate = new ArrayList();
+			}
+			beanToElevate.add(beanBinding);
+		}
+
+
+		public Object saveState(FacesContext context)
+		{
+			return new Object[]
+			{
+				super.saveState(context),
+				Boolean.valueOf(persistence),
+				beanToElevate
+			};
+		}
+
+		public void restoreState(FacesContext context, Object state)
+		{
+			Object[] states = (Object[]) state;
+			super.restoreState(context, states[0]);
+			persistence = ((Boolean) states[1]).booleanValue();
+			beanToElevate = (List) states[2];
+		}
 	}
 	
-	public void encodeBegin(FacesContext context) throws IOException
+	public void encodeEnd(FacesContext context) throws IOException
 	{
-		super.encodeBegin(context);
+		super.encodeEnd(context);
 		
 		setupConversationSystem(context);
 		
@@ -72,6 +119,18 @@
 				actionListener.setConversationName(getName());
 				actionListener.setPersistence(toBoolean(getPersistence()));
 				command.addActionListener(actionListener);
+
+				Iterator iterChildren = getChildren().iterator();
+				while (iterChildren.hasNext())
+				{
+					Object child = iterChildren.next();
+					if (child instanceof UIConversation)
+					{
+						UIConversation conversation = (UIConversation) child;
+						actionListener.addBeanToElevate(conversation.getBeanBinding().getExpressionString());
+					}
+				}
+
 				inited = true;
 			}
 		}
@@ -139,4 +198,4 @@
 	{
 		this.persistence = persistence;
 	}
-}
+}
\ No newline at end of file

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/standard_conversation_attributes.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/standard_conversation_attributes.xml?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/standard_conversation_attributes.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/tld/entities/standard_conversation_attributes.xml Tue Nov  7 13:03:57 2006
@@ -3,6 +3,6 @@
     <required>true</required>
     <rtexprvalue>false</rtexprvalue>
     <description>
-       the name of the conversation to end
+       the name of the conversation
     </description>
 </attribute>

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld (original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/tld/myfaces_sandbox.tld Tue Nov  7 13:03:57 2006
@@ -1109,7 +1109,15 @@
 		<body-content>JSP</body-content>
 		<description>puts a bean into the conversation context</description>
 
-		&standard_conversation_attributes;
+		<attribute>
+    		<name>name</name>
+    		<required>false</required>
+    		<rtexprvalue>false</rtexprvalue>
+    		<description>
+       		the name of the conversation. Notice: required if tag not as child of startConversation tag.
+    		</description>
+		</attribute>
+
 		&conversation_attributes;
 	</tag>
 	<tag>

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/conversation/WizardController.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/conversation/WizardController.java?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/conversation/WizardController.java (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/conversation/WizardController.java Tue Nov  7 13:03:57 2006
@@ -20,6 +20,11 @@
 
 public class WizardController
 {
+	public String ensureConversationAction()
+	{
+		return "wizardPage1";
+	}
+
 	public String save()
 	{
 		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("data saved"));

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/home.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/home.jsp?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/home.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/home.jsp Tue Nov  7 13:03:57 2006
@@ -17,6 +17,7 @@
             <h:outputText value="Conversation"/>
             <h:panelGrid style="padding-left:25px">
            		<h:outputLink value="pageConversation.jsf" ><f:verbatim>Single page conversation</f:verbatim></h:outputLink>
+				<h:outputLink value="startConversation.jsf" ><f:verbatim>Start a conversation "on command"</f:verbatim></h:outputLink>
            		<h:outputLink value="wizardPage1.jsf" ><f:verbatim>Wizard</f:verbatim></h:outputLink>
             </h:panelGrid>
             

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/startConversation.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/startConversation.jsp?view=auto&rev=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/startConversation.jsp (added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/startConversation.jsp Tue Nov  7 13:03:57 2006
@@ -0,0 +1,61 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
+
+<!--
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+//-->
+
+<html>
+<head>
+<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
+<title>MyFaces - the free JSF Implementation</title>
+<link rel="stylesheet" type="text/css" href="css/basic.css" />
+</head>
+<body>
+<f:view>
+
+<h:outputLink value="home.jsf"><h:outputText value="Menu" /></h:outputLink>
+
+<h:form>
+<h:panelGrid columns="2">
+    <h:outputText value="Enter something into this field: " />
+    <h:inputText value="#{convData.input}" />
+    
+    <h:commandLink value="check value"/>
+
+	<h:panelGrid columns="2">
+		<h:commandLink value="start conversation">
+			<s:startConversation name="pageDemand">
+				<s:conversation value="#{convData}" />
+			</s:startConversation>
+		</h:commandLink>
+		<h:commandLink value="end conversation">
+			<s:endConversation name="pageDemand" />
+		</h:commandLink>
+	</h:panelGrid>
+</h:panelGrid>
+<h:panelGrid columns="1">
+    <h:outputText value="Press 'check value' to issue a new request" />
+	<h:outputText value="Press 'start conversation' to start the conversation (which will elevate the bean)" />
+    <h:outputText value="Press 'end conversation' to simulate a server action AND END the conversation (then your value will be lost)" />
+</h:panelGrid>
+</h:form>
+</f:view>
+</body>
+</html>

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/startConversation.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/startConversation.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/startConversation.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/wizardPage3.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/wizardPage3.jsp?view=diff&rev=472261&r1=472260&r2=472261
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/wizardPage3.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/conversation/wizardPage3.jsp Tue Nov  7 13:03:57 2006
@@ -30,7 +30,7 @@
 <body>
 <f:view>
 
-<s:ensureConversation name="wizard" redirectTo="/conversation/wizardPage1.jsp" />
+<s:ensureConversation name="wizard" action="#{wizardController.ensureConversationAction}" />
 
 <t:htmlTag value="h1">Registration Wizard</t:htmlTag>