I think the problem is, you're using:

 Object obj = pageContext.getAttribute("loginBean");

The JSP spec defines this as returning an object that occurs at *page*
scope.  Try instead:

 Object obj = pageContext.getAttribute("loginBean",
 pageContext.SESSION_SCOPE );

This should work.  As to why the current stuff gives you the result you
want in JRun or iPlanet, can't say --
I have heard that JRun is more "forgiving" -- ie, provides extra behaviours
beyond the spec -- and
maybe this is a case of that.

- Fernando






Hi all- I'm sorry for the repost but this is still stumping me.  I'm using
Tomcat 3.2.2 natively (over port 8080).
 ----- Original Message -----
 From: Richard Sand
 To: [EMAIL PROTECTED]
 Sent: Friday, June 22, 2001 3:19 PM
 Subject: Tomcat not putting session objects into JSP page context?

 Hi all- I've got a JSP/Javabean application that works fine under JRun and
 iPlanet Web Server.  However, when I use Tomcat, it does not seem to be
 instantiating new session variables if they don't already exist.  In the
 top of my JSP page, I have:

 <jsp:useBean id="loginBean" class="LoginBean" scope="session"/>

 And further down in the page I do (actually inside a TagLib, but I tried
 it in the page as well as a test):

   Object obj = pageContext.getAttribute("loginBean");

 But obj comes back as null.  If I try:

  LoginBean tlb = (LoginBean) session.getAttribute("loginBean");

 then I get the bean!  Why is my call to pageContext failing to get
 loginBean, especially considering that this works on other Java
 application servers?

 Thanks for any help!

 Best regards,

 Richard




Reply via email to