From bd05b046d0f2e893e48458932054e5109daf9b7a Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 6 Sep 2010 23:11:11 +0000 Subject: [PATCH] reverted shortening of action exception parameter value; fixed multipart test (SPR-7495) --- .../web/portlet/DispatcherPortlet.java | 2 +- .../ComplexPortletApplicationContext.java | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/DispatcherPortlet.java b/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/DispatcherPortlet.java index c75b7f6269..7525f38ccd 100644 --- a/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/DispatcherPortlet.java +++ b/org.springframework.web.portlet/src/main/java/org/springframework/web/portlet/DispatcherPortlet.java @@ -1033,7 +1033,7 @@ public class DispatcherPortlet extends FrameworkPortlet { response.setRenderParameter(paramName, paramValues); } } - response.setRenderParameter(ACTION_EXCEPTION_RENDER_PARAMETER, Boolean.TRUE.toString()); + response.setRenderParameter(ACTION_EXCEPTION_RENDER_PARAMETER, ex.toString()); request.getPortletSession().setAttribute(ACTION_EXCEPTION_SESSION_ATTRIBUTE, ex); } diff --git a/org.springframework.web.portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java b/org.springframework.web.portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java index 1c3aafd313..dec4b9e1cf 100644 --- a/org.springframework.web.portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java +++ b/org.springframework.web.portlet/src/test/java/org/springframework/web/portlet/ComplexPortletApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 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. @@ -46,10 +46,14 @@ import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.core.Ordered; +import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.portlet.MockPortletConfig; import org.springframework.mock.web.portlet.MockPortletContext; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; import org.springframework.web.multipart.MaxUploadSizeExceededException; import org.springframework.web.multipart.MultipartException; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.portlet.bind.PortletRequestBindingException; import org.springframework.web.portlet.context.PortletRequestHandledEvent; import org.springframework.web.portlet.context.StaticPortletApplicationContext; @@ -67,8 +71,6 @@ import org.springframework.web.portlet.multipart.MultipartActionRequest; import org.springframework.web.portlet.multipart.PortletMultipartResolver; import org.springframework.web.portlet.mvc.Controller; import org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter; -import org.springframework.util.MultiValueMap; -import org.springframework.util.LinkedMultiValueMap; /** * @author Juergen Hoeller @@ -475,10 +477,10 @@ public class ComplexPortletApplicationContext extends StaticPortletApplicationCo throw new IllegalStateException("Already resolved"); } request.setAttribute("resolved", Boolean.TRUE); - MultiValueMap files = new LinkedMultiValueMap(); - files.set("someFile", "someFile"); - Map params = new HashMap(); - params.put("someParam", "someParam"); + MultiValueMap files = new LinkedMultiValueMap(); + files.set("someFile", new MockMultipartFile("someFile", "someContent".getBytes())); + Map params = new HashMap(); + params.put("someParam", new String[] {"someParam"}); return new DefaultMultipartActionRequest(request, files, params); } -- GitLab