tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric H." <ehara...@usc.edu>
Subject Re: ServletContext.setAttribute()
Date Fri, 14 Jul 2000 23:04:25 GMT
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


Mime
View raw message