Skip to content

Commit 66b4eb1

Browse files
committed
Portlet MVC annotation mapping allows for distributing action names across controllers (SPR-7685)
1 parent bea5016 commit 66b4eb1

File tree

3 files changed

+210
-88
lines changed

3 files changed

+210
-88
lines changed

org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,18 @@ public void setCustomArgumentResolvers(WebArgumentResolver[] argumentResolvers)
237237
}
238238

239239
/**
240-
* Set a custom ModelAndViewResolvers to use for special method return types. Such a custom ModelAndViewResolver will kick
241-
* in first, having a chance to resolve an return value before the standard ModelAndView handling kicks in.
240+
* Set a custom ModelAndViewResolvers to use for special method return types.
241+
* Such a custom ModelAndViewResolver will kick in first, having a chance to
242+
* resolve an return value before the standard ModelAndView handling kicks in.
242243
*/
243244
public void setCustomModelAndViewResolver(ModelAndViewResolver customModelAndViewResolver) {
244245
this.customModelAndViewResolvers = new ModelAndViewResolver[]{customModelAndViewResolver};
245246
}
246247

247248
/**
248-
* Set one or more custom ModelAndViewResolvers to use for special method return types. Any such custom ModelAndViewResolver
249-
* will kick in first, having a chance to resolve an return value before the standard ModelAndView handling kicks in.
249+
* Set one or more custom ModelAndViewResolvers to use for special method return types.
250+
* Any such custom ModelAndViewResolver will kick in first, having a chance to
251+
* resolve an return value before the standard ModelAndView handling kicks in.
250252
*/
251253
public void setCustomModelAndViewResolvers(ModelAndViewResolver[] customModelAndViewResolvers) {
252254
this.customModelAndViewResolvers = customModelAndViewResolvers;
@@ -440,11 +442,11 @@ protected boolean isHandlerMethod(Method method) {
440442
return true;
441443
}
442444
RequestMappingInfo mappingInfo = new RequestMappingInfo();
443-
RequestMapping requestMapping = AnnotationUtils.findAnnotation(method, RequestMapping.class);
444445
ActionMapping actionMapping = AnnotationUtils.findAnnotation(method, ActionMapping.class);
445446
RenderMapping renderMapping = AnnotationUtils.findAnnotation(method, RenderMapping.class);
446447
ResourceMapping resourceMapping = AnnotationUtils.findAnnotation(method, ResourceMapping.class);
447448
EventMapping eventMapping = AnnotationUtils.findAnnotation(method, EventMapping.class);
449+
RequestMapping requestMapping = AnnotationUtils.findAnnotation(method, RequestMapping.class);
448450
if (actionMapping != null) {
449451
mappingInfo.initPhaseMapping(PortletRequest.ACTION_PHASE, actionMapping.value(), actionMapping.params());
450452
}

0 commit comments

Comments
 (0)