Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • 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
  • 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: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can you display the images in jsp...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic