I first created a util class so the access to the AppContext is restricted to one class. You access it by using the static method getApplicationContext() in SpringStaticAppContextListener. Then my pages call a static getService method in my util class (my web tier will only access the service layer of my mid-tier). The util class is the one that has the bean names hard-coded so as to contain all Spring related stuff within one class.
--Andrew --- Voors Paul <[EMAIL PROTECTED]> wrote: > Hello Andrew, > (or someone else) > > Method 1 looks nice to me, but there is one thing > not clear to me: how do you access the appContext in > your application? > > I presume that i have toe replace the > ContextLoaderListener class with the > SpringStaticAppContextListener in my web.xml. > > But then? > How can I access the applicationContext in my pages > and application? > > Paul > > > > Andrew Berman (10/04/2005 20:26): > >I've successfully used two different methods for > >getting the ApplicationContext which does not > require > >the weird wiring of beans for the WicketServlet and > >requires no special Application classes. > > > >1. See > >http://forum.springframework.org/viewtopic.php?t=3224 > >Scroll to the bottom. He extends > >ContextLoaderListener and provides a static > reference > >to the AppContext. > > > >2. Use SingletonBeanFactoryLocator or > >ContextSingletonBeanFactoryLocator. The API docs > for > >SingletonBeanFactoryLocator explain exactly how to > do > >it. > > > >Because I currently still have code using Spring > MVC, > >I decided to use #1, so my old code can still > access > >the AppContext as well as my new Wicket code. The > >second method will load up a second instance of the > >AppContext if you are already loading up one > anywhere > >in the app. Anyone have any thoughts on these two > >methods? I think the advantages are that you can > >setup Wicket without any fancy jazz in the > appContext. > > > >--Andrew > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: > >Power Architecture Resource Center: Free content, > downloads, discussions, > >and more. > http://solutions.newsforge.com/ibmarch.tmpl > >_______________________________________________ > >Wicket-user mailing list > >[email protected] > >https://lists.sourceforge.net/lists/listinfo/wicket-user > > Met vriendelijke groet, > > Paul Voors > > function: Java Web Developer > department: Webdevelopment > Company: > ATP - The Advanced Travel Partner > Beechavenue 101 | 1119 RB Schiphol-Rijk | The > Netherlands > P.O. Box 75672 | 1118 ZS Schiphol-Rijk | The > Netherlands > T +31 20 2011363 | F +31 20 2011362 > e-mail: [EMAIL PROTECTED] > www: www.atp.nl > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, > downloads, discussions, > and more. > http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Wicket-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/wicket-user > ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
