How to add external resources to classpath in Tomcat 8?
Issue
- How to add external resources to classpath in Tomcat 8?
- What is replaced by
VirtualWebappLoaderin Tomcat8? - How to configure
PreResourceselement in Tomcat8 server.xml? - Is it recommended to configure
PreResourceselement in Tomcat8 server.xml? - When configuring the
PreResourceselement as follow in Tomcatserver.xmlthen accessing/docscontext will throw HTTP 404 error but configuring the same in$CATALINA_HOME/conf/context.xmlwill works fine.Why?Is this is a bug?
<Context path="/docs">
<Resources className="org.apache.catalina.webresources.StandardRoot">
<PreResources className="org.apache.catalina.webresources.DirResourceSet"
base="/tmp"
internalPath="/"
webAppMount="/WEB-INF/classes"/>
</Resources>
</Context>
Environment
- Red Hat JBoss Web Server (JWS) 3.0
- Tomcat 8
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
