protect images in jsp from direct access

A

autogoor

Hi, Here is my web app file structure:

To protect my jsps from direct access from users, I put them under
WEB-INF.

Here is my 1.jsp

<html>
<body>
<img src="1.jpg"/>
<img src="2.jpg"/>
</body>
</html>

My questions is where should I put my pic files?
My app requires user login with username and password. Only those who
login successfully could see my images.


Thanks,

autogoor
 
R

Ryan Stewart

Hi, Here is my web app file structure:


To protect my jsps from direct access from users, I put them under
WEB-INF.

Here is my 1.jsp

<html>
<body>
<img src="1.jpg"/>
<img src="2.jpg"/>
</body>
</html>

My questions is where should I put my pic files?
My app requires user login with username and password. Only those who
login successfully could see my images.
You could place the images in WEB-INF as well and use a servlet to grant access
to them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top