tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Levent G├╝ndogdu <>
Subject Possible BUG in JSP Code Compiler
Date Wed, 11 Jul 2001 07:50:23 GMT
Hi everyone,

I assume there is a BUG in the JSP Code Compiler somewhere, because the
following does not work as it should:



// Retrieve user object for this session
Object obj = request.getSession().getAttribute("user");

// Just make sure, what class we have

// Check instance, should return true.
if (obj instanceof some.User)
    currentUser = (somepkg.User) obj;
    System.out.println("WEIRD! How can that be???");


User is the interface for describing a User and its properties, UserImpl is
the actual implementation. obj.getClass().toString() shows, that obj is
instance of somepkg.UserImpl, but instanceof returns false. Even if i try
"obj.instanceof somepkg.UserImpl" it fails. Casting throws a ClassCastException.

Can anyone verify this behaviour?

I am new to this list, so please apologize if this has been reported
Thanks for any comment on this.


View raw message