make that bean a prototype?

-igor


On Nov 20, 2007 7:45 AM, thomas jaeckle <[EMAIL PROTECTED]> wrote:
>
> Hi everyone.
> I am trying to manage all of my WebPages via spring.
> Every page is derived from "AbstractIndex" which contains the Border (the
> page layout: header, navigation):
>
> public abstract class AbstractIndex extends WebPage {
>   @SpringBean
>   protected Border border;
>
>   AbstractIndex(PageParameters parameters) {
>     super(parameters);
>
>     assert border!=null : "border is NULL";
>     border.setTransparentResolver(true);
>     add(border);
>   }
> ...
> }
>
> And an example page:
>
> public class PortalPage extends AbstractIndex {
>   public PortalPage(PageParameters parameters) {
>     super(parameters);
>     ...
>   }
> ...
> }
>
> In WicketApplication I have to set the homePage:
>
> public class WicketApplication extends SpringWebApplication {
>   public Class getHomePage() {
>     return PortalPage.class;
>   }
> }
>
>
> Now the problem: I have to initialize all pages lazy (lazy-init="true") in
> the Spring applicationContext, because they can be initialized only when
> WicketApplication is running already in the main-thread.
> But now in WicketApplication the homePage ist set - and the "PortalPage" (in
> this case) has not yet been initialized, so the AssertionError (assert
> border!=null : "border is NULL";) from "AbstractIndex" is thrown.
>
> It is a chicken-egg-problem ... at least I think so.
> Does someone have an idea how to solve this?
>
>
> regards
> Thomas
> --
> View this message in context: 
> http://www.nabble.com/Problems-with-spring-to-manage-all-webpages-tf4844256.html#a13859451
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to