Class BroadleafRegisterController

java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.core.web.controller.account.BroadleafRegisterController
Direct Known Subclasses:
BroadleafOauthRegisterController

public class BroadleafRegisterController extends org.broadleafcommerce.common.web.controller.BroadleafAbstractController
The controller responsible for registering a customer.

Uses a component registered with the name blCustomerValidator to perform validation of the submitted customer.

Uses the property "useEmailForLogin" to determine if the username should be defaulted to the email address if no username is supplied.

Author:
apazzolini, bpolster
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.broadleafcommerce.profile.core.service.CustomerService
     
    protected org.broadleafcommerce.profile.web.core.service.login.LoginService
     
    protected org.broadleafcommerce.core.order.service.OrderService
     
    protected org.broadleafcommerce.profile.web.controller.validator.RegisterCustomerValidator
     
    protected static String
     
    protected static String
     
    protected org.broadleafcommerce.profile.web.core.service.register.RegistrationService
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the view that will be returned from this controller when the registration is successful.
    Returns the view that will be used to display the registration page.
    org.broadleafcommerce.profile.web.core.form.RegisterCustomerForm
     
    boolean
     
    processRegister(org.broadleafcommerce.profile.web.core.form.RegisterCustomerForm registerCustomerForm, org.springframework.validation.BindingResult errors, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model)
     
    register(org.broadleafcommerce.profile.web.core.form.RegisterCustomerForm registerCustomerForm, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model)
     
    void
    setUseEmailForLogin(boolean useEmailForLogin)
     

    Methods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController

    addDeepLink, getContextPath, isAjaxRequest, jsonResponse

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • registerSuccessView

      protected static String registerSuccessView
    • registerView

      protected static String registerView
    • useEmailForLogin

      @Value("${use.email.for.site.login:true}") protected boolean useEmailForLogin
    • registrationService

      protected org.broadleafcommerce.profile.web.core.service.register.RegistrationService registrationService
    • customerService

      protected org.broadleafcommerce.profile.core.service.CustomerService customerService
    • registerCustomerValidator

      protected org.broadleafcommerce.profile.web.controller.validator.RegisterCustomerValidator registerCustomerValidator
    • loginService

      protected org.broadleafcommerce.profile.web.core.service.login.LoginService loginService
    • orderService

      protected org.broadleafcommerce.core.order.service.OrderService orderService
  • Constructor Details

    • BroadleafRegisterController

      public BroadleafRegisterController()
  • Method Details

    • register

      public String register(org.broadleafcommerce.profile.web.core.form.RegisterCustomerForm registerCustomerForm, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model)
    • processRegister

      public String processRegister(org.broadleafcommerce.profile.web.core.form.RegisterCustomerForm registerCustomerForm, org.springframework.validation.BindingResult errors, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, org.springframework.ui.Model model) throws org.broadleafcommerce.common.exception.ServiceException, org.broadleafcommerce.core.pricing.service.exception.PricingException
      Throws:
      org.broadleafcommerce.common.exception.ServiceException
      org.broadleafcommerce.core.pricing.service.exception.PricingException
    • initCustomerRegistrationForm

      public org.broadleafcommerce.profile.web.core.form.RegisterCustomerForm initCustomerRegistrationForm()
    • isUseEmailForLogin

      public boolean isUseEmailForLogin()
    • setUseEmailForLogin

      public void setUseEmailForLogin(boolean useEmailForLogin)
    • getRegisterSuccessView

      public String getRegisterSuccessView()
      Returns the view that will be returned from this controller when the registration is successful. The success view should be a redirect (e.g. start with "redirect:" since this will cause the entire SpringSecurity pipeline to be fulfilled.

      By default, returns "redirect:/"

      Returns:
      the register success view
    • getRegisterView

      public String getRegisterView()
      Returns the view that will be used to display the registration page.

      By default, returns "/register"

      Returns:
      the register view