tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dhaval Patel <>
Subject Re: Question regarding deployment
Date Thu, 10 Nov 2005 03:22:40 GMT

  Based upon your talk I am assuming following:
- You have directory c:\sample-dir which text files and other files.
- You want to make something like http://ADDRESS/sample-dir which displays list
of  files (like online apache browsing).

  Here is the one way you can do it quickly:

(1) Even though your application is not web-app, you still need to make it look
like web-app to tomcat. For that create directory "WEB-INF" inside c:\sample-dir.
Now create a web.xml inside WEB-INF as following:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns=""

   I am running Tomcat 5.5 and I copied it from ROOT\WEB-INF\web.xml and I
removed the contents between <web-app ..> and </web-app>. You can refer to your
tomcat installation. Basically all you need is the <web-app> node inside your
web-xml. The <servlet> node is the default one. Make sure you set "listings" to
true so that you can see the files. "listings" flag should be true by default. If
it is true, you don't need <servlet> tag at all and <web-app> should be empty.

(2) Now we have our sample-dir as a fake web application. Now we need to create
context for it. There are two ways to do this:

(A) Inside and detail way:
Create the context file having name sample-dir.xml (why? because we want to call
it as http://ADDRESS/samlple-dir. If you want to call it sample, make the
filename sample.xml) ike this:

<Context docBase="c:\sample-dir"
         privileged="true" antiResourceLocking="false" antiJARLocking="false">

   Where to put this xml? Depends upon your installation it should be inside
conf. (probably conf\Catalina\localhost\). Just verify it and refer the
documentation. It is very easy to find.

(B) Easy way:
   Use "admin" webapplication of Tomcat to create context. It is very easy and it
does above things for you.

(3) Restart the tomcat on safe side and you should get the result on

   Hope this helps. Let us know how it goes.


--- Smitha Murthy Krishna Nagesh <Smitha.Nagesh@Sun.COM> wrote:

> I have a directory of text files that is not deployed into the Tomcat 
> server. It has some jsp's but certainly doesn't have the structure of a 
> web application. I need to somehow point Tomcat to this directory so 
> that the Tomcat can display the contents of these text files. Can you 
> please provide pointers on how to do it? Which files need to be modified 
> etc.
> Thanks,
> Smitha
> -- 
> Smitha Murthy Krishna Nagesh
> Software RDE
> Ph: (650) 786-6328
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Yahoo! Mail - PC Magazine Editors' Choice 2005

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

View raw message