if you think about it, your problem comes from the fact that you do not want
to serialize this stateful bean because it has references to other beans
which are not serializable and yet you want to put it into httpsession.

the requirement of anything you put into httpsession is that it _is_
serializable for replication to other server nodes, etc. - unless you use
some nonstandard replication technique.

shale will run into the same limitation. its "dialog" scope is pretty much
the same as making something a field of a page. that field is there while
the page is, and is then cleaned up when the page is not needed. however it
runs into the same limitation because it most likely uses httpsession for
storing that dialog-scoped data and thus you are back to serialization
problem.

now a solution i see is thus. make this bean @Configurable and serializable.
keep all dependencies in transient vars. that way when the bean is
serialized its dependencies are not, and when it is deserialized i think
@Configurable wires in an intercept that will reinject the bean. that way
you get the best of both worlds. makes sense?

-igor

On 6/12/07, Rüdiger Schulz <[EMAIL PROTECTED]> wrote:

1) Convert the bean to a stateless service, and keep the state in another
bean.
2) Make the bean references transient, and re-fetch them manually (i.e.
without DI from spring) after de-serialization.

There is nothing wrong with 1), I use it in other parts of my app. It sure
would be nice to have stateful beans with DI-ed application logic, but 2)
seems very clumsy. However, later in the above thread, someone mentions the
dialog feature of Shale:
http://mail-archives.apache.org/mod_mbox/myfaces-users/200609.mbox/[EMAIL 
PROTECTED]


Maybe something like that could be applied to wicket as well?


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to