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.


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
Wicket-user mailing list

Reply via email to