Skip to content

Commit b558c62

Browse files
committed
polishing
1 parent d64dd19 commit b558c62

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
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
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2010 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -186,7 +186,7 @@ else if (ann instanceof EventMapping) {
186186
if (typeMapping != null) {
187187
modeKeys = typeMapping.value();
188188
}
189-
else {
189+
if (modeKeys.length == 0) {
190190
throw new IllegalStateException(
191191
"No portlet mode mappings specified - neither at type nor at method level");
192192
}

0 commit comments

Comments
 (0)