Relative Path Question Starting Tomcat Server

So, I have a file structure as shown below

http://dl.dropbox.com/u/322696/FolderPath.JPG

When I start Tomcat Server, I try to find out where the root folder starts, if I only started the server in the server window and got access to the jsp page in the jsp folder. I need to go to the images /banner/name.jpg (trying to make an image file). I set the server context to '/ projectname' (black box next to [repository]). I tried:

File image = new File("../images/banner/name.jpg"); //If its root was the jsp I accessed

No dice. Is there a way I could work to determine what the relative path should be?

+3
source share
1 answer

, tomcat? ServletContext.

getServletContext(). GetRealPath ( "/" )

+4

All Articles