Results 1 to 3 of 3

Thread: Session start & container managed bean

  1. #1
    Join Date
    Mar 2007
    Posts
    20

    Default Session start & container managed bean

    Hello,

    I was wondering how I can receive session start events in a container manager bean. I know I can create a class that implements
    Code:
    javax.servlet.http.HttpSessionListener
    and add that class to my web.xml:
    Code:
    <listener><listener-class>pb.session.Init</listener-class></listener>
    But is there a "Spring" way to do this? Then I can use container features on my Init class as well.

    Many thanks,
    James

  2. #2
    Join Date
    Mar 2007
    Posts
    20

    Thumbs up

    I'll be more specific:

    HttpSessionListener provides these methods:

    Code:
    public void sessionCreated(HttpSessionEvent httpSessionEvent) {
    init(httpSessionEvent);
    }
    public void sessionDestroyed(HttpSessionEvent pHttpSessionEvent) {
    }
    Does the "Spring" variant provide that as well?

    In the end what I'm trying to do is get the IP address of the request that initiated the session. I know that httpSessionEvent doesn't provide that - anyone have a solution for that?

    Many thanks,
    James

  3. #3
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Not sure, but maybe org.springframework.web.context.request.RequestCon textListener might be of any avail?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •