On Mon, 9 Apr 2012 07:24:34 -0700 (PDT)
armhold <[email protected]> wrote:

> I'm thinking of storing the DTO in the user's session as a detached
> entity, and using a model like the following on the various pages:

That is perfectly valid approach, and one that we've been using for
some usecases. However, instead of this:

>         return (T) Session.get().getAttribute(key);

I'd rather use a custom Session subclass with typesafe getters and
setters:

class MySession extends WebSession {
  private MyDTO dtoForFlow;
  public MyDTO getDtoForFlow() {
    return dtoForFlow;
  }

  // ...setter too...

  public static MySession get() {
      return (MySession) Session.get();
  }
}

Alternatively you might want to look at the wicket-seam integration and
use Seam conversations.

Carl-Eric
www.wicketbuch.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to