Reputation: 487
public class AnnotationInterceptor extends HandlerInterceptorAdapter implements InitializingBean {
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
HandlerMethod method = (HandlerMethod) handler;
Api methodAnnotation = method.getMethodAnnotation(Api.class);
if (methodAnnotation != null) {
//..
}
}
}
Gives me: 'HandlerMethod cannot be resolved to a type'
Haven't been able to track down any read up as to why.
Upvotes: 0
Views: 1866
Reputation: 4252
Add the following import:
import org.springframework.web.method.HandlerMethod;
Upvotes: 1