I currently do the following in my Spring MVC project alot:
protected String onSubmit(UploadMessagesCommand command, Principal principal) throws Exception {
MyCustomUserDetailsImpl user = (MyCustomUserDetailsImpl) principal;
//etc
}
Is there a better way of getting this to work, so I can replace the principal argument with a user argument and avoid the cast?
I resiliently noticed that you can use the User(Details) directly.