• Post Reply Bookmark Topic Watch Topic
  • New Topic

Image directory  RSS feed

 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
JSP pages are dynamic, but certain elements (like GIFs) are static. So it makes sense for these JSP's HTML's and GIF's to be jar'd together. Then in your JSP, you can simply refer to the image with an src = "gif file name". It will find the image in the jar, and retrieve it. This I understand.

What about the case where I want an image directory? For example, my application requires functionality to upload and display various images. These images can't be jar'd with the WAR file, because they are dynamic. But the problem is: How to get a file system reference?

I have tried a bit of sneakiness. In the J2EE directory, under the repository/computerName/web directory, I can see there is a folder with the same name as my web context root. So in the same directory i placed an 'images' folder and then referred in the JSP to src="../images/image.gif" This did not work.

Any ideas how I can do this?
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well.. 10 minutes later I answered my own question. It's a new personal best.

I can place an images directory here: < J2EE_HOME >/public_html

[This message has been edited by Mike Curwen (edited May 04, 2001).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!