tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: problem with pageContext.
Date Fri, 14 Apr 2000 16:19:29 GMT
Venkat Dosapati wrote:

> Dear Tomcat users,
>                 using pageContext.setAttribute(String, Object), i registered
> objects in HashTable.  when i get that object using
> pageContext.getAttribute(String), i could not get the object. it is giving
> null. it is not throwing any exception. please help me.

This kind of stuff has worked fine for me.  The getAttribute method is supposed
to return null, not an exception, if it doesn't find a value with the key you
specified.  Two things to look at:

* Are you sure that the string values you used in the
  setAttribute() and getAttribute() calls are identical?

* Are you doing these two calls in the same JSP page?
  (The two-argument version of setAttribute() puts your
  object into page scope, so it won't be there if you try to
  access it from a different page.)

If these two issues are not causing your problem, please try to post an example
test case where it's not working.

> -venkat.

Craig McClanahan

View raw message