Re: SpringBean in AuthenticatedWebSession
Nice one Sebastiaan. Only now I have to refactor my code :-) On Fri, Feb 29, 2008 at 11:52 AM, Bert Radke <[EMAIL PROTECTED]> wrote: > Thank you, > > while trying the approach from Lars, your answer came in ;) > > > On Fri, Feb 29, 2008 at 11:33 AM, Sebastiaan van Erk > <[EMAIL PROTECTED]> wrote: > > One option is to add: > > > > InjectorHolder.getInjector().inject(this) > > > I should have know this myself, as it came up on this list recently.. > > But now it works, > > Thank you both. > > > > Bert > > - > 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]
Re: SpringBean in AuthenticatedWebSession
Thank you, while trying the approach from Lars, your answer came in ;) On Fri, Feb 29, 2008 at 11:33 AM, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote: > One option is to add: > > InjectorHolder.getInjector().inject(this) > I should have know this myself, as it came up on this list recently.. But now it works, Thank you both. Bert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SpringBean in AuthenticatedWebSession
One option is to add: InjectorHolder.getInjector().inject(this) In your session constructor. Regards, Sebastiaan Bert Radke wrote: Hi List, thanks to the help i received so far here, i managed to load objects through JPA using DAOs. The DAOs get injected just fine using the wicket-spring extension (i used the blog example [1] as a starting point). So this is all fine, but now i tried using the same technique to load and verify a user for login purposes, but the userDao does not get injected. My Session extends AuthenticatedWebSession and is created fine, but no DAO is injected. @SpringBean(name = "userDao") private UserDao dao; the "userDao" is defined in the application.xml just like all the others... Do i have to take any additional steps to get Spring to inject the DAO into the session? [1] http://cwiki.apache.org/WICKET/blog-tutorial.html Thanks in advance for your time. Bert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] smime.p7s Description: S/MIME Cryptographic Signature
Re: SpringBean in AuthenticatedWebSession
If I recall it correctly only Components are injected. A Session is not a Component and therefor not injected. You could pass the UserDao as construtor argument yourself when instantiating you Session class in your newSession method in your WebApplication. Lars On Fri, Feb 29, 2008 at 10:54 AM, Bert Radke <[EMAIL PROTECTED]> wrote: > Hi List, > > thanks to the help i received so far here, i managed to load objects > through JPA using DAOs. > The DAOs get injected just fine using the wicket-spring extension (i > used the blog example [1] > as a starting point). So this is all fine, but now i tried using the > same technique to load and > verify a user for login purposes, but the userDao does not get injected. > > My Session extends AuthenticatedWebSession and is created fine, but no > DAO is injected. > > @SpringBean(name = "userDao") > private UserDao dao; > > the "userDao" is defined in the application.xml just like all the others... > > Do i have to take any additional steps to get Spring to inject the DAO > into the session? > > [1] http://cwiki.apache.org/WICKET/blog-tutorial.html > > Thanks in advance for your time. > Bert > > - > 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]
SpringBean in AuthenticatedWebSession
Hi List, thanks to the help i received so far here, i managed to load objects through JPA using DAOs. The DAOs get injected just fine using the wicket-spring extension (i used the blog example [1] as a starting point). So this is all fine, but now i tried using the same technique to load and verify a user for login purposes, but the userDao does not get injected. My Session extends AuthenticatedWebSession and is created fine, but no DAO is injected. @SpringBean(name = "userDao") private UserDao dao; the "userDao" is defined in the application.xml just like all the others... Do i have to take any additional steps to get Spring to inject the DAO into the session? [1] http://cwiki.apache.org/WICKET/blog-tutorial.html Thanks in advance for your time. Bert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]