tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "GB Developer" <gb107...@globallyboundless.com>
Subject RE: Inner class session attributes not supported?
Date Thu, 03 Nov 2005 19:15:18 GMT
> -----Original Message-----
> From: Ernesto Garcia [mailto:Egarcia@genesyslab.co.uk] 
> Sent: Thursday, November 03, 2005 9:00 AM
> To: users@tomcat.apache.org
> 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:
(org.apache.jsp.test_jsp$MyInnerClass)foo
(test_jsp$MyInnerClass)foo
(test_jsp.MyInnerClass)foo
 
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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message