Web Form based login in Java
Posted
by BrunoLM
on Stack Overflow
See other posts from Stack Overflow
or by BrunoLM
Published on 2010-05-19T23:01:10Z
Indexed on
2010/05/19
23:10 UTC
Read the original article
Hit count: 198
java
|authentication
How can I block access to the site if a user is not logged in?
Under web.xml > Security I checked Form authentication then I selected Login and Error page, but I don't know how to block the access and redirect the user to the login page.
Do I need a filter? If so, how can I get the login url I specified?
And how should I call the validation method? I saw in some examples this code
<form method=post action="j_security_check">
<input type="text" name="j_username" />
<input type="password" name="j_password" />
</form>
What does it do?
© Stack Overflow or respective owner