Hi,
You'd have to pass it with the MessageMap.  Binding the ServletContext itself in JNDI 
is not mandated by the Servlet Specification, and Tomcat doesn't do it.

As an aside, be careful to not crash if you're running from a packed WAR file (where 
all getRealPath calls will return null).

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Dev Team [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 18, 2004 9:56 PM
>To: Tomcat Users List
>Subject: possible to get handle to ServletContext from JNDI java:comp?
>
>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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to