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
VirtualWebappLoader
in Tomcat8? - How to configure
PreResources
element in Tomcat8 server.xml? - Is it recommended to configure
PreResources
element in Tomcat8 server.xml? - When configuring the
PreResources
element as follow in Tomcatserver.xml
then accessing/docs
context will throw HTTP 404 error but configuring the same in$CATALINA_HOME/conf/context.xml
will 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, tools, and much more.