Sharing session state between Servlet applications/contexts


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Sharing session state between Servlet applications/contexts

  1. #1
    Mark Alexander Bertenshaw Guest

    Sharing session state between Servlet applications/contexts


    Hi -

    I am pretty new to all this Java stuff, and I have to find out why the session
    of a web application defined in a <context> section of server.xml is not
    acessible in a web application defined in a different <context> section.
    By "not acessible", I mean that you get null when you do request.getSession(false)
    after having previously run a servlet in the same browser.

    Can anybody explain how session() works in this context?

    Thanks,

    --
    Mark Alexander Bertenshaw
    Programmer/Analyst
    Chordiant Software, Inc.
    Brentford
    UK

  2. #2
    MarkN Guest

    Re: Sharing session state between Servlet applications/contexts


    Mark,
    What web/app server are you using? Typically a servlet in one web app
    (and its sessions) are not available to another webapp. This may be different
    depending on web/app server and maybe configurable too. I've not personally
    done alot with session variables. We keep state differently because we mainly
    use applets or applications as our frontends. If you want the soapbox reason
    let me know.

    Mark

    BTW, one does't run a servlet in a browser.
    "Mark Alexander Bertenshaw" <mark.bertenshaw@virgin.net> wrote:
    >
    >Hi -
    >
    >I am pretty new to all this Java stuff, and I have to find out why the session
    >of a web application defined in a <context> section of server.xml is not
    >acessible in a web application defined in a different <context> section.
    > By "not acessible", I mean that you get null when you do request.getSession(false)
    >after having previously run a servlet in the same browser.
    >
    >Can anybody explain how session() works in this context?
    >
    >Thanks,
    >
    >--
    >Mark Alexander Bertenshaw
    >Programmer/Analyst
    >Chordiant Software, Inc.
    >Brentford
    >UK



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center