简体   繁体   中英

@Resource - Difference between attributes name and lookup?

javax.annotation.Resource

What is the difference between attributes " name " and " lookup "? When do you use name and when do you use lookup ? By reading the javadoc I can't understand the difference.

Just as it says name is product specific and is not supported by many application servers. So for now you should use lookup as it should be portable and cross platform. You specify global JNDI of the given resource.

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