1 16 17 package org.springframework.web.portlet.handler; 18 19 import javax.portlet.ActionRequest; 20 import javax.portlet.ActionResponse; 21 22 47 public class ParameterMappingInterceptor extends HandlerInterceptorAdapter { 48 49 50 public final static String DEFAULT_PARAMETER_NAME = "action"; 51 52 private String parameterName = DEFAULT_PARAMETER_NAME; 53 54 55 58 public void setParameterName(String parameterName) { 59 this.parameterName = (parameterName != null ? parameterName : DEFAULT_PARAMETER_NAME); 60 } 61 62 63 67 public boolean preHandleAction(ActionRequest request, ActionResponse response, Object handler) { 68 String mappingParameter = request.getParameter(this.parameterName); 69 if (mappingParameter != null) { 70 response.setRenderParameter(parameterName, mappingParameter); 71 } 72 return true; 73 } 74 75 } 76 | Popular Tags |