Class JKAccountWebController
java.lang.Object
com.jk.web.faces.controllers.JKWebController
com.jk.webstack.security.controllers.JKAccountWebController
- All Implemented Interfaces:
Serializable
@Named("accountController")
@RequestScoped
public class JKAccountWebController
extends JKWebController
This class is responsible for handling user account-related operations in a
web application.
It allows users to create new accounts and reset their passwords.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
- See Also:
-
Field Summary
Fields inherited from class com.jk.web.faces.controllers.JKWebController
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()
This method create a new user account.getEmail()
This method retrieves the user email address.This method retrieves the user first name.This method retrieves the user last name.This method retrieves the user password.boolean
This method check if the account creation was successful.boolean
This method check if it is suggested to reset the password due to an existing account.This method reset the user's account password.void
This method sets the user email address to the provided value.void
setFirstName
(String firstName) This method sets the user first name to the provided value.void
setLastName
(String lastName) This method sets the user last name.void
setPassword
(String password) This method sets the user password to the provided value.void
setSuggestReset
(boolean suggestReset) This method sets whether it is suggested to reset the password due to an existing account.Methods inherited from class com.jk.web.faces.controllers.JKWebController
context, error, error, executeAsyc, getContextParam, getContextPath, getFromAppliaction, getFromRequest, getFromSession, getParam, getParamterFromRequest, getRoles, getTenantId, getUserName, getViewScopedManagedBean, handleException, init, isDebug, isDevelopmentMode, logAction, postConstruct, redirect, request, session, showErrorDialogMessage, showInfoDialogMessage, showWarningDialogMessage, success, success, suggestName, updateUi, warning
-
Constructor Details
-
JKAccountWebController
public JKAccountWebController()
-
-
Method Details
-
getEmail
This method retrieves the user email address.- Returns:
- the user email address.
-
setEmail
This method sets the user email address to the provided value.- Parameters:
email
- Specifies the new user email address.
-
getPassword
This method retrieves the user password.- Returns:
- the user password.
-
setPassword
This method sets the user password to the provided value.- Parameters:
password
- Specifies the new user password.
-
getFirstName
This method retrieves the user first name.- Returns:
- the user first name.
-
setFirstName
This method sets the user first name to the provided value.- Parameters:
firstName
- Specifies the new user first name.
-
getLastName
This method retrieves the user last name.- Returns:
- the user last name.
-
setLastName
This method sets the user last name.- Parameters:
lastName
- Specifies the new user last name.
-
create
This method create a new user account.This method logs the action, calls the service to create the account, and handles exceptions.
- Returns:
- null.
- Throws:
jakarta.servlet.ServletException
- if there's an issue with servlet handling.
-
resetAccount
This method reset the user's account password.This method logs the action, calls the service to reset the account, and handles exceptions.
- Returns:
- null.
-
isCreated
public boolean isCreated()This method check if the account creation was successful.- Returns:
- true, if the account was successfully created, false otherwise.
-
isSuggestReset
public boolean isSuggestReset()This method check if it is suggested to reset the password due to an existing account.- Returns:
- true, if it is suggested to reset the password, false otherwise.
-
setSuggestReset
public void setSuggestReset(boolean suggestReset) This method sets whether it is suggested to reset the password due to an existing account.- Parameters:
suggestReset
- true to suggest resetting the password, false otherwise.
-