Browse Source

polishing

3.0.x
Juergen Hoeller 14 years ago
parent
commit
b558c62953
  1. 12
      org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/AnnotationMethodHandlerAdapter.java
  2. 4
      org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/mvc/annotation/DefaultAnnotationHandlerMapping.java

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

@ -237,16 +237,18 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator @@ -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 @@ -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());
}

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

@ -1,5 +1,5 @@ @@ -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 @@ -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");
}

Loading…
Cancel
Save