membersound wrote
> What is the T5 equivalent to the following JSF?
> 
> class Person {}
> 
> class SigninPage {
>   @Inject
>   Person person;
> }
> 
> If I try this in tapestry, I'm getting:
> org.apache.tapestry5.runtime.ComponentEventException
> Error obtaining injected value for field person: No service implements the
> interface Person.
> 
> What do I have to change to use this kind of injection in T5?

You need to define Person as a service in your module: 

public static void bind(ServiceBinder binder) {
  binder.bind(Person.class);
}

But why do you want to define a value object (Person seems to be one) as a
service?

I think the better way is to just define it as a member of your page:

class SigninPage {
  @Property
  private Person person;
}

You find more about services and injection in the docs: 
http://tapestry.apache.org/ioc-cookbook-basic-services-and-injection.html



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Inject-managed-beans-tp5717346p5717368.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to