Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

possible to get handle to ServletContext from JNDI java:comp?

Dev Team

2004-05-18


Hi All,
  I’m using OpenJMS embedded in my web-app to handle some IO Tasks and the
IO tasks have to do with folders in the web-app. I mainly looking to get the
fully qualified file system address to the web-app folder which can be done
with ServletConfig.getRealPath(string).

In a servlet I can get a hold of the ServletContext and just get the real
path from the location, however, if I have sent a JMS message and I’m in my
listener class that is responding, is it possible to get a handle back to
the web-apps servlet context? With JNDI or the ClassLoader, etc, etc.  I was
looking at the JNDI namespace java:comp/env and such, but didn’t find a way
to get the ServletContext itself, or the path info I was looking for.  I
guess I can always pass it with the MessageMap if need be.

Thanks for any help,

-Rick


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.