neharob / prettyfaces

Automatically exported from code.google.com/p/prettyfaces
0 stars 0 forks source link

Allow serving of files outside the document root #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I want to serve files from a folder outside my webapps document root.
Currently, there are ways todo this but they are all container specific, e.g. 
Glassfishs alternatedocroot directive 
(http://docs.sun.com/app/docs/doc/820-4496/geqpl?l=en&a=view)

so basically what I want would be a mapping

/images/* => /var/www/myimages/

which would then result in

/images/1.gif being server from /var/www/myimages/1.gif

This would normally be done by a custom servlet or container specific 
extensions (see above) but as PrettyFaces already looks on every request, it 
may be a nice feature for a variety of users.

Please tell me your thoughts.

Original issue reported on code.google.com by dominik....@gmail.com on 25 Jul 2010 at 12:30

GoogleCodeExporter commented 9 years ago
I like this idea, definitely open for ideas :) -- it would mean providing 
support through the java file APIs. Shouldn't be too hard, but obviously would 
not be OS-agnostic.

Perhaps a way to use environment variables to give root directories in addition 
to mapping directories.

There would also need to be a way to set the content type, or at least 
understand it, if I'm not mistaken, so that images and other files are 
transmitted with proper headers? Maybe that's not required; I've never looked 
into it.

Original comment by lincolnb...@gmail.com on 26 Jul 2010 at 3:42

GoogleCodeExporter commented 9 years ago
I also like the idea. It is a very useful feature especially for static content 
and very large files.

Yes, I think PrettyFaces must set the correct content type. Beside that it 
would be great to be able to control the headers relevant for caching/proxies 
and the content disposition header. 

Original comment by chkalt on 26 Jul 2010 at 5:23

GoogleCodeExporter commented 9 years ago
We have moved the project to GitHub.

If this issue is still relevant, please reopen it here:

https://github.com/ocpsoft/prettyfaces/issues

Original comment by chkalt on 7 Mar 2012 at 6:13