tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: ServletContext.setAttribute()
Date Fri, 14 Jul 2000 23:21:36 GMT
A common way for this to happen is for you to have old servlet classes on
your compile CLASSPATH -- such as the "jsdk.jar" file that contains
version 2.0 classes (before the ServletContext.setAttribute() method was
added to the API).

Craig McClanahan


Mason Jones wrote:

> Very strange... I got the same message from the compiler
> about not finding a matching method. Must be something
> weird with my JDK, but I'm not sure how that could be.
>
> At 04:04 PM 7/14/00 -0700, you wrote:
> >This worked for me... I did something like:
> >
> >ServletConfig sc=getServletConfig();
> >ServletContext ctx=sc.getServletContext();
> >ctx.setAttribute("formMessage",msg);
> >
> >(from within a class that extended HttpServlet)
> >
> >On Fri, 14 Jul 2000, Mason Jones wrote:
> >
> >>
> >> I'm trying to compile a servlet to test setting an attribute in the
> >> servlet context, and getting an odd error:
> >>
> >> formEditClip.java:31: Method setAttribute(java.lang.String,
> >> java.lang.Object) no
> >> t found in interface javax.servlet.ServletContext.
> >>                 context.setAttribute("formMessage", msg);
> >>
> >> Looking in the javadoc API for ServletContext, that is certainly
> >> the correct form of the method call... And as far as I know I have
> >> the latest JSDK, and it's finding the class. Are the javadocs
> >> wrong? Is there another version of the method call that anyone
> >> out there knows about?
> >>
> >> Thanks for any help.
> >>
> >>
> >>
> >> ________________________________________
> >>   Mason Jones              mason(at)clipshow.com
> >>   Director of Software Development
> >>   ClipShow, Inc.            www.clipshow.com
> >>   (650) 696-3164           fax (650) 696-3267
> >>
> >>
> >>
> >
> >-Eric Harashevsky
>
> ________________________________________
>   Mason Jones              mason(at)clipshow.com
>   Director of Software Development
>   ClipShow, Inc.            www.clipshow.com
>   (650) 696-3164           fax (650) 696-3267


Mime
View raw message