public static Object getControllerForAction(String actionURL) { ApplicationContext context = getApplicationContext(); AnnotationHandlerMapping mapping = (AnnotationHandlerMapping) context.getBean("annotationMapper"); PathMatcher pathMatcher = mapping.getPathMatcher(); for (Object key: mapping.getHandlerMap().keySet()) { if (pathMatcher.match((String) key, actionURL)){ return mapping.getHandlerMap().get(key); } } return null; } ApplicationContext context = getApplicationContext(); AnnotationHandlerMapping mapping = (AnnotationHandlerMapping) context.getBean("annotationMapper"); Object controller = mapping.getHandler().getHandler();