You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Chris Forbis <cf...@gmail.com> on 2004/10/14 21:54:52 UTC

Where to place classes

I am having a problem as where to place classes.

I have a CustomJDBCRealm  (it extends JDBC realm)

I need this to be setup in the context of my application like any
other realm.  If I place my jar in server\lib it works.

BUT

If I do this the MyPrincipal object can not be refrenced from my web
application.

If I place this jar in my webapp lib or in the common\lib the realm
can not find JDBCRealm that is extends from on startup so it fails.

I am a little lost as to the correct place to put this...

I have a CustomJDBCRealm extends JDBCRealm  (it does an getEmailAddress)
I have an interface MyPrincipalInterface extends java.security.Principal
I have a class MyPrincipal implements MyPrincipalInterface

The JDBCRealm gived back a MyPrincipal for its principal...  and my
servlet code then does this to get at it

MyPrincipalInterface p =
(MyPrincipalInterface)httpServletRequest.getUserPrincipal();
    String emailAddress = p.getEmailAddress();

As I see it that is all should work except the common\lib as I
understood it was suppose to work for ALL web applications as well as
ALL server side items, but ti does not seem to.

(For refrence most my test has come from the Tomcat Wiki at
http://wiki.apache.org/jakarta-tomcat/HowTo)

I am lost...

Thanks!

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