Browse Source

DispatcherPortlet never uses a resource forward on Liferay

Issue: SPR-10791
pull/427/merge
Juergen Hoeller 11 years ago
parent
commit
9c157ea073
  1. 8
      spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/DispatcherPortlet.java

8
spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/DispatcherPortlet.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
@ -1187,7 +1187,11 @@ public class DispatcherPortlet extends FrameworkPortlet { @@ -1187,7 +1187,11 @@ public class DispatcherPortlet extends FrameworkPortlet {
protected void doDispatch(PortletRequestDispatcher dispatcher, PortletRequest request, MimeResponse response)
throws Exception {
if (PortletRequest.RESOURCE_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE))) {
// In general, we prefer a forward for resource responses, in order to have full Servlet API
// support in the target resource (e.g. on uPortal). However, on Liferay, a resource forward
// displays an empty page, so we have to resort to an include there...
if (PortletRequest.RESOURCE_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE)) &&
!dispatcher.getClass().getName().startsWith("com.liferay")) {
dispatcher.forward(request, response);
}
else {

Loading…
Cancel
Save