Hi,

Just to experiment, I removed a bean definition from my spring
configuration files but kept the @SpringBean annotation. What happened
was that a non-null object was still injected (a proxy). Only after
dereferencing it a Null pointer exception occurred.

How about the following behavior to make it more usable:
1. If a bean cannot be found in the spring configuration file, then the
value 'null' should be injected instead of a non-null proxy. The reason
for the proxy has to do with serializing and deserializing pages to
avoid serializing and deserializing objects obtained from spring, so the
current lazy loading behavior is not really needed I guess.
2. The @SpringBean annotation should be extended with a 'mandatory'
attribute, defaulting to false. If the bean is mandatory, then an
exception should be thrown by the injector in case a bean can not be found.

Cheers
  Erik

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to