Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Image files behind WEB-INF are not accessible  RSS feed

 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am working on a site where the user can upload images. These images can either be private or public. Therefore I need to place all images behind WEB-INF so that people can not access the directory where the images are stored.

I am using struts.

The problem that I am having is that I am unable to display the images in the jsp page as the images are behind the WEB-INF directory.

Does anyone know how to get around this. If so a small example would be appreciated.

Thank you
David
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is correct, anything behind WEB-INF is not directly accessible. I'd write a servlet that serves up the images after appropriate access checking.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!