Howdy,

>    I have a class which implements HttpSessionBindingListener
interface.
>The class is put in the session scope. I have to get the ServletContext
>from
>inside this class. How to get it ?. I don't know much about servlets
and
>Java.

You might want to get a book or go through some tutorials.  In this
case, the answer is fairly clear from the JavaDocs:

Every method in HttpSessionBindingListener gets an
HttpSessionBindingEvent as its argument.  Call getSession() on that
event to get the HttpSession, and call getServletContext() on the
session to get the context.

Ignore what the other person said about setting crossContext="true" in
server.xml.  It's not required.

Yoav Shapira



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