You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by at...@apache.org on 2012/08/09 20:26:30 UTC

svn commit: r1371360 - /rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMapping.java

Author: ate
Date: Thu Aug  9 18:26:29 2012
New Revision: 1371360

URL: http://svn.apache.org/viewvc?rev=1371360&view=rev
Log:
RAVE-698: more fixes and cleanup

Modified:
    rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMapping.java

Modified: rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMapping.java
URL: http://svn.apache.org/viewvc/rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMapping.java?rev=1371360&r1=1371359&r2=1371360&view=diff
==============================================================================
--- rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMapping.java (original)
+++ rave/sandbox/content-services/rave-web-hmvc/src/main/java/org/apache/rave/portal/web/hmvc/HmvcHandlerMethodMapping.java Thu Aug  9 18:26:29 2012
@@ -29,7 +29,6 @@ import org.springframework.core.annotati
 import org.springframework.util.ClassUtils;
 import org.springframework.util.ObjectUtils;
 import org.springframework.util.ReflectionUtils.MethodFilter;
-import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.method.HandlerMethod;
 import org.springframework.web.method.HandlerMethodSelector;
@@ -52,11 +51,6 @@ public class HmvcHandlerMethodMapping ex
         return AnnotationUtils.findAnnotation(method, Hmvc.class) != null;
     }
 
-    @Override
-    protected boolean isHandler(Class<?> beanType) {
-        return super.isHandler(beanType) && !getAnnotatedMethods(beanType, Hmvc.class).isEmpty();
-    }
-
     private Class<?> getBeanType(Object handler) {
         Class<?> beanType = (handler instanceof String) ?
                 getApplicationContext().getType((String) handler) : handler.getClass();
@@ -64,17 +58,6 @@ public class HmvcHandlerMethodMapping ex
         return ClassUtils.getUserClass(beanType);
     }
 
-    protected boolean isEmptyOrRootPathSpecified(RequestMapping requestMapping) {
-        boolean foundRootPath = false;
-        for (String value : requestMapping.value()) {
-            value = value.trim();
-            if (value.isEmpty() == "/".equals(value)) {
-                foundRootPath = true;
-            }
-        }
-        return foundRootPath;
-    }
-
     protected boolean isDefaultGetRequestMapping(Method method, Class<?> userType) {
         RequestMappingInfo mapping = getMappingForMethod(method, userType);
         boolean defaultGetRequestMapping = mapping != null;
@@ -100,7 +83,7 @@ public class HmvcHandlerMethodMapping ex
 
         Set<Method> methods = HandlerMethodSelector.selectMethods(userType, new MethodFilter() {
             public boolean matches(Method method) {
-                return isDefaultGetRequestMapping(method, userType);
+                return isHmvcMethod(method) && isDefaultGetRequestMapping(method, userType);
             }
         });
         return methods.isEmpty() ? null : methods.iterator().next();
@@ -108,8 +91,8 @@ public class HmvcHandlerMethodMapping ex
 
     @Override
     protected void registerHandlerMethod(Object handler, Method method, RequestMappingInfo mapping) {
+        registerHandler(handler, method, mapping);
         if (!isHmvcMethod(method)) {
-            registerHandler(handler, method, mapping);
             HmvcHandlerMethod handlerMethod = getHmvcHandlerMethod(handler, method, true);
             if (handlerMethod != null) {
                 hmvcHandlerMethods.put(super.getHandlerMethods().get(mapping), handlerMethod);