You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by dm...@free.fr on 2001/05/17 12:46:48 UTC

Multiple session : why ? Need to configure tomcat another way ?

Hi there !

I'm new on this list and it seems that tomcat-faq is not yet available, so I 
beg your help...

What I want to do is to run a servlet that :
1. create an object
2. put it in the session
3. call a JSP that will use that object to display the result of the client 
request

The problem I get is that the object the servlet has created is not available 
in my JSP. In fact, if I ask my servlet to display its sessionId 
(request.getSession.getId()), it appears that it is not the same as the session 
in my JSP (session.getId()).

In server.xml, I created a context :

        <Context path="/refonte"
                 docBase="/export/home/siteweb/refonte"
                 crossContext="true" (I tried false)
                 debug="0"
                 reloadable="true" >
        </Context>

because I do want to have my own path for my application (not webapps).

And in my tomcat.conf (included in apache httpd.conf) one can find these lines :

AddType text/jsp .jsp
AddHandler jserv-servlet .jsp
ApJServMount /refonte/jsp /refonte


What I think is that the context used by my JSP is not the same used by my 
servlet. But, how can that be different, and how to make my JSPs and servlets 
share the same context, so that they can share objects ?

Note that if I add a "request.setAttribute("dummy","dummy")" in my servlet, I 
get the dummy object in my JSP (hopefully :-). But the session is lost...

Please help me !


PS: - Jakarta Tomcat 3.2.1
    - Apache 1.3.19
    - SunOS 5.8
    - JDK 1.3
    - jsp files located in /export/home/siteweb/refonte/jsp
    - servlets located in /export/home/siteweb/refonte/servlet

-- 
David