tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Colic" <alex.co...@pop-ware.com>
Subject Is this a bug in tomcat or me?
Date Thu, 19 Apr 2001 17:33:11 GMT
Hi,

I am having major problems with the servletContext.

In my main class I do the following:

  ServletContext context=getServletContext();
  context.setAttribute("Key", Boolean.TRUE);

Then in one of my jsp tags if want to check the value of "Key" I do the
following:

Boolean active =
(Boolean)pageContext.getServletContext().getAttribute("Key");

If I want to change the value of "Key" I do the following:

      Boolean active=(Boolean)context.getAttribute("Key");
      active=Boolean.TRUE or FALSE;
      context.setAttribute("Key",active);

I have also tried:

context.setAttribute("Key",Boolean.FALSE);

My problem is no matter what value I set, when I pull active out the value
of "Key" out of the context it is always TRUE.

Any ideas what I am doing wrong?

Any help is appreciated

Regards

Alex


Mime
View raw message