Skip to content

Commit 126116e

Browse files
committed
DispatcherPortlet never uses a resource forward on Liferay
Issue: SPR-10791 (cherry picked from commit 9c157ea)
1 parent 1ea218c commit 126116e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -1187,7 +1187,11 @@ protected void doRender(View view, Map model, PortletRequest request, MimeRespon
11871187
protected void doDispatch(PortletRequestDispatcher dispatcher, PortletRequest request, MimeResponse response)
11881188
throws Exception {
11891189

1190-
if (PortletRequest.RESOURCE_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE))) {
1190+
// In general, we prefer a forward for resource responses, in order to have full Servlet API
1191+
// support in the target resource (e.g. on uPortal). However, on Liferay, a resource forward
1192+
// displays an empty page, so we have to resort to an include there...
1193+
if (PortletRequest.RESOURCE_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE)) &&
1194+
!dispatcher.getClass().getName().startsWith("com.liferay")) {
11911195
dispatcher.forward(request, response);
11921196
}
11931197
else {

0 commit comments

Comments
 (0)