public class SomeInterceptor extends HandlerInterceptorAdapter{ @Override public boolean preHandle(final HttpServletRequest request,final HttpServletResponse response,final Object handler) throws Exception { /*Assume the URI is user/{userId}/post/{postId} and our interceptor is registered for this URI. * This map would then be a map of two elements,with keys 'userId' and 'postId' */ final Map pathVariables = (Map) request .getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); //You'll have to convert the String to Long or Integer or any other type manually. For instance.. //final Integer userId = Integer.valueOf(pathVariables.get("userId")); //final Long postId = Long.valueOf(pathVariables.get("postId")); } }