How to set up a different context to point to an external directory outside webapps Tomcat/Java
- by pinkb
Hi Folks,
I am successful to map an external directory by creating an xml file like :
<Context path="/uploads" docBase="C:\uploads\photos" crossContext="true"/>
And I named this xml file as uploads.xml and saved under "#Tomcat\conf\Catalina\localhost" here # = Directory where Tomcat has been installed.
And when I start Tomcat(5) from cammand line (batch file) i.e. startup.bat
The images can be accessed normally like
"http://localhost:8080/uploads/user1.png"
It works.
Actually I am using IntelliJ Idea 8 for devevelopment.
When I start Tomcat from IntelliJ Idea, I am not able to access the context i.e. the images.
"http://localhost:8080/uploads/user1.png"
It shows "HTTP 400 Bad Request"
The context path for my project is
"http://localhost:8080/spark/"
Any help or suggestion is needed at the earliest time.
Looking forward to as many appreciative responses as possible.
Thanx
Pink