I have a Wicket Page with a @SpringBean
class ScreenDetailsPage(parameters: PageParameters) extends BasePage(parameters) {
@SpringBean(name = "screenDAO") protected var screenDao: DAO[Screen] = null
assertNotNull(screenDao)
and I find that the @SpringBean is not populated. It makes no difference if screenDao is val or var, protected or private.
Looking up the tree I find that the constructor of Component (indirectly) initialises @SpringBeans on behalf of its subclasses, but then the assignment to null is uninitializing it. But the assignment is required by Scala.
How can I prevent this behaviour?
Try
I have not tried this, but am also thinking about starting a Wicket/Scala project, and saw this blog entry, which might be useful in other ways as well.
The relevant section quoted from that blog is