In pages.xml, anytime you render the page, even as a result of a user interaction with a
control (i.e. you are staying on the page), the stuff in pages.xml gets executed for the
page each and everytime (for both page flow and conversation tags).The join=true just
hides this fact since it tries to start a conversation on each re-render, but since one is
already started, it just joins it.
Conversations started from <begin-conversation> in pages.xml must have the
join=true, otherwise you get an error on re-renders due to starting a conversation from a
long running conversation, or if nested=true, then you get multiple entries each time you
render.
(Makes you wonder whether that was the plan, and if so, why include two attributes that
can do nothing but blow up the application, unless there is a third option of doing a
redirect as soon as you hit the page and start the conversation?)
It kind of makes conversation control in pages. xml useless. The only benefit it provides
is for RESTful URLs so if the user opens a browser window, and enters the url, as soon as
you hit that page it starts the conversation (without needing @Begin methods and so on).
There are alternative ways of doing this though such as annotating a method in the main
action bean for that page with @Create @Begin.
If you do have <begin-conversation> in pages.xml, set it as join=true, then, when
you navigate through, you need to either put the conversation in the link, or call methods
annotated with @Begin(nested=true) so they can pre-start the conversation that you will
join when you get to the page and the <begin-conversation join=true> is invoked.
Of course, throw page flows into the mix, and things get really interesting, since then
you need to start maintaining two sets of pageflow documents, one for the conversation in
pages.xml, and one for your @Begin annotated conversations. At this point, you should
probably just pick conversation control in methods and bag pages.xml.
At times, Seam seems to suffer from the tool developers myopia on some
conversation/pageflow issues. However, it's still an improvement on doing it
yourself!
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046308#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...