File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Method setAttribute() not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Method setAttribute() not found" Watch "Method setAttribute() not found" New topic

Method setAttribute() not found

Sylvia Wang
Ranch Hand

Joined: Apr 10, 2001
Posts: 53
I'm learning JSP using Jbuilder3.5 Enterprise.
when I run my sample codes from the localhost builded in Jbuilder, it come out following error:
Method setAttribute(java.lang.String, java.lang.String) not found in interface javax.servlet.http.HttpSession.
session.setAttribute( "theName", name );
is there anything wrong with the code ? or some limitation of Jbuilder3.5 ?
Pls help...Thanks a lot!
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
SetAttribute is only available with version 2.2 of servelts and above. You must be using a version less than 2.2. You can use the putValue() method instead.


So much trouble in the world -- Bob Marley
Sylvia Wang
Ranch Hand

Joined: Apr 10, 2001
Posts: 53
it works after I upgrade to Jbuilder4.0
I agree. Here's the link:
subject: Method setAttribute() not found
It's not a secret anymore!