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

2009-02-18 Thread James Carman
gt;> > >> > Regardless of whether that assumption is correct/incorrect/my-god-rtfm, I >> > still won't understand why default submit button reaction is NPE as it >> > uses >> > same partnershipDao property of AccessPage. >> > >> > Co

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

2009-02-18 Thread Kai Mütz
Sergey Podatelev 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

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 a

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

2009-02-17 Thread Sergey Podatelev
ences of the > > annotation-based approach as opposed to storing DAOs in Application > > object. > > In the latter case it's quite clear that there's a single instance of > > RepositoryDao as a property of MyApplication which is pulled on > > ((MyApplication) Applic

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

2009-02-17 Thread Patrick Angeles
uite clear that there's a single instance of > RepositoryDao as a property of MyApplication which is pulled on > ((MyApplication) Application.get()).getRepositoryDao(). > > Thanks. > > -- > sp > > -- View this message in context: http://www.nabble.com/%4

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, speci

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 cos

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

@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. R

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,

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-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

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 e

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

getApplication

2007-12-05 Thread Uwe Schäfer
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 final A