thomas jaeckle wrote:


igor.vaynberg wrote:
make that bean a prototype?

Hm, I don't see the benefit of this. The problem remains:
I can't initialize the pages before the WebApplication is initialized (in
this case I would become a "There is no application attached to current
thread main" Exception). But when I initialize them lazy, they don't get
their attributes injected before Wicket displays the homePage ...

I'd stop right now and think more carefully about what you're doing if I were you. You need a better understanding of why page instances are created in Wicket and why.

It's important to realise that Wicket doesn't currently have a PageFactory type thing - instead we effectively just go getHomePage.newInstance() when the user lands on the home page URL.

Therefore, at the moment, you cannot get Spring to manage all your pages for you.

What's more, you probably don't want to, as this would introduce serialization issues with things like DAO beans, which is specifically why wicket-ioc and wicket-spring/wicket-spring-annot exist in the first place.

Pages are not singletons - they are specific instances created due to hitting a bookmarkable URL or whatever. You don't want to be sharing your Wicket Components (e.g. your Border) across pages, so those shouldn't be singletons either.

Regards,

Al

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to