• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

restrict access to a static web site folder

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

I have a web site in static html files contained in a folder, that I want not to be public seen to anyone visiting the site,
but only though a login and password page compared with login and md5 password on a postgresql table

grateful for anyone taking time to reply




 
Saloon Keeper
Posts: 28468
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The easiest way to do that is if you're using the J2EE standard container-managed security system. Under that mechanism, you simply add the URL pattern to the web.xml security context and define a suitable role for users who are allowed access to those files. You can then configure one of the database-backed security Realms to check login credentials against the PostgreSQL database. Of course, you also have to have defined login/loginfail form pages if you're doing form-based authentication.

I use this on a routine basis, although not usually for file access. A common usage is that I put all my admin resources under an "admin" folder and restrict access to them to users granted the "admin" security role.
 
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic