polishing

This commit is contained in:
Juergen Hoeller
2011-12-05 21:21:32 +00:00
parent d64dd1943f
commit b558c62953
2 changed files with 9 additions and 7 deletions

View File

@@ -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());
}

View File

@@ -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");
}