Elisabeth Freeman wrote:
>
> I am forwarding to a JSP from a servlet, and attempting to put one bean
> in the application scope (by putting it in the servlet context) and one
> bean in the session.
>
> The JSP can see the bean in the servlet context, but the values that I
> set in it before the forward are not there, and the JSP can't see the
> session bean at all (ie, it's null when I retrieve it from the session.
>
> Here's a code snippet. Any help would be much appreciated! Please copy
> my email address when responding as I only get the digest format of the
> mailing list.
My guess is that the JSP page and the servlet are in different contexts.
Your code shows that you use a URL like /examples/jsp/Here.jsp. Assuming
you're using Tomcat's default config (the same as JSWDK I believe) and
invoke the servlet with a URL like /servlet/myServlet, the servlet executes
in the default context while the JSP is executing in the examples context.
Session data can not be shared between contexts.
If this is the proble, calling the servlet as /examples/servlet/myServlet
instead should work.
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html