On Sun, 31 Mar 2002, Vladimir Vanyukov wrote:
> Date: Sun, 31 Mar 2002 23:10:49 -0500
> From: Vladimir Vanyukov <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> 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:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>