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 strongm 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?
 
i believe restricted resource should be define on your web.xml file, you can update your web.xml file defining a <security-constraint> tag and define <url-pattern> to cover everything on 2006 dir (/2006/*) - of course assuming all material under 2006 are supposed to have restricted access.

<security-constraint>
<display-name></display-name>
<web-resource-collection>
<web-resource-name></web-resource-name>
<url-pattern>/pubs/pub1/2006/*</url-pattern>
</web-resource-collection>
</security-constraint>
 
Thanks for the reply. I pasted the code above into the web.xml file, but it didn't do anything?
 
i thought you have defined the security for your app. and just asking how to define the secure resources. I am not an expert in this field but i know this much that all have to be defined on your web.xml file: <login-config> which defines what is your authentication method and you also have to define the <security-role> which contains the different roles you wish to have for your users and i should also mention that you should have <role_name> inside the <security-constraint> tag defining the name of the roles that are authorized for that constraint. I know this is not an thourgh answer you are looking for but still a clue to where to look and for what :)
BTW what webserver are you on?

Good Luck
 
Ok, thanks. I will look into it some more.
The server is Tomcat 5.5
 
I still think it would be easier to write a Filter.

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

Part and Inventory Search

Sponsor

Back
Top