What about this approach:
@RequestMapping("/api/users/{userId}/favorites/{favoriteId}")
public String clientsByGym(@PathVariable("userId") String userId, @PathVariable("favoriteId") Long favoriteId) {
Integer theUserId = null;
if("me".equals(userId)) {
theUserId = AccessControlUtil.getUserId()
} else {
theUserId = Integer.valueOf(userId);
}
...
}
Basically, have your method accept String for userId and from there you can figure out if it is 'me' or an actual userId value. This way you don't have to mess with redirects. If you have to do this all the time, you could make a helper method like so:
public Integer getUserId(String userId) {
return "me".equals(userId) ? AccessControlUtil.getUserId() : Integer.valueOf(userId);
}