0

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.

Somu
  • 3,593
  • 6
  • 34
  • 44

1 Answers1

0

You can't use resource injection but have to use programmatic lookup

new InitialContext().lookup(dynamicName)
Philippe Marschall
  • 4,452
  • 1
  • 34
  • 52