This is my @RequestMapping
annotation:
@RequestMapping({\"/loginBadCredentials\", \"/loginUserDisabled\", \"/loginUserNumberExceeded\"})
public
Add HttpServletRequest
as your parameters and use it to find the current request path.
Update: Spring also provides RequestContextHolder
:
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
String currentReqUri = attributes.getRequest().getRequestURI();
In my opinion, first approach is better and a little more testable.