[Gllug] OT: Tomcat & Apache mapping problem

Russell Howe rhowe at wiss.co.uk
Wed Mar 23 14:27:23 UTC 2005


On Wed, Mar 23, 2005 at 12:20:45PM +0000, Tethys wrote:
> Indeed :-) Tomcat's problems, though, stem as much from its hideously
> inappropriate use of XML for config files as much as they do from its
> use of Java (although that itself does cause many, many problems).

Have you ever seen Jetty's configuration file?

It doesn't have one - you're required to write a Java class which does
the initial setup (adding webapps, etc) and then launches the server.

Although, you can write that class in XML - there is an XML-to-Java
interpretcompiler or whatever you want to call it :)

e.g.:

<Configure class="org.mortbay.jetty.Server">
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.ajp.AJP13Listener">
        <Set name="Host">127.0.0.1</Set>
        <Set name="Port">8009</Set>
        <Set name="MinThreads">1</Set>
        <Set name="MaxThreads">10</Set>
        <Set name="MaxIdleTimeMs">30000</Set>
        <Set name="confidentialPort">443</Set>
      </New>
    </Arg>
  </Call>

  <Call name="addWebApplication">
    <Arg>/</Arg>
    <Arg>/home/russell_howe/projects/website/webroot-jetty/</Arg>

    <Set name="Realm">
      <New class="org.mortbay.jaas.JAASUserRealm">
        <Set name="Name">Intranet</Set>
        <Set name="LoginModuleName">intranet</Set>
      </New>
    </Set>
  </Call>

  <!-- other stuff -->
</Configure>

It's a bit messy and hard to follow, but unlike most XML configuration
files for Java, it's documented - by the Javadoc for Jetty itself.

That's my main gripe with XML configuration files for Java stuff - the
documentation. The DTD, if even available, is often commented so
spartanly that it's impossible to use without examples to base your work
on.

Orion (http://www.orionserver.com/) which is actually quite a nice
(non-free as in speech, but free as in beer for development and
non-commercial use) J2EE container, has some documentation on its
various configuration files, but it's nowhere near complete enough to
be usable without quite some experimentation, I found.

-- 
Russell Howe       | Why be just another cog in the machine,
rhowe at siksai.co.uk | when you can be the spanner in the works?
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list