-
@ControllerAdvice() public final class CustomPrincipalThis is a class that can do conversions on parameters that get autowired into controllers.
-
-
Constructor Summary
Constructors Constructor Description CustomPrincipal()
-
Method Summary
Modifier and Type Method Description final UsergetPrincipal(Principal principal)This Model Attribute casts the Principal that Spring autowires into our custom User class - the properties are the same, but the ID is a UUID instead of a string -
-
Method Detail
-
getPrincipal
@ModelAttribute() final User getPrincipal(Principal principal)
This Model Attribute casts the Principal that Spring autowires into our custom User class - the properties are the same, but the ID is a UUID instead of a string
-
-
-
-