tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <>
Subject Re: Access Local File System
Date Sun, 06 Jul 2008 11:36:55 GMT

----- Original Message ----- 
From: "Paolo Niccolò Giubelli" <>
To: "Tomcat Users List" <>
Sent: Sunday, July 06, 2008 10:10 AM
Subject: Re: Access Local File System

> It's very similar to the situation I described few days ago, so I quote 
> what Caldarale told me:
>> It's not really difficult. Define a <Context> element for an
> additional webapp that targets the external directory via a docBase
> attribute, and place that <Context> element in
> conf/Catalina/[host]/[newAppName].xml; use something like "images"
> (without the quotes) for [newAppName]. Tomcat's DefaultServlet will
> happily retrieve and display images or other static content from there
> when referenced via http://[host]/[newAppName]/[file].[type].
> In your situation, I'd use "videos" as the newAppName.
> In the <Context> tag don't forget to put the docBase="<your_external_path" 
> attribute.

Yes Thanks... the reason I always hesistate when it comes to DocBase setups 
is because normally the next question from the user has is, "how do I deploy 
When the web app is outside of TC, you have to get it there yourself... and 
then you can deploy it... ie show TC where it is, using ant or manager 
commands.... its getting away from the norm.

With TC there are always a few ways...

What one could also have done is....
make a servlet that gets the file from anywhere, and then the servlet is 
mapped to *.flv in this case.... and then deployment of the webapp is 
normal, and just the flash files are external...

... I would have used Apache ... ;) and Chuck would give me a hard time 
again ;)
You see, Tomcats APR engine is based on Apache's engine, so he gets cheesed 
when I throw in the whole Apache as well ;) TC is very quick 
already....(same engine)... but I like using them together... I use Apache 
as a switch and static content store, and I use TC as the brains and command 
center... just me I guess.

There lots of ways but....
One thing that newbies to TC must must learn... is servlets and the MVC 
model... ie how to use servlets and JSP pages together... (google will tell 
you).... JSP's on their own are only giving one a 1/20th of the power that 
TC actually has to offer. If people learn that... then they'll see why I 
keep saying the TC *is* the most powerful Java technology ever...
Before you learn Ajax and JSF and JSTL and VWP and and and and... learn that 
MVC model.
If you get it... you actually dont need any other frameworks... thats what 
all the frameworks use ;)
TC is a very powerful machine... but one will never see it from just using 

I luv this machine... its the reason we use Java... actually its the reason 
I cant remember my wifes name ;)

The most powerful application server on earth.
The only real POJO Application Server.
See it in Action :

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message