Using Spring Boot, I have a couple methods in my RegisterController
which handles new user registration.
The createNewUser
method is responsible for saving the new user to the database and sending a confirmation e-mail containing a link that has a unique token.
The confirmUser
method handles processing the GET request for the confirmation link.
Is there a way for the createNewUser
method to get the @RequestMapping
value assigned to confirmUser
? I'd like to use this value to generate the confirmation link instead of hard coding it.
// Process form input data
@RequestMapping(value = "/register", method = RequestMethod.POST)
public ModelAndView createNewUser(@Valid User user, BindingResult bindingResult) {
}
// Process confirmation link
// Link in confirmation e-mail will be /registerConfirmation?token=UUID
@RequestMapping(value="/registerConfirmation", method = RequestMethod.GET)
public ModelAndView confirmUser( @RequestParam("token") String token) {
}