I am trying to build a photo gallery into my site. I have all the images located in a folder under the site root
Site/Images/etc.....
Site/WEB-INF/classes/etc.....
The images folder,as shown above is at the same level as my WEB-INF. What I need to try to figure out how to do is determine the site relative path to the files so that I can display that in the HTML.
Problem comes in with the fact that I am using java to read the images off my hard drive, and then pass the path info up to the JSP which will display it.The Java is determining where to start to get the files by using a props file I built that gives the absolute path to the files.
D:\Site\Images\etc.....
What happens is that the path that gets passed to the page becomes
This only works if you are viewing the pics from the same box they are hosted on. So i need a way to make the path that gets passed up relative to the Site folder.
Any ideas?
Site/Images/etc.....
Site/WEB-INF/classes/etc.....
The images folder,as shown above is at the same level as my WEB-INF. What I need to try to figure out how to do is determine the site relative path to the files so that I can display that in the HTML.
Code:
<img src="/site/images/image1.jpg"/>
Problem comes in with the fact that I am using java to read the images off my hard drive, and then pass the path info up to the JSP which will display it.The Java is determining where to start to get the files by using a props file I built that gives the absolute path to the files.
D:\Site\Images\etc.....
What happens is that the path that gets passed to the page becomes
Code:
<img src="D:\Site\Images\etc...."/>
This only works if you are viewing the pics from the same box they are hosted on. So i need a way to make the path that gets passed up relative to the Site folder.
Any ideas?