[jboss-user] [JBoss Seam] - Re: How to run a page action only once? or How to maintain t

Delphi's Ghost do-not-reply at jboss.com
Tue Jun 26 02:11:55 EDT 2007


If I'm understanding the problem right, you could put the initialization code into a @Create annotated method which would be called when when the backing bean is created as long as the backing bean is used only with this page. I think you would have to make the bean conversational scope, and run the page within the conversational scope. I must admit I don't fully understand the page scope. I think in page scope it creates and destroys the bean each time. (I still don't get the differences between page and even scopes).

Another option might be simply to outject a flag into the conversational scope using something like :



  | 
  | @In @Out(Scope=CONVERSATION)
  | private Boolean isPrepared;
  | 

Set this flag in your initialization scope and it will be passed in and out of the bean on each action. I think this could work, but I'm not sure. 

Of course then you can access the #{isPrepared} value from your page navigation logic if you still need it. 

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

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



More information about the jboss-user mailing list