tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "GB Developer" <>
Subject RE: Inner class session attributes not supported?
Date Thu, 03 Nov 2005 19:15:18 GMT
> -----Original Message-----
> From: Ernesto Garcia [] 
> Sent: Thursday, November 03, 2005 9:00 AM
> To:
> Subject: Inner class session attributes not supported?
> I define a static inner class inside my JSP

... and then put it in the session. So even if you *could* cast it back out
to the right type (which in my own testing, I haven't managed to do)... you
now have a situation where any class can now access your private inner class
of another class? (Because any other JSP page can call
session.getAttribute).  If that's the usage you want, then why bother making
it a "private inner class" in the first place? 
Also, the classname for inner classes has the $ in it, and for JSP pages,
has the name of the jsp page prepended as well.  In my own test, I put a
page at the root of the webapp named test.jsp and the classname of the inner
class was:

instanceObj.getClass() = class org.apache.jsp.test_jsp$MyInnerClass 
none of these work:
In fact, the nice little "perchance you meant" in the stack trace tells me
someone has a sense of humour about these sorts of situations.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message