roger- i would factor the Database injection for your DAO to use getSessionFactory to acquire factory which contains Hibernate dataSource (which contains startup Database parameters) http://www.java2s.com/Code/Java/Hibernate/SpringDaoInjection.htm
other solutions? Martin Gainty ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Tue, 3 Nov 2009 14:49:07 +0200 > Subject: Re: Struts 2 Spring Plugin Usage > From: roger.var...@googlemail.com > To: user@struts.apache.org > > > > > I use the convention plugin for Struts and I take advantage of the > > spring auto wiring (by name) to automagically inject my service layer. > > You can do the same for the rest. Check out the reference guide over at > > spring framework to do so. Weirdly I like having my DAO and Service > > classes in the appcontext xml file.. But then that is because I am > > weird... > > > > Either I'm misunderstanding the responses or I'm not being clear (I'm > also using the convention plugin along with the Spring plugin.) > > <bean id="securityManager" class="com.myApp.security.PasswordChecker" > /> is sufficient to have the PasswordChecker injected everywhere any > action contains a getSecurityManager() method. > > However if my PasswordChecker also has need of injection to access a > database (ie. PaswordChecker contains a getDaoManager() method then > simply having > > <bean id="securityManager" class="com.myApp.security.PasswordChecker" /> > <bean id="daoManager" class="com.myApp.security.DaoManager"/> > > in the application.context.xml does not appear to be sufficient. My > action is injected with the PasswordChecker, but the PasswordChecker > is not injected with the DaoManager. > > Regards > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _________________________________________________________________ Hotmail: Trusted email with Microsoft's powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141664/direct/01/ http://clk.atdmt.com/GBL/go/177141664/direct/01/