tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Todd <>
Subject Realm implementation question
Date Sun, 29 Sep 2002 05:06:54 GMT
Please forgive me if this is an obvious newbie question, but I am not a Java
guru, nor have I studied all the intricacies of Tomcat.

I am trying to implement a new Realm, which will obviously require some
configuration parameters in server.xml, and I want to make sure I understand
how to access those config parameters from within my implementation.

I can see that creates an o.a.commons.digester.Digester
that parses the server.xml file.  Is it the case that the Digester will
instantiate a Realm object of the type specfied in the className attribute
of the <Realm> tag in the server.xml file, and initialize that object's
members using the <Realm> tag's attributes of the same name?  So all I need
to do is write my Realm implementation with accessors and mutators for each
<Realm> tag attribute?

So a <Realm> config that looks like this:

<Realm class="org.apache.catalina.realm.MyRealm" propOne="foo" />

would require a Realm implementation like so:

String propOne = null;

public String getPropOne() {
   return this.propOne;
public void setPropOne(String prop) {
   this.propOne = prop;

Am I missing anything?

Thanks in advance,

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

View raw message