Thanks a lot, Jan Can you throw me an example of doing it with the IoC way? We understand somethings about Guice, but not about how Magnolia integrates it
Alberto Soto El 28/08/2012 13:12, Jan Haderka escribió: > > On Aug 28, 2012, at 12:13 PM, Alberto Soto wrote: > >> Hi guys, >> >> We're migrating the code to Magnolia 4.5 and we have some several >> problems. >> In one part of our code, we have a Servlet, and there it's our fist >> battle with IOC >> >> I cannot be able to find the way in how you really instanciate >> through Guice this two components (TemplatingFunctions && >> STKTemplatingFunctions), because we need to get a new way to invoke >> >> *STKUtil.getSite()* >> >> So, this function it's in STKTemplatingFunctions. Can somebody help >> me to get an instance of it in a servlet? > > Components.getComponent(SiteManager.class).getCurrentSite() is > probably what you are looking for, tho using IoC would be really > better solution to your problem. > > HTH, > Jan > > > ------------------------------------------------------------------------ > ---------------------------------------------------------------- > For list details, see http://www.magnolia-cms.com/community/mailing-lists.html > Alternatively, use our forums: http://forum.magnolia-cms.com/ > To unsubscribe, E-mail to: <[email protected]> > ---------------------------------------------------------------- ---------------------------------------------------------------- For list details, see http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <[email protected]> ----------------------------------------------------------------
