[jboss-user] [JBoss Seam] - Problem with conversation stack(nested Pageflows blocker)
denis-karpov
do-not-reply at jboss.com
Tue Oct 3 04:47:20 EDT 2006
public class Pageflow implements Serializable {
| ...
| public static Pageflow instance()
| {
| ...
| return (Pageflow) Component.getInstance(Pageflow.class, ScopeType.CONVERSATION, true);
| }
| ...
|
public class Component {
| ...
| public static Object getInstance(String name, ScopeType scope, boolean create)
| {
| Object result = scope.getContext().get(name);
| result = getInstance(name, create, result);
| return result;
| }
| ...
|
public class ServerConversationContext implements Context {
| ...
| public Object get(String name) {
| ...
| LinkedList<String> stack = getIdStack();
| ...
| for ( String id: stack )
| {
| result = session.getAttribute( getKey(name, id) );
| if (result!=null) return result;
| }
| return null;
| ...
| }
|
Using this pattern we can have only one such Component (in this case Pageflow) per Conversation stack. When we ask for a new instance we will get an old one from some parent Conversation.
This is the main thing that prevents using nested Pageflows.
May be it is reasonable to add another option in Component.getInstance() to lookup only in one current Conversation.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975694#3975694
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975694
More information about the jboss-user
mailing list