Rajesh Shah wrote:
>
> > OK, now what failure symptoms are you seeing?
>
> The JSP is presented to the user, the user fills in the detail and it gets
> send to the servlet (the controller), the servlet gets the request object
> and grabs the session instance. When it trys to grab the session instance it
> is always null.
>
> If I replace the servlet with a JSP as the contoller, this works fine. This
> suggests seems to suggest that there isn't a continuation of a persistant
> session between JSPs and Servlets in Tomcat, but I could be wrong. Looking
> through the newsgroup it seems that quite a lot of people have had this
> problem.
>
> However, I have been researching several other servlet runners and they also
> seem to be fine, although not all of them support JSP 1.1
Could it be that your servlet and JSP page are actually part of two different
applications/contexts? A context is identified by a URL prefix, so for instance
if you have one context associated with /foo and call your servlet with a URL
/servlet/myController
and the JSPs as
/foo/myJSP.jsp
the servlet is executed in the default context and the JSP is executed in the
/foo context; and contexts don't share sessions.
If this is the problem, try calling your servlet as
/foo/servlet/myController
instead. Or even better, map it to an explicit path such as /myController
and call it with
/foo/myController
See the Servlet 2.2 spec for details about how to map servlets to URL
paths.
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets