Class AccountController


  • @Controller
    public class AccountController
    extends java.lang.Object
    The controller that deals with account settings pages
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String emailGetFragment​(org.springframework.ui.Model model, boolean isAjax, AccountWrapper account)
      Handles GET requests to the email fragment of the account page
      java.lang.String emailPostFragment​(boolean isAjax, AccountWrapper account, @Valid AccountEmailForm accountEmailForm, org.springframework.validation.BindingResult result, org.springframework.ui.Model model)
      Handles the POST requests to the email fragment on the accounts page
      java.lang.String indexGet()
      Handles requests to the account page
      java.lang.String nameGetFragment​(org.springframework.ui.Model model, boolean isAjax, AccountWrapper account)
      Handles GET requests to the name fragment on the account page
      java.lang.String namePostFragment​(boolean isAjax, AccountWrapper account, @Valid AccountNameForm accountNameForm, org.springframework.validation.BindingResult result, org.springframework.ui.Model model)
      Handles POST requests to the name fragment on the account page
      java.lang.String passwordGetFragment​(org.springframework.ui.Model model, boolean isAjax)
      Handles GET requests to the password fragment on the account page
      java.lang.String passwordPostFragment​(boolean isAjax, AccountWrapper account, @Valid AccountPasswordForm accountPasswordForm, org.springframework.validation.BindingResult result, org.springframework.ui.Model model)
      Handles POST requests to the password fragment on the accounts page
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AccountController

        public AccountController()
    • Method Detail

      • indexGet

        @GetMapping("/account")
        public java.lang.String indexGet()
        Handles requests to the account page
        Returns:
        the path to the account page
      • nameGetFragment

        @GetMapping("/account/name")
        public java.lang.String nameGetFragment​(org.springframework.ui.Model model,
                                                @ModelAttribute("isAjax")
                                                boolean isAjax,
                                                @ModelAttribute("account")
                                                AccountWrapper account)
                                         throws NotAjaxRequest
        Handles GET requests to the name fragment on the account page
        Parameters:
        model - holder for model attributes
        isAjax - whether or not the request was ajax or not
        account - the account wrapper for the logged in user
        Returns:
        the path to the name fragment
        Throws:
        NotAjaxRequest - if the request was not an ajax one, the message is where to redirect the user to
      • namePostFragment

        @PostMapping("/account/name")
        public java.lang.String namePostFragment​(@ModelAttribute("isAjax")
                                                 boolean isAjax,
                                                 @ModelAttribute("account")
                                                 AccountWrapper account,
                                                 @Valid @ModelAttribute
                                                 @Valid AccountNameForm accountNameForm,
                                                 org.springframework.validation.BindingResult result,
                                                 org.springframework.ui.Model model)
                                          throws NotAjaxRequest
        Handles POST requests to the name fragment on the account page
        Parameters:
        isAjax - whether or not the request was ajax or not
        account - the account wrapper for the logged in user
        accountNameForm - the form that should be submitted in the request
        result - the results of the validation on the form above
        model - holder for model attributes
        Returns:
        the path to the name fragment
        Throws:
        NotAjaxRequest - if the request was not an ajax one, the message is where to redirect the user to
      • emailGetFragment

        @GetMapping("/account/email")
        public java.lang.String emailGetFragment​(org.springframework.ui.Model model,
                                                 @ModelAttribute("isAjax")
                                                 boolean isAjax,
                                                 @ModelAttribute("account")
                                                 AccountWrapper account)
                                          throws NotAjaxRequest
        Handles GET requests to the email fragment of the account page
        Parameters:
        model - holder for model attributes
        isAjax - whether or not the request was ajax or not
        account - the account wrapper for the logged in user
        Returns:
        the path to the email fragment
        Throws:
        NotAjaxRequest - if the request was not an ajax one, the message is where to redirect the user to
      • emailPostFragment

        @PostMapping("/account/email")
        public java.lang.String emailPostFragment​(@ModelAttribute("isAjax")
                                                  boolean isAjax,
                                                  @ModelAttribute("account")
                                                  AccountWrapper account,
                                                  @Valid @ModelAttribute
                                                  @Valid AccountEmailForm accountEmailForm,
                                                  org.springframework.validation.BindingResult result,
                                                  org.springframework.ui.Model model)
                                           throws NotAjaxRequest
        Handles the POST requests to the email fragment on the accounts page
        Parameters:
        isAjax - whether or not the request was ajax or not
        account - the account wrapper for the logged in user
        accountEmailForm - the form that should be submitted in the request
        result - the results of the validation on the form above
        model - holder for model attributes
        Returns:
        the path to the email fragment
        Throws:
        NotAjaxRequest - if the request was not an ajax one, the message is where to redirect the user to
      • passwordGetFragment

        @GetMapping("/account/password")
        public java.lang.String passwordGetFragment​(org.springframework.ui.Model model,
                                                    @ModelAttribute("isAjax")
                                                    boolean isAjax)
                                             throws NotAjaxRequest
        Handles GET requests to the password fragment on the account page
        Parameters:
        model - holder for model attributes
        isAjax - whether or not the request was ajax or not
        Returns:
        the path to the password fragment
        Throws:
        NotAjaxRequest - if the request was not an ajax one, the message is where to redirect the user to
      • passwordPostFragment

        @PostMapping("/account/password")
        public java.lang.String passwordPostFragment​(@ModelAttribute("isAjax")
                                                     boolean isAjax,
                                                     @ModelAttribute("account")
                                                     AccountWrapper account,
                                                     @Valid @ModelAttribute
                                                     @Valid AccountPasswordForm accountPasswordForm,
                                                     org.springframework.validation.BindingResult result,
                                                     org.springframework.ui.Model model)
                                              throws NotAjaxRequest
        Handles POST requests to the password fragment on the accounts page
        Parameters:
        isAjax - whether or not the request was ajax or not
        account - the account wrapper for the logged in user
        accountPasswordForm - the form that should be submitted in the request
        result - the results of the validation on the form above
        model - holder for model attributes
        Returns:
        the path to the password fragment
        Throws:
        NotAjaxRequest - if the request was not an ajax one, the message is where to redirect the user to