diff --git a/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java b/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java index c9953871efe..abdd7a322a0 100644 --- a/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java +++ b/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java @@ -237,16 +237,18 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator } /** - * Set a custom ModelAndViewResolvers to use for special method return types. Such a custom ModelAndViewResolver will kick - * in first, having a chance to resolve an return value before the standard ModelAndView handling kicks in. + * Set a custom ModelAndViewResolvers to use for special method return types. + * Such a custom ModelAndViewResolver will kick in first, having a chance to + * resolve an return value before the standard ModelAndView handling kicks in. */ public void setCustomModelAndViewResolver(ModelAndViewResolver customModelAndViewResolver) { this.customModelAndViewResolvers = new ModelAndViewResolver[]{customModelAndViewResolver}; } /** - * Set one or more custom ModelAndViewResolvers to use for special method return types. Any such custom ModelAndViewResolver - * will kick in first, having a chance to resolve an return value before the standard ModelAndView handling kicks in. + * Set one or more custom ModelAndViewResolvers to use for special method return types. + * Any such custom ModelAndViewResolver will kick in first, having a chance to + * resolve an return value before the standard ModelAndView handling kicks in. */ public void setCustomModelAndViewResolvers(ModelAndViewResolver[] customModelAndViewResolvers) { this.customModelAndViewResolvers = customModelAndViewResolvers; @@ -440,11 +442,11 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator return true; } RequestMappingInfo mappingInfo = new RequestMappingInfo(); - RequestMapping requestMapping = AnnotationUtils.findAnnotation(method, RequestMapping.class); ActionMapping actionMapping = AnnotationUtils.findAnnotation(method, ActionMapping.class); RenderMapping renderMapping = AnnotationUtils.findAnnotation(method, RenderMapping.class); ResourceMapping resourceMapping = AnnotationUtils.findAnnotation(method, ResourceMapping.class); EventMapping eventMapping = AnnotationUtils.findAnnotation(method, EventMapping.class); + RequestMapping requestMapping = AnnotationUtils.findAnnotation(method, RequestMapping.class); if (actionMapping != null) { mappingInfo.initPhaseMapping(PortletRequest.ACTION_PHASE, actionMapping.value(), actionMapping.params()); } diff --git a/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/DefaultAnnotationHandlerMapping.java b/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/DefaultAnnotationHandlerMapping.java index dcf47d2b8db..651a8892fe4 100644 --- a/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/DefaultAnnotationHandlerMapping.java +++ b/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/DefaultAnnotationHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -186,7 +186,7 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp if (typeMapping != null) { modeKeys = typeMapping.value(); } - else { + if (modeKeys.length == 0) { throw new IllegalStateException( "No portlet mode mappings specified - neither at type nor at method level"); }