Nov 5, 2017

Java EE Predefined Beans available for injection


Predefined BeanResource or CDI BeanInjection Example
UserTransactionResource@Resource UserTransaction transaction;
PrincipalResource@Resource Principal principal;
ValidatorResource@Resource Validator validator;
ValidatorFactoryResource@Resource ValidatorFactory factory;
HttpServletRequestCDI bean@Inject HttpServletRequest req;
HttpSessionCDI bean@Inject HttpSession session;
ServletContextCDI bean@Inject ServletContext context;