On Fri, 28 Dec 2001, Mark Galbreath wrote:
> I know I've run across this before, but can't remember the
> circumstance. When I attempt to set a JavaBean property from a
> servlet as so:
>
> try {
> ...
> UserBean.setLastAccess( rs.getString( "lastaccess"));
> ...
> }
>
> with the bean method as:
>
> public void setLastAccess( String lastaccess) {
> this.lastaccess = lastaccess;
> }
>
> I get a compile-time error:
>
> "non-static method setLastAccess( java.lang.String) cannot be
> accessed from a static context."
>
> Is a <try> block considered a static context?
Not inherently (it could be in a static context itself, it's not clear
from the above).
But what I wonder about is "UserBean" -- is that the name of the bean
class, or a variable that's an instance of it?
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html