public class LoginUserController extends Object
| Constructor and Description |
|---|
LoginUserController() |
| Modifier and Type | Method and Description |
|---|---|
void |
doLogin()
Login petition.
|
void |
doLogout()
Logout petition.
|
Principal |
getCurrentUser()
Getter method of currentUserPrincipal variable.
|
String |
getErrorMessage()
Getter method of errorMessage global variable.
|
String |
getLogin()
Getter method of login variable.
|
String |
getPassword()
Getter method of password variable.
|
boolean |
isAdmin()
Checks if the current user is an
admin. |
boolean |
isAnonymous()
Checks if the current user is the "anonymous" user.
|
boolean |
isError()
Getter method of error global variable.
|
void |
redirectIfAnonymous()
Forces a page redirect to the index if the current user is the anonymous
user.
|
void |
redirectIfNotAdmin()
Forces a page redirect to the index if the current user is not an
admin user.
|
void |
redirectIfNotAnonymous()
Forces a page redirect to the index if the current user is not an
anonymous user.
|
void |
setLogin(String login)
Setter method of login variable.
|
void |
setPassword(String password)
Setter method of password variable.
|
public void doLogin()
throws IOException
IOException - if an input/output error occurspublic void doLogout()
throws javax.servlet.ServletException,
IOException
javax.servlet.ServletException - if an error happens while logging out the user.IOException - if an error happens on the redirection.public Principal getCurrentUser()
public String getLogin()
public void setLogin(String login)
login - login global variable.public String getPassword()
public void setPassword(String password)
password - password global variable.public boolean isError()
public String getErrorMessage()
public boolean isAnonymous()
true if the current user is the "anonymous" user.
false otherwise.public boolean isAdmin()
admin.true if the current identified user is an administrator,
false otherwise.public void redirectIfAnonymous()
throws IOException
IOException - if an error happens while redirecting.public void redirectIfNotAnonymous()
throws IOException
IOException - if an error happens while redirecting.public void redirectIfNotAdmin()
throws IOException
IOException - if an error happens while redirecting.Copyright © 2016. All rights reserved.