From 9f75eb4f445152d7e8a07029e2c1f4810cda075e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sun, 20 Sep 2009 21:12:41 +0000 Subject: [PATCH] do not check for action exception in resource phase (SPR-6129) --- .../web/portlet/DispatcherPortlet.java | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 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 05b0fe1c637..d784450b672 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 @@ -586,7 +586,7 @@ public class DispatcherPortlet extends FrameworkPortlet { * @throws BeansException if initialization failed * @see org.springframework.context.ApplicationContext#getAutowireCapableBeanFactory() */ - protected Object createDefaultStrategy(ApplicationContext context, Class clazz) throws BeansException { + protected Object createDefaultStrategy(ApplicationContext context, Class clazz) throws BeansException { return context.getAutowireCapableBeanFactory().createBean(clazz); } @@ -700,7 +700,7 @@ public class DispatcherPortlet extends FrameworkPortlet { int interceptorIndex = -1; try { - ModelAndView mv = null; + ModelAndView mv; try { // Check for forwarded exception from the action phase PortletSession session = request.getPortletSession(false); @@ -806,23 +806,8 @@ public class DispatcherPortlet extends FrameworkPortlet { int interceptorIndex = -1; try { - ModelAndView mv = null; + ModelAndView mv; try { - // Check for forwarded exception from the action phase - PortletSession session = request.getPortletSession(false); - if (session != null) { - if (request.getParameter(ACTION_EXCEPTION_RENDER_PARAMETER) != null) { - Exception ex = (Exception) session.getAttribute(ACTION_EXCEPTION_SESSION_ATTRIBUTE); - if (ex != null) { - logger.debug("Render phase found exception caught during action phase - rethrowing it"); - throw ex; - } - } - else { - session.removeAttribute(ACTION_EXCEPTION_SESSION_ATTRIBUTE); - } - } - // Determine handler for the current request. mappedHandler = getHandler(request, false); if (mappedHandler == null || mappedHandler.getHandler() == null) { @@ -1063,7 +1048,7 @@ public class DispatcherPortlet extends FrameworkPortlet { * @throws Exception if there's a problem rendering the view */ protected void render(ModelAndView mv, PortletRequest request, MimeResponse response) throws Exception { - View view = null; + View view; if (mv.isReference()) { // We need to resolve the view name. view = resolveViewName(mv.getViewName(), mv.getModelInternal(), request);