[jira] [Commented] (PLUTO-781) PortletRequestDispatcherImpl forwards to incorrect path

"Neil Griffin (Jira)" <[email protected]> Tue, 17 Sep 2019 15:49:00 +0000 (UTC)
Newsgroups gmane.comp.jakarta.pluto.devel
Message-ID <[email protected]>
    [ https://issues.apache.org/jira/browse/PLUTO-781?page=3Dcom.atlassian.=
jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16931=
586#comment-16931586 ]=20

Neil Griffin commented on PLUTO-781:
------------------------------------

Hi [~riverbed2],

I tried your test portlet in Pluto 3.1.0 and found that the initial main.js=
p view wouldn't render at all.

As I looked more closely, I noticed the following in src/main/webapp/WEB-IN=
F/test-portlet.xml:

{code:title=3Dtest-portlet.xml}
    <bean id=3D"viewResolver" class=3D"org.springframework.web.servlet.view=
.InternalResourceViewResolver">
<!--         <property name=3D"cache" value=3D"true" /> -->
=09<property name=3D"viewClass" value=3D"org.springframework.web.servlet.vi=
ew.JstlView" />
        <property name=3D"prefix" value=3D"/WEB-INF/jsp/" />
        <property name=3D"suffix" value=3D".jsp" />
    </bean>
{code}

The problem is with the value of the {{viewClass}} attribute -- specificall=
y, PortletMVC4Spring has it's own {{PortletJstlView}} class that helps with=
 Pluto compatibility. When I tried the following, the portlet worked withou=
t any problems:

{code:title=3Dtest-portlet.xml}
    <bean id=3D"viewResolver" class=3D"org.springframework.web.servlet.view=
.InternalResourceViewResolver">
=09<property name=3D"viewClass" value=3D"com.liferay.portletmvc4spring.Port=
letJstlView" />
=09<property name=3D"contentType" value=3D"text/html;charset=3DUTF-8" />
        <property name=3D"prefix" value=3D"/WEB-INF/jsp/" />
        <property name=3D"suffix" value=3D".jsp" />
    </bean>
{code}

For more info, [see the Javdoc comments in the source of PortletJstlView.ja=
va|https://github.com/liferay/portletmvc4spring/blob/master/framework/src/m=
ain/java/com/liferay/portletmvc4spring/PortletJstlView.java#L30-L36]

Kind Regards,

Neil


> PortletRequestDispatcherImpl forwards to incorrect path
> -------------------------------------------------------
>
>                 Key: PLUTO-781
>                 URL: https://issues.apache.org/jira/browse/PLUTO-781
>             Project: Pluto
>          Issue Type: Bug
>          Components: portlet container
>    Affects Versions: 3.0.1
>         Environment: Pluto Container 3.0.1, Spring 4.0.9.RELEASE, Wildfly=
 14.0.1
>            Reporter: Steve Potter
>            Assignee: Neil Griffin
>            Priority: Major
>         Attachments: pluto-debug.txt, test-portlet-mvc.zip, test-portlet.=
zip
>
>
> When a serveResource method forwards to a servlet which then forwards to =
a jsp, the=C2=A0 HttpServletPortletRequestWrapper provides the path from th=
e first forward rather than the second forward and the jsp is not rendered.
> This is the process used by Spring Portlet MVC to locate JSP 'views' resu=
lting in the failure of all our portlets when trying to serve JSP's in resp=
onse to resource requests.
> The attached file contains a DEBUG log of the processing flow attempting =
to serve '/WEB-INF/jsp/resource2.jsp' in response to a resource request.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)