On 07.10.2010 03:02, Tim Whittington wrote:
Hi all
Working through
https://issues.apache.org/bugzilla/show_bug.cgi?id=50026 there appears
to be a lack of broader community understanding/documentation of how
to configure file/resource serving in Tomcat.
In particular the fact that DefaultServlet is a Servlet (and not a
magic engine internal) seems to cause people to want to remap it), and
the WebdavServlet is almost undocumented (except for a brief Wiki
page). Useful features like sub contexts are also almost invisible in
the docs (there's one sentence in the Context reference).
What I'm thinking is...
Add a section to the Default Servlet page:
* What to do if you feel you need to map / to something else (e.g. #1
don't, #2 use a servlet spec compliant rewrite filter, #3 use a
sub-context, #4 go Tomcat specific and remap default)
TC 7: Aliases
Do you mean
http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Host_Name_Aliases?
... or something else.
Nope: see "aliases" in
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html. The new
feature is hidden very much and deserves better docs. It allows to map
URLs to content outside of the webapp.
Add a Resource Serving section to the Tomcat 7 docs app covering:
* Using DefaultServlet (brief discussion, linking back to main section)
* Using sub contexts to serve resources (this is covered very briefly
elsewhere)
* Configuring and using WebdavServlet (standards support, web.xml
setup, behaviour, configuration options, security considerations)
For class loader provided ressources: VirtualWebapploader.
Anyone got practical examples of using this?
http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html#VirtualWebappLoader_Implementation
Practical example: often configurations files are loaded as resources
via the class loader. If the webapp needs different configurations for
various environments (tests, stage, production) then admins hate to edit
files in war files. Using the virtual loader, you can move such files
outside of the webapp and overwrite the configuration with those
external files. You can also configure, whether the external files will
really overwrite, i.e. found first, or will only be used if no internal
file is found. Whenever the config files are loaded as resources via the
class loader this works without any changes to the webapp itself.
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org