I am not so into Tomcat configuration and I have the following doubts:
The server.xml configuration file of my Tomcat 7 contains this section:
<Host name="localhost" appBase="webapps"
unpackWARs="true"
autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
<Context path="/my-project/images/" docBase="/data/myproject/cache/images/" />
</Host>
My main doubt is related to this last line:
<Context path="/my-project/images/" docBase="/data/myproject/cache/images/" />
/data/myproject/cache/images/ contains some other folder containing images used by my Java EE project.
So what exactly means this line?
I think that it means that it maps the /my-project/images/ folder to the external folder (external to the project) /data/myproject/cache/images/
Is this reasoning correct?
My problem is that my application starts but these images are not shown.
So the exact situation is the following one: these images are not stored directly into the /data/myproject/cache/images/ external folder but are putted in subdirectoy of this folder, something like this:
**/data/myproject/cache/images/subdir1/1.png**
**/data/myproject/cache/images/subdir1/2.png**
**/data/myproject/cache/images/subdir1/3.png**
**/data/myproject/cache/images/subdir2/4.png**
**/data/myproject/cache/images/subdir2/5.png**
**/data/myproject/cache/images/subdir2/6.png**
So I think that maybe I have to change this line:
<Context path="/my-project/images/" docBase="/data/myproject/cache/images/" />
in such a way that if is call something like /my-project/images/subdir1 it is mapped to /data/myproject/cache/images/subdir1/
If it could be my problem (I am absolutly not sure of it), how can I specify this particular behavior?