Foren
ActionURL ignores jspPage param in getting started tutorial?
David Rutherford, geändert vor 12 Jahren.
ActionURL ignores jspPage param in getting started tutorial?
New Member Beiträge: 2 Beitrittsdatum: 19.07.11 Neueste Beiträge
Hi,
Any help would be appreciated. I'm about at my wits end here.
I've been following the Portlet Development section in the developer's guide and when I get to the section about understanding the two phases of portlet execution the portlet isn't behaving the way the guide says it should. (Deveoper's Guide portlet tutorial).
After switching the renderURL tag to an actionURL & implementing the processAction method in the portlet-class, I can still modify the greeting message on /edit.jsp like in the previous step, but when I submit the form the page that's displayed is /view.jsp, not edit.jsp like the guide says.
edit.jsp snippet:
Is this normal behavior?
Thanks,
David
Any help would be appreciated. I'm about at my wits end here.
I've been following the Portlet Development section in the developer's guide and when I get to the section about understanding the two phases of portlet execution the portlet isn't behaving the way the guide says it should. (Deveoper's Guide portlet tutorial).
After switching the renderURL tag to an actionURL & implementing the processAction method in the portlet-class, I can still modify the greeting message on /edit.jsp like in the previous step, but when I submit the form the page that's displayed is /view.jsp, not edit.jsp like the guide says.
edit.jsp snippet:
[indent]<portlet:actionurl var="editGreetingURL">
<portlet:param name="jspPage" value="/edit.jsp" />
</portlet:actionurl>
<aui:form action="<%= editGreetingURL %>" method="post">
<aui:input label="greeting" name="greeting" type="text" value="<%= greeting %>" />
<aui:button type="submit" />
</aui:form>[/indent]
Is this normal behavior?
Thanks,
David
Hitesh Methani, geändert vor 12 Jahren.
RE: ActionURL ignores jspPage param in getting started tutorial? (Antwort)
Regular Member Beiträge: 171 Beitrittsdatum: 24.06.10 Neueste Beiträge
Hi David,
This would be normal behaviour, if you dont pass the jspPage as parameter to render method.
To redirect to required page you need to make a change in your processAction method such that renderParameter for jspPage is set.
For that, all you have to do is at the end of processAction method just add following line,
actionResponse.setRenderParameter("jspPage",actionRequest.getParameter("jspPage"));
This will ensure that jspPage does not go null in render method and will your required jsp.
Thanks and Regards,
Hitesh Methani
This would be normal behaviour, if you dont pass the jspPage as parameter to render method.
To redirect to required page you need to make a change in your processAction method such that renderParameter for jspPage is set.
For that, all you have to do is at the end of processAction method just add following line,
actionResponse.setRenderParameter("jspPage",actionRequest.getParameter("jspPage"));
This will ensure that jspPage does not go null in render method and will your required jsp.
Thanks and Regards,
Hitesh Methani
David Rutherford, geändert vor 12 Jahren.
RE: ActionURL ignores jspPage param in getting started tutorial?
New Member Beiträge: 2 Beitrittsdatum: 19.07.11 Neueste Beiträge
Thanks very much! The portlet is working as I expected now.
Despite telling you that MVCPortlet needs the jspPage param & then 2 pages later explaining that there are 2 phases and params must explicitly be passed between them, the Developer's Guide certainly doesn't make the need to pass the jspPage parameter in particular to the render phase clear.
Would there happen to be some tutorial/javadoc/taglib documentation repository you could point me to regarding portlets? The documentation posted on Liferay's site seems to be extremely lacking in details like this.
Despite telling you that MVCPortlet needs the jspPage param & then 2 pages later explaining that there are 2 phases and params must explicitly be passed between them, the Developer's Guide certainly doesn't make the need to pass the jspPage parameter in particular to the render phase clear.
Would there happen to be some tutorial/javadoc/taglib documentation repository you could point me to regarding portlets? The documentation posted on Liferay's site seems to be extremely lacking in details like this.
Hitesh Methani, geändert vor 12 Jahren.
RE: ActionURL ignores jspPage param in getting started tutorial?
Regular Member Beiträge: 171 Beitrittsdatum: 24.06.10 Neueste Beiträge
Hi David,
Even I dont find any documentation other than Developer's Guide.
Thanks,
Hitesh
Even I dont find any documentation other than Developer's Guide.
Thanks,
Hitesh