In the end I settled on a singleton wrapper for the session-scoped bean.
 Not as clean as I'd have liked, but it does the trick and my time budget's
run out. :-)

Yes, I wasn't sure if Spring or Tapestry-Spring was doing the weird thing
there, but it would be really nice if Tapestry would use the same logic as
Spring to inject the 'correct' bean.

Michael

On 18 November 2011 14:10, Jonathan Barker <jonathan.theit...@gmail.com>wrote:

> There is a note on
> http://tapestry.apache.org/integrating-with-spring-framework.html that
> says
> that "you should consider the non-singleton beans to be not injectable.
> Instead, inject the ApplicationContext service and obtain the non-singleton
> beans as needed."
>
> As for "seeing" multiple beans of the same type, Spring itself knows enough
> to inject the proxied bean rather than the bean itself, so perhaps that's
> an enhancement request for tapestry-spring.
>
> JB
>
> On Fri, Nov 18, 2011 at 11:57 AM, Michael Prescott <
> michael.r.presc...@gmail.com> wrote:
>
> > I have a number of managed-by-Spring command objects that need to be
> > injected with the same (or an equivalent) state holder, otherwise yes,
> I'd
> > do exactly that.  And by avoid, I'm not avoiding it like the plague, I
> just
> > liked the brevity of @Inject MyBean and it seemed within reach.
> >
> > On 18 November 2011 11:08, Thiago H. de Paula Figueiredo <
> > thiag...@gmail.com
> > > wrote:
> >
> > > On Fri, 18 Nov 2011 12:51:45 -0200, Michael Prescott <
> > > michael.r.presc...@gmail.com> wrote:
> > >
> > >  I was excited about the possibility of injecting a session-scoped
> Spring
> > >> bean into a dispatcher (since this saves mucking around with
> > >> ApplicationStateManager)
> > >>
> > >
> > > Why avoiding ApplicationStateManager? Quite easy to use and you avoid
> > > using something non-Tapestry for a pure web app problem.
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer,
> > > and instructor
> > > Owner, Ars Machina Tecnologia da Informação Ltda.
> > > http://www.arsmachina.com.br
> > >
> >
>
>
>
> --
> Jonathan Barker
> ITStrategic
>

Reply via email to