struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Etson" <>
Subject [OT]RE: accessing large/multiple files on hard drive
Date Tue, 10 Sep 2002 18:42:22 GMT
Are you trying to access the files from Java or just reference them via html? If you just want
a reference, Tomcat and most other web servers have a notion of a virtual directory. I believe
with tomcat you can set this up with context entry pointing to some  random directory. If
you want to reference the MP3s via Java, I used a property file to indicate the directory
the my mp3s are stored in along with the virtual reference from the new Tomcat Context. This
is essentially the same as having two web applications. One being deployed as an ear and one
as an web application with its document root as a directory reference to the mp3 collection.
The only draw back I found to this is that tomcat treats mime mappings somewhat strangely.
".MP3" and ".mp3" are not equal. ".mp3" returns the right mime mapping and ".MP3" was returned
as an octet string.

P.S. If some one has a better solution I be glad to hear it. I toyed around with the idea
of hijacking the Invoker servlet with a struts action but I didn't feel this was very portable
and the purpose of this app was to demonstrate best practices i.e. portability.

>>> <> 09/09/02 02:06PM >>> 
This has got to be a candidate for the worst, messiest solution ever... 

Worse comes to worse, you could have two applications... one that holds 
and serves up the mp3 files and the other that does all the other 

I'm sure there is a hole a mile wide in this idea... 

-----Original Message----- 
From: ekbush [] 
Sent: Monday, September 09, 2002 4:39 PM 
To: struts-user 
Subject: Re: accessing large/multiple files on hard drive 

That could get quite tricky if you're running out of a WAR archive. If 
your application is deployed in "unpacked" format, then you could 
sym-link (on Un*x anyway) to it I would think. So you'd wind up with a 
sym-link in your root (or protected under WEB-INF) that pointed to the 
real directory. I can't think of another elegant solution. Maybe 
someone else can. 



Nani Jon wrote: 

>Here is my sitiuation. I have deployed my application war file to a 
JBoss_Tomcat caontainer. I have developed this app using struts. I am 
trying to access multiple music files (mp3 format) form this app. I 
don't want to wrap all of my mp3 files which total to about 1 GB in my 
war file. This makes for a very lenghty deploy process, especially when 
it is work in progress. I just want to put them in a directory on the 
server where Tomcat is running and point to that directory in my 
application. How is this done. Your help is greatly appreciated. 

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message