Guys!

According to hw 5, we need to add  MyOwnEventListener that implements Http
Session Attribute Listener.
I created it and  added the following methods

 public void attributeAdded(HttpSessionBindingEvent arg0) {
       servletContext.log("attributeAdded(HttpSessionBindingEvent evt)
method is invoked");
    }
    public void attributeRemoved(HttpSessionBindingEvent arg0) {
        servletContext.log("attributeRemoved(HttpSessionBindingEvent evt)
method is invoked");

Also I added HTTPSession in GreetingServlet.java
        // Get a session
        HttpSession session = request.getSession();

So now when I run the program, attributeAdded() method can be seen in log
file. Upto this point there is no problem

What I need to ask is now to call the attributeRemove() method, closing the
HTTPSession in response.java  is enough or we need to call some method
because in the tutorial it says  the following method is to close the HTTP
object and closing the object whether removes the attribute too?So I am
confused  and also I cant see my function attributeRemoved() getting called
in log file

 // Close the HttpSession
        request.getSession().invalidate();

Waiting 4 the help

Thanks

Ashish Shrestha

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Java 
EE (J2EE) Programming with Passion!" group.
To post to this group, send email to 
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to 
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to