> Eelco, I realized that you are recommending using Spring or looking up the > bean on the fly some other way but I am working for a place where Spring is > not part of the "approved" stack and they have an established way that > access to EJB's is coded.
Not really. I mean a @SpringBean *construct*, like you can find in the Spring integration project. That project generates proxies for every @SpringBean annot found. These proxies are light and serializable, and internally hold a transient reference to the actual spring bean. When serialized, the spring bean instance is discarded; the proxy will locate it again when it is called. You said you can't use annotations, so that trick wouldn't go here for you. There used to be a project[1] (now only for 1.2.x) that used commons attributes[2] for the same purpose, but we're not maintaining it for 1.3 anymore (though it is stored as a wicket-stuff project now[3]). Alternatively, you can just locate the bean just in time. Are you sure you need to keep a reference to it in your component(s)? And consider that *if* you need a reference, it's probably per-request (so you'll want a new one when a new request starts). If that is true, you can just set the reference lazily (get it when you actually access it), and null it in the components onDetach method (override that method; it will be called when a request is handled) so that it won't be serialized. Eelco [1] http://svn.apache.org/repos/asf/incubator/wicket/branches/wicket-1.2.x/wicket-spring-annot [2] http://jakarta.apache.org/commons/attributes/ [3] https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-spring-cattr ------------------------------------------------------------------------- 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