Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
Add Comment
Please, Sign In to add comment