You were probably just mislead by how things work for pages and compoenents,

tapestry does much more to pages and components, like parameter injection
for example.

however for services there  are (as I'm aware) two ways only to inject,
via constructor for autobuilt services, and via builderMethod parameters.
this fact should be better explained in the docs...

for a parameter in a page you must explicitly say @Inject
but for service
 - autobuilt services -  it is default behavior for container to look at
longest constructor
and to try to find a service that matches each constructor parameter type.
 - services built via buildMyService methods, dependancies are all the
parameters of the builder method

Davor Hrg

On 9/14/07, Angelo Chen <[EMAIL PROTECTED]> wrote:
>
>
> Hi Davor,
>
> This works, kind of amazing, I read that section about service, but can't
> find info about this, maybe I'm not reading enough? Thanks,
> A.C.
>
>
> Davor Hrg wrote:
> >
> > declare Session as parameter in you service constructor
> > you dont even need to call any inject annotation ...
> >
> >
> > MyServiceImpl(Session session){
> >   this.session=session;
> > }
> >
> > in your module use:
> >
> >   public static void bind(ServiceBinder binder)
> >   {
> >     binder.bind(MyService.class, MyServiceImpl.class);
> >   }
> >
> >
> >
> >
> > please read this page:
> > http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Hibernate-and-InjectService-tf4440952.html#a12672539
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to