• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 27861
196
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.
 
Would you like to try a free sample? Today we are featuring tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic