I have a Spring MVC REST channel:
@Controller @RequestMapping("/rest") public class REST {
and I have my method:
@RequestMapping(value = "/doSomething") public @ResponseBody DoSomethingResultDTO doSomething( @RequestBody DoSomethingRequestDTO)
Now I need the name of the user who is logged in. Normally I could do this with a method
HttpServletRequest.getUserPrincipal()
but how to get it? I have annotations for headers ( @RequestHeader ) or even cookies ( @CookieValue ). But how can I get Principal in my method?
Danubian sailor
source share