[jboss-user] [JBoss Seam] - one method ending conversation or not

codelion do-not-reply at jboss.com
Wed Oct 11 16:48:08 EDT 2006

Let's say I have an action method

  | public String submit() {
  | }

and let's say there is logic in it by which normally I am done with the conversation, but in one case I want to stay in the conversation (e.g. go back to a page to fix up information) and traditional validation can't catch it (e.g. because it needs info from more than one object).

Assume there is important info from the user in a conversation scoped bean.  The @End would throw it out, wouldn't it?

There isn't a way to do this right other than having two separate methonds, one with @End, and the other without.

public String submit() {
  |   // still a chance to decide to stay in the conversation
  |   ...
  |   if (good) {
  |     return done();
  |   }
  |   ...
  | }
  | @End
  | public String done() {
  | }

That's fine, just making sure I got it right.  Call the one with @End only once sure we won't want to stay in the conversation.

Clearly this is easier if using pageflows, and I think we will.

Then a question could be whether one method calling the other method in the same bean will cause all the injection to happen over again, or whether it is smart enough to know it is "in the object" already.  Or should I just ignore that for now, assume it isn't worth worrying about.

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

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

More information about the jboss-user mailing list