JAVA

서블릿 Listener API

정숙씨의 쏠쏠한 코딩 2021. 8. 25. 22:21

서블릿의 여러가지 리스너

  • ServletContextAttributeListener 
    • 추상메서드
    • attributeAdded()
    • attributeRemoved()
    • attributeReplaced()
    • -> Context 객체에 속성 추가/제거/수정 이벤트 발생 시 처리 메서드
  • HttpSessionListener
    • 추상메서드
    • sessionCreated()
    • sessionDestroyed()
    • -> 세션 객체의 생성/소멸 이벤트 발생 시 처리 메서드
  • ServletRequestListener
    • 추상메서드
    • attributedAdded()
    • attributedRemoved()
    • attributeReplaced()
    • -> 요청 객체에 속성 추가/제거/수정 이벤트 발생 시 처리
  • HttpSessionBindingListener
    • valueBound()
    • valueUnbound()
    • -> 세션에 바인딩/언바인딩된 객체를 알려 주는 이벤트 발생시 처리
  • HttpSessionAttributeListener
    • attributedAdded()
    • attributedRemoved()
    • attributeReplaced()
    • ->세션에 속성 추가/제거/수정 이벤트 발생 시 처리
  • ServletContextLister
    • contextInitialized()
    • contextDestroyed()
    • -> 컨텍스트 객체의 생성/소멸 이벤트 발생 시 처리
  • HttpSessionActivationListener
    • sessionDidActivate()
    • sessionWillPassivate()
    • -> 세션의 활성화/비활성화 이벤트 발생 시 처리