[jboss-user] [JBoss Seam] - Re: Getting objects from conversation in a custom PhaseListe

JakeC do-not-reply at jboss.com
Mon Jul 9 21:26:54 EDT 2007


OK, I've found out how to get objects from the Context, but I'm still killing the conversation, even though I thought I found a fix for that.

Now, in my try block for getDocument(), I have this:

  | 			DocumentSet docSet = (DocumentSet)Contexts.getConversationContext().get("currentReferral");
  | 			if(attachments != null)
  | 				attachments = docSet.getAttachments();
  | 

My endConversation() now looks like this:

  | 		Manager.instance().leaveConversation();
  | 		Manager.instance().endRequest(ContextAdaptor.getRequest(request));
  | 		Lifecycle.endRequest();
  | 

However, I'm still having the same problem with killing the Conversation.
The second time I try to access one of these links, the Conversation ID has changed, even though the URL has not. The commend for Manager.leaveConversation() says "Leave the scope of the current conversation, leaving it completely intact", but it doesn't work for me.

... Time Passes ...

OK, I've tried another tactic. I've tried NOT being a part of the initial conversation. My URL does NOT have "cid' in it. Instead, I use "tid". I look that value up from the SessionMap and call Manager.restoreConversation() with it. Now I get some really strange results, though.

restoreConversation() always returns true, but I do NOT always end up in the requested conversation! Every other time, I end up with a DIFFERENT conversationID (as returned by Manager.instance().getCurrentConversationId()), and my Contexts.getConversationContext().get() fails on those occasions.

So, I tried resetting it back to adding cid and clr to the original URL, and almost the same thing happened, except that restoreConversation actually returned false when it returned with a different conversation.


  | INFO  [DocumentResource] pathInfo=/src/0
  | INFO  [DocumentResource] restoreConversation to 4=true
  | INFO  [DocumentResource] cid=4
  | INFO  [DocumentResource] pathInfo=/src/0
  | INFO  [DocumentResource] restoreConversation to 4=false
  | INFO  [DocumentResource] cid=8
  | INFO  [DocumentResource] pathInfo=/src/0
  | INFO  [DocumentResource] restoreConversation to 4=true
  | INFO  [DocumentResource] cid=4
  | INFO  [DocumentResource] pathInfo=/src/0
  | INFO  [DocumentResource] restoreConversation to 4=false
  | INFO  [DocumentResource] cid=10
  | INFO  [DocumentResource] pathInfo=/src/0
  | INFO  [DocumentResource] restoreConversation to 4=true
  | INFO  [DocumentResource] cid=4
  | INFO  [DocumentResource] pathInfo=/src/0
  | INFO  [DocumentResource] restoreConversation to 4=false
  | INFO  [DocumentResource] cid=12
  | 

This was done by doing +Refresh in the browser (IE 6) once I got an error page. On the occasion that it succeeded, it didn't prompt me to save a file, but actually returned the binary data in the browser.

I could really use some help on preserving the Conversation Context. :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062223#4062223

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062223



More information about the jboss-user mailing list