tapestry - @Inject fails to inject a field -
tapestry @inject failing inject service in pojo. service bound way in module...
public static void bind( servicebinder binder ) { ... binder.bind( deviceprofilehelperservice.class, deviceprofilehelperserviceimpl.class ); ... } ...and expected @inject able find down in pojo.
@inject private deviceprofilehelperservice deviceprofilehelpersvc; ... @override public basicdbobject makeentity( string platform, string serialnumber, list<dbobject> configs ) { final basicdbobject response = new basicdbobject( "resp", configs ); // fixme: deviceprofileheplpersvc null here, why? final string bindinguri = deviceprofilehelpersvc.makebinduri( platform, serialnumber ); response.append( "bindinguri", bindinguri ); return response; } ...but happens deviceprofilehelpersvc null when try invoke it. did go wrong? shouldn't @inject able resolve based upon type binder.bind( deviceprofilehelperservice.class, deviceprofilehelperserviceimpl.class ) binding set in module?
i doubt matters, tapestry 5.3.6.
tapestry can @inject services manages. can assume have instantiated "pojo" using "new"
Comments
Post a Comment