Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

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

0

105 views

Hi Folks,

I am successful to map an external directory by creating an xml file like :

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

asked January 1, 2011 2:10 pm CST
posted via StackOverflow

2 Answers

0
 

thanx Zeki

Yeah we have a context.xml where we define the current context i.e. spark for example "http://localhost:8080/spark" this is located at ../WebRoot/META-INF/context.xml. This is set up in Tomcat Context Descriptor in Facets of IntelliJ Idea.

Can we somehow define another xml file which maps to an external directory outside the webapps. If so, how can define another context specifically for images (uploads and fetching into the presentation layer)

Please let me know.

answered January 3, 2011 6:39 am CST
0
 

IntelliJ uses it's own Tomcat Base, so you will need to add a web facet to your project and add your directory there. This is for IntellijJ 9 and 10. I don't have 8.

answered January 3, 2011 6:39 am CST

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions