My application code receives the JNDI name to look up at runtime. Hence, the JNDI name may not be configured beforehand in web.xml
or in the @Resource
annotation. How may I lookup an Object in such a scenario? Application is running on Tomcat 7.
Asked
Active
Viewed 322 times
1 Answers
0
You can't use resource injection but have to use programmatic lookup
new InitialContext().lookup(dynamicName)

Philippe Marschall
- 4,452
- 1
- 34
- 52