tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Tomcat Wiki] Update of "HowTo" by BrandonDuRette
Date Thu, 21 Aug 2008 21:42:47 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification.

The following page has been changed by BrandonDuRette:
http://wiki.apache.org/tomcat/HowTo

The comment on the change is:
fix wiki formatting bug

------------------------------------------------------------------------------
  
  When you create a custom subclass of `RealmBase` or `GenericPrincipal` and attempt to use
those classes in your webapp code, you'll probably have problems with `ClassCastException`.
 This is because the instance returned by `request.getUserPrincipal()` is of a class loaded
by the server's classloader, and you are trying to access it through you webapp's classloader.
 While the classes maybe otherwise exactly the same, different (sibling) classloaders makes
them different classes.
  
- This assumes you created a {{{My``Principal}}} class, and put in Tomcat's server/classes
(or lib) directory, as well as in your webapp's webinf/classes (or lib) directory.  Normally,
you would put custom realm and principal classes in the server directory because they depend
on other classes there.
+ This assumes you created a `MyPrincipal` class, and put in Tomcat's server/classes (or lib)
directory, as well as in your webapp's webinf/classes (or lib) directory.  Normally, you would
put custom realm and principal classes in the server directory because they depend on other
classes there.
  
  Here's what you would like to do, but it throws `ClassCastException`:
  {{{

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message