This content has been marked as final.
Show 4 replies
-
1. Re: how to end and begin conversation on entering page?
babazs May 13, 2010 12:47 PM (in response to deanhiller2000)You should end the conversation when you leave the previous page(rule,endconversation,redirect in the pages.xml), then add begin-conversation in the pages.xml of the new page.
-
2. Re: how to end and begin conversation on entering page?
amitev May 13, 2010 2:29 PM (in response to deanhiller2000)Or use the following workaround
/** * Kills the existing and begins a new long-running conversation. */ protected void endExistingAndStartNewConversation() { String convID = Conversation.instance().getId(); Conversation.instance().leave(); Conversation.instance().begin(); Lifecycle.destroyConversationContext(getSessionMap(), convID); ConversationEntries.instance().removeConversationEntry(convID); } /** * Returns a holding session entries. * * @return the session map. */ private Map<String, Object> getSessionMap() { // this method could be moved to a utility class Map<String, Object> session = new HashMap<String, Object>(); String[] sessionAttributeNames = Contexts.getSessionContext() .getNames(); for (String attributeName : sessionAttributeNames) { session.put(attributeName, Contexts.getSessionContext().get( attributeName)); } return session; }
-
3. Re: how to end and begin conversation on entering page?
yahawari May 13, 2010 2:31 PM (in response to deanhiller2000) -
4. Re: how to end and begin conversation on entering page?
asookazian May 15, 2010 11:59 PM (in response to deanhiller2000)Yes, it's related to that thread. The bottom line on that from PMuir is this:
@End(beforeRedirect=true) for this purpose. No, there is no way to end and start a new conversation without doing a redirect, and no, we aren't planning to implement such a function in core Seam. Someone should write a wiki article showing how to do this, with a custom component :-)