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:
  • Constructor Details

    • JKAccountWebController

      public JKAccountWebController()
  • Method Details

    • getEmail

      public String getEmail()
      This method retrieves the user email address.
      Returns:
      the user email address.
    • setEmail

      public void setEmail(String email)
      This method sets the user email address to the provided value.
      Parameters:
      email - Specifies the new user email address.
    • getPassword

      public String getPassword()
      This method retrieves the user password.
      Returns:
      the user password.
    • setPassword

      public void setPassword(String password)
      This method sets the user password to the provided value.
      Parameters:
      password - Specifies the new user password.
    • getFirstName

      public String getFirstName()
      This method retrieves the user first name.
      Returns:
      the user first name.
    • setFirstName

      public void setFirstName(String firstName)
      This method sets the user first name to the provided value.
      Parameters:
      firstName - Specifies the new user first name.
    • getLastName

      public String getLastName()
      This method retrieves the user last name.
      Returns:
      the user last name.
    • setLastName

      public void setLastName(String lastName)
      This method sets the user last name.
      Parameters:
      lastName - Specifies the new user last name.
    • create

      public String create() throws jakarta.servlet.ServletException
      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

      public String 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.