I think as a WorkAround is to get the beans yourself from the Spring context insteads of relying on the @SpringBean annotation
On Thu, Oct 7, 2010 at 10:51 AM, Mauro Ciancio [via Apache Wicket] < ml-node+2966817-1959417264-65...@n4.nabble.com<ml-node%2b2966817-1959417264-65...@n4.nabble.com> > wrote: > Hi, > > > Why are you using prototype scope anyway? > > In order to get a new fresh instance every time is requested. > > > AFAIR the once the bean is looked up from spring it is being cached by > > AnnotProxyFieldValueFactory itself. > > > > So using prototype scope will not work anyway: either way you always get > a > > fresh bean (so you cannot keep state) or you will always get the same > bean > > (even worse if the bean is stateful). > > > > You probably should convert your code to using singleton beans and pass > > appropriate state from wicket component itself. > > OK, I understand, that explains my issue. However, I have a bean that > is stateful and the state cannot be sent by wicket componets (more > precisely it's a bean that provides the local date and local time, and > it's cached in a field so every time you invoke it, it returns the > same date). > > So, I'm getting the same date when I navigate through a stateful page. > > Is there any another workaround or the only way out is not to keep the > date cached? > > Thanks for the replies. > Regards. > -- > Mauro Ciancio > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=2966817&i=0> > For additional commands, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=2966817&i=1> > > > > ------------------------------ > View message @ > http://apache-wicket.1842946.n4.nabble.com/Bean-injection-tp2966113p2966817.html > To start a new topic under Apache Wicket, email > ml-node+1842946-398011874-65...@n4.nabble.com<ml-node%2b1842946-398011874-65...@n4.nabble.com> > To unsubscribe from Apache Wicket, click > here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>. > > > -- Sincerely, JC (http://www.linkedin.com/in/jcgarciam) Work smarter, not harder!. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Bean-injection-tp2966113p2966851.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org