简体   繁体   中英

Where can I learn about JNDI strings?

How do you know how to form a JNDI string? I know there must be a format and that the divisions must mean something but I haven't been able to find a good resource that explains them. For example: java:comp/env/wm/default . This is supposed to connect to a WorkManager in Websphere with the name of default. But what does the "java", "comp", "env" mean? I know what the wm/default mean because that's the JNDI name put in the WorkManager, but what does the rest mean?

Thanks

The "java:" scheme was introduced in J2EE for accessing process-local data. The "comp" context is short for "component"; it contains data that is local to the J2EE component (web module or EJB type) that is active on the current thread. The "env" subcontext is short for "environment"; it is the context under which EJB references, resource references, and environment entries are bound. The "wm/default" is an arbitrary name. The "wm" subcontext name is the convention for work managers, but the full name could have also been "java:comp/env/myDefaultWM", where web.xml/ejb-jar.xml defined a resource-ref with <res-ref-name>myDefaultWM<res-ref-name>.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM