Forums Register Login

restrict access to a static web site folder

+Pie Number of slices to send: Send
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
I've googled and found that I cant put the folder on web-inf folder but how do I "redirect" the user on the "index.html" ?

grateful for anyone taking time to reply
+Pie Number of slices to send: Send
Why not just use a filter?
+Pie Number of slices to send: Send
 

mike lan wrote:
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


Ok. I just posted this in another thread. If you are using Tomcat, you can use the security-constraint to force login. Look in the Tomcat manager webapp web.xml for an example.


but only though a login and password page compared with login and md5 password on a postgresql table


Now you are talking about possibly creating a DataSourceRealm, if you want to store the user/password in a database. Not impossible. Look at the Tomcat docs: http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#DataSourceRealm


I've googled and found that I cant put the folder on web-inf folder but how do I "redirect" the user on the "index.html" ?


If you want to redirect, you can always use a meta-refresh tag in a empty index.html that redirects to some other page, but you don't need this if you use the security-constraint option.
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:Why not just use a filter?



sorry for my ignorance , what's a filter ? a example or link ? if possible

+Pie Number of slices to send: Send
 

mike lan wrote:
sorry for my ignorance , what's a filter ? a example or link ? if possible



Filters in Java allow you centralized management of tasks such as authentication, compression, logging, image conversion, and localization of web content. Use can use a filter mapping to the particular url. For example,

So, for the specified url pattens, the specified filter will be invoked. Then within the filter, you can authenticate the user, and if he/she already authenticated, he/she can proceed. Otherwise, redirect to login forms. Here, you can use what ever authentication method.
grapes are vegan food pellets. Eat this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1736 times.
Similar Threads
jsp help
restrict access to a static web site folder
Free XML book
How specify the next page after form log on.
Login to a ssl enabled site using encrypted password
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:49:26.