![]() |
| |||||||||||||
A repository of notes and comments that will eventually make their way into the documentation. Please treat the information here with caution, it has often not been verified.
Find web-app directory from JNDI bean?In generic Servlet we can use ServletContext.getRealPath() to get real webapp's directory. And then we can use that to load configuration files. But, suppose there is a JavaBean used via <resource-ref> tag in web.xml, is there anyway for the Bean to get the webapp's context directory? I hope not to hardcode the path in the web.xml. Mattias Jiderhamn writes: I solved a similar problem by having a load-on-startup servlet that in its init() puts the application root in another JNDI reference, like this:
| ||||||||||||||