File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web.xml settings for preventing direct access to image by its URL

 
Shruti Sagar Mohanta
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I have a folder images in my web application which I want to secure by preventing direct URL access to it (which is known to most of my application's users). But simultaneously the JSP files in my application should be able access the images inside images folder.

I know how to use .htaccess for this purpose but I don't know how to achieve this by settings in web.xml for an application.

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot protect the images. If the browser cannot access the images, how can it display them?
 
Shruti Sagar Mohanta
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the way images can be protected by .htaccess (preventing direct URL access)
isn't there any similar way for java application?
 
sudheer yathagiri kumar
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can you display the images in jsp...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic