I think you should comment out those lines where you're throwing UnsupportedOperationException.
-- Regards, Artashes Hovasapyan On Tue, Mar 10, 2009 at 5:59 AM, <ketul....@gmail.com> wrote: > > *Please anyone can help me what is wrong in my code > *I am getting error CODE i have pasted below line > > *Appreciate in advance > > > java.lang.NullPointerException > at mypackage.MyOwnEventListener.attributeAdded > (MyOwnEventListener.java:33) > at org.apache.catalina.session.StandardSession.setAttribute > (StandardSession.java:1706) > at > org.apache.catalina.session.StandardSessionFacade.setAttribute > (StandardSessionFacade.java:163) > at servlets.GreetingServlet.doGet(GreetingServlet.java:51) > at javax.servlet.http.HttpServlet.service(HttpServlet.java: > 718) > at javax.servlet.http.HttpServlet.service(HttpServlet.java: > 831) > > > > ------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > > public void attributeAdded(HttpSessionBindingEvent evt) { > > servletContext = evt.getServletContext(); > servletContext.log("attributeAdded(HttpSessionBindingEvent se) > method is invoked"); > throw new UnsupportedOperationException("Not supported yet."); > } > > public void attributeRemoved(HttpSessionBindingEvent evt) { > > servletContext.log("attributeAdded(HttpSessionBindingEvent se) > method is invoked"); > throw new UnsupportedOperationException("Not supported yet."); > } > > > > > request.getSession().removeAttribute("att"); > //request.getSession().invalidate(); > > > HttpSession session = request.getSession(); > if (session != null) > session.setAttribute("att","attribute1"); > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---