How to set up a different context to point to an external directory outside webapps Tomcat/Java

Posted by pinkb on Stack Overflow See other posts from Stack Overflow or by pinkb
Published on 2011-01-01T20:10:26Z Indexed on 2011/01/01 20:53 UTC
Read the original article Hit count: 242

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about java

Related posts about tomcat