Re: @SpringBean vs getApplication().getDao()

2009-02-18 Thread Martijn Reuvers
Hey Sergey, As far as I know it should create only a single instance for each spring bean (if they are singletons that is). Thus always the same bean should be injected into your wicket classes. Does this problem occur with the @SpringBean or using the proxy approach? I've been using @SpringBean

RE: @SpringBean vs getApplication().getDao()

2009-02-18 Thread Kai Mütz
Sergey Podatelev mailto:brightnesslev...@gmail.com wrote: Thanks for your insight, Patrick. But I'm stuck in my dumbness: setting the component's fields -- does this mean a new instance of that particular annotated bean is created, or that singleton is accessed somehow (proxy)? Also, it's

Re: @SpringBean vs getApplication().getDao()

2009-02-18 Thread James Carman
-getApplication%28%29.getDao%28%29-tp22061472p22072806.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h

@SpringBean vs getApplication().getDao()

2009-02-17 Thread Sergey Podatelev
Okay, this question might actually be more related to Spring, but I'm completely lost here, and my question on Spring forums usually don't get any replies, so I hope Wicket community might help as it usually does. I'm using JCR, and have a RepositoryDao bean configured in applicationContext.xml.

Re: @SpringBean vs getApplication().getDao()

2009-02-17 Thread Martijn Reuvers
Hello, I am not entirely sure if I understand your question correctly. But I usually use Spring like this: YourDao (either defined in applicationContext.xml or in separate spring-config files, or annotation-driven e.g. with @Repository. The template you mention I usually autowire into the dao so

Re: @SpringBean vs getApplication().getDao()

2009-02-17 Thread James Perry
As far as I am aware, the main internal differential is that annotations provides a quick, safe way to access your spring beans and ensure that the whole container does not get serialized via a proxy. However the magic comes at a cost that it will serial the bean id (as a string) - which can be

Re: @SpringBean vs getApplication().getDao()

2009-02-17 Thread Sergey Podatelev
Okay, thanks for you replies, my question was poorly formulated. There are two issues here. First problem is that I apparently don't understand some very basic principles behind Spring-configured beans handling. I assume that a DAO configured in Spring are created on application deployment,

Re: @SpringBean vs getApplication().getDao()

2009-02-17 Thread Patrick Angeles
-getApplication%28%29.getDao%28%29-tp22061472p22072806.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h

Re: @SpringBean vs getApplication().getDao()

2009-02-17 Thread Sergey Podatelev
as a property of MyApplication which is pulled on ((MyApplication) Application.get()).getRepositoryDao(). Thanks. -- sp -- View this message in context: http://www.nabble.com/%40SpringBean-vs-getApplication%28%29.getDao%28%29-tp22061472p22072806.html Sent from the Wicket - User mailing

Re: getApplication

2007-12-06 Thread Martin Funk
Uwe Schäfer schrieb: Martin Funk schrieb: The Application you declare in the web.xml, so if you want your MyApplication you do it there and no need to fiddle with the getApplication() method. sorry, i did not make myself clear. i do declare my application in the web.xml. thats not what i am

Re: getApplication

2007-12-06 Thread Eelco Hillenius
On Dec 5, 2007 11:32 PM, Uwe Schäfer [EMAIL PROTECTED] wrote: Martin Funk schrieb: The Application you declare in the web.xml, so if you want your MyApplication you do it there and no need to fiddle with the getApplication() method. sorry, i did not make myself clear. i do declare my

Re: getApplication

2007-12-05 Thread Eelco Hillenius
why is it, that i can (and should) override getSession() to get 'my' implementation, @Override public MySession getSession() { return (MySession) super.getSession(); } Actually, if you use Java 5, I think this pattern is nicer: public class MySession extends

Re: getApplication

2007-12-05 Thread Martin Funk
Uwe Schäfer schrieb: Hi why is it, that i can (and should) override getSession() to get 'my' implementation, @Override public MySession getSession() { return (MySession) super.getSession(); } whereas getApplication is unfortunately final. @Override public

Re: getApplication

2007-12-05 Thread Uwe Schäfer
Martin Funk schrieb: The Application you declare in the web.xml, so if you want your MyApplication you do it there and no need to fiddle with the getApplication() method. sorry, i did not make myself clear. i do declare my application in the web.xml. thats not what i am talking about. what i