I want to access files which are outside the webapps directory.
My OS is windows/linux and I have a scenario, wherein, i need to write files, to specific directories, outside webapps.
Tomcat throws a Security Exception, so how do I get away with this.
For security, servlet containers are prohibited from serving directly files outside the context. Tomcat's "default" servlet handles file requests such as css and image requests but obeys this prohibition.
The solution is simple, you must provide your own servlet implementation that gets the image request, knows where to look for (for example) image files, creates the correct headers, and send the data.