Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preventing access to Links on secure site

Status
Not open for further replies.

buena

Programmer
Oct 17, 2001
47
US
I am working on a secure site done in JSP. The site requires users to login to access the content. I have a page that links to several pdf files like the ones below.


Is there a way to prevent access to these links - say if you just and cut and pasted them into a browser?
 
A clean way of doing it is to implement a Filter - then you can check whether the session id is logged in or not before serving the file.

Here is an example of writing a filter :
--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I am not that familiar with JSP - I was just kind of thrown into this site. Was looking for a simpler solution. Someone mention using an .htaccess file. Would that work?
 
If you are running Apache, then I suppose the .htaccess file would work - but its not a very nice solution, and you would have to make sure that Apache did not forward any requests for pdfs to Tomcat.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top