开发者

How to protect outside access?

开发者 https://www.devze.com 2022-12-14 21:06 出处:网络
How protect resouces from outside access in the Web application using jsp - spring? e.g. http://localhost:8080/appsname/images/

How protect resouces from outside access in the Web application using jsp - spring ?

e.g. http://localhost:8080/appsname/images/ here showing list of files

here i dont want to users to direct access to my image folder.if any one trying to do then redirect to error page or home 开发者_运维知识库page.

Thanks


Usually this is achieved by configuring your webserver to disallow directory browsing on a particular directory. For example, using the apache webserver, you'd use Options -Indexes


The way to do it is to store the images somewhere outside the web container (Tomcat?) like in /opt/data/webapp_name/images/ and write a controller that retrieves the images from that locations. Thus there is no direct access to the images and all kinds of security logic can be added to the controller.

0

精彩评论

暂无评论...
验证码 换一张
取 消