In production I have setup an external folder to upload and display images from by editing server.xml:
<Service name="Catalina">
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context docBase="/opt/winmail_storage/imgs" path="/imgs"/>
</Host>
</Engine>
</Service>
I am trying to do the same thing in development by editing _Events.groovy :
eventConfigureTomcat = {tomcat ->
def ctx = tomcat.addContext("/imgs" , "/tmp/images")
}
I also tried
eventConfigureTomcat = {tomcat ->
def ctx = tomcat.addContext("/appName/imgs" , "/tmp/images")
}
this is not working, the imgs directory is not accessible via : http://host/appName/imgs any idea how I can do this correctly?