tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: custom <Resources> class
Date Mon, 01 Apr 2002 17:14:40 GMT


On Sun, 31 Mar 2002, Vladimir Vanyukov wrote:

> Date: Sun, 31 Mar 2002 23:10:49 -0500
> From: Vladimir Vanyukov <vze2b36z@verizon.net>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> Subject: custom <Resources> class
>
> Does anyone know where I can get some decent info on writing my own
> class to use in the <Resources> element in server.xml. What I want to be
> able to do is have tomcat obtain all of its static resources (i.e.
> .class files, JSP pages, HTML, .properties, etc) from a database using
> JDBC.
>

Deep down inside of Tomcat 4, the Resources implementation class is a
javax.naming.directory.DirContext implementation (from the JNDI API).
You will want to get the JNDI specs (http://java.sun.com/products/jndi) as
you look into this.

A good starting point would be to look at the following classes in the
org.apache.naming.resources package:
* BaseDirContext - Convenience base class for resources implementations
* FileDirContext - Implementation used when you run a webapp from an
  unpacked directory
* WARDirContext - Implementation used when you run a webapp directly
  from a WAR file

The mechanism by which the right resources implementation is selected is a
little obtuse, and I've never actually tried replacing it via the
<Resources> element, but it should be possible.

> ANY help you be greatly appreciated!
> Vlad
>

Craig


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message