It's not a secret anymore!
The moose likes Servlets and the fly likes Restrict Users to Download PDF Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Restrict Users to Download PDF" Watch "Restrict Users to Download PDF" New topic
Author

Restrict Users to Download PDF

ankit maini
Greenhorn

Joined: Feb 08, 2011
Posts: 25

Hello

I am making a small project in jsp and servlet. There are three users visitor member and admin in my website. Admin Upload the PDF File into to folders
1st in myWebApp\pdf\member for Members
2nd in myWebApp\pdf\visitor for visitor

Now I want visitor to restrict to view or download the member's pdf.

How can I do this ?
Is it possible with filters if yes then how??
Is there any another way ??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
Since the directories are different you could set up servlet security as defined in the web.xml file. That would restricting the pdf\member directory to logged-in users.


Android appsImageJ pluginsJava web charts
ankit maini
Greenhorn

Joined: Feb 08, 2011
Posts: 25

How to apply the security in web.xml could you please specify .
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

Did you read the security section in the Servlet Specification? If so, what part are you having trouble with? if not, then that's your next step.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Restrict Users to Download PDF
 
Similar Threads
How will I restrict incoming mails from specific users in Unix?
Problem While Enabling Authentication
Cache file(pdf) in user's computer using Servlet-Cookie, or Session
JAAS precedence for role based authorizations in container managed authorizations
Restrict a PDF File