@Named
@RequestScoped
public
class TheBean {
private Foo foo;
private Buzz buzz;
private Bizz bizz;
@Inject
public TheBean(Foo foo, Buzz buzz, Bizz bizz)
{
this.foo = foo;
this.buzz = buzz;
this.bizz = bizz;
}
public void callFooBuzzBizz() {
// do
something with foo, buzz and bizz
}
}
A complete example is available here.
Niciun comentariu :
Trimiteți un comentariu