I have came across another question on stackoverflow. It seems that in java ee 6 it was impossible to inject beans into struts actions.
I do not know if it is the same in java ee 7, so I tried testing:
@RequestScoped
public class LoginAction extends Action {
@Inject
private UserDao userDao;
...
}
But it didn't work. userDao is null.
So my question is, if it is possible to inject a bean into struts action. If yes then how, if no then why?
Thanx
Aucun commentaire:
Enregistrer un commentaire