EE JNDI
Last update: 7 Oct 2022
Resource
@Resource(name="xxx") resource;
@Resource(lookup="xxx") resource;
@Resource(name="xxx",lookup="yyy") resource;
The @Resource annotation:
- binds the field
resourceto the namexxxdefined in the Environment Naming Context (ENC,java:comp/env/xxx) of the component; the name parameter refers to the JNDI name (env-entry-namein theejp-jar.xmlfile) - lookup the JNDI resource
yyy