Use session.setAttribute("attr", "value") in greeting, and you could add session.removeAttribute("attr ") in response
_____ From: java-ee-j2ee-programming-with-passion@googlegroups.com [mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com] On Behalf Of Anand A. Parikh Sent: Thursday, October 08, 2009 6:29 AM To: Java EE (J2EE) Programming with Passion!; derez...@yahoo.com Subject: [java ee programming] Re: LAB 4005 When a session attribute is added/replaced/removed the methods will be called automatically. The homework asks you to add a session attribute in Greeting and remove it in Response. But, I noticed that the attributeReplaced() was called when the attribute was removed. --- On Wed, 10/7/09, derezone <derez...@yahoo.com> wrote: From: derezone <derez...@yahoo.com> Subject: [java ee programming] LAB 4005 To: "Java EE (J2EE) Programming with Passion!" <java-ee-j2ee-programming-with-passion@googlegroups.com> Date: Wednesday, October 7, 2009, 11:19 PM For this homework . Add another event handler Java source file called MyOwnEventListener that implements Http Session Attribute Listener. the code is as follows: public void attributeAdded(HttpSessionBindingEvent se) { servletContext.log("attributeAdded() method is invoked"); } public void attributeRemoved(HttpSessionBindingEvent se) { servletContext.log("attributeRemoved() method is invoked"); } public void attributeReplaced(HttpSessionBindingEvent se) { servletContext.log("attributeReplaced() method is invoked"); } Now the question is : how do I invoke these methods?? Do I need to change something in the web pages or any extra code in the greeting or response java ? ? I have the getSession() code in place. No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.421 / Virus Database: 270.14.7/2421 - Release Date: 10/07/09 20:49:00 --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---