https://cwiki.apache.org/WICKET/spring.html

..As per my understanding @SpringBean is to inject context services (like
DAO's etc ..assumed to be SINGLETON's) and puts them in a ThreadLocal to be
available to Wicket Components. Its a convenient way to provide Context to
all Wicket components. The purpose seems clear "Context sharing of
services".
I'd further assume these services to be stateless and also Non-Serializable.
Since its objects in a ThreadLocal, I guess one can also use it for
injecting components in theory. ..I've never tried it that way, if you have
please let me know.

Injecting components on the other hand is about Injecting serialized objects
(which should be replicatable across in a cluster; unlike your DAO's). ..ok,
lets not over complicate it by going that far. But from the problem
described it seems he wants to "Inject Components" not "Services". ..and I
think that is fair.

My point is clear, if you want to "inject" components, then those have to be
in PROTOTYPE scope. "@SpringBean" is just an annotation for convenience but
all the documentation & examples point to it being convenient to provide
"Inject Services" to wicket components not "Injected components". 

One is Stateless the other Stateful and serializable, I think conceptually
that is a big difference.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/instantiate-panels-in-a-spring-bean-tp2946859p2952221.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to