Fórumok

ActionURL & mvcPath

Jiri P., módosítva 10 év-val korábban

ActionURL & mvcPath

New Member Bejegyzések: 9 Csatlakozás dátuma: 2013.12.02. Legújabb bejegyzések
Hello,

I understand the difference between actionURL and renderURL. Talking about renderURL, it's clear what "mvcPath" parameter does, but what is this parameter used for within actionURL?

Example:
<portlet:actionurl var="myActionURL" name="myAmazingAction">
    <portlet:param name="mvcPath" value="/superPage.jsp" />
</portlet:actionurl>

<aui:form action="<%=myActionURL%>" method="post">
        <aui:input label="Field" name="field" type="text" />
        <aui:button type="submit" />
</aui:form>


It works in the same way with and even without this parameter (talking about this line: "<portlet:param name="mvcPath" value="/superPage.jsp" />"). I found that developer guide v6.2 also describes this in the same context of actionURL.

My first thinking was that this can forward to appropriate page ("/superPage.jsp" page as mentioned in my example), but everytime "view.jsp" is rendered after the submit and if you really want, you have to do it by calling "actionResponse.setRenderParameter("jspPage", mySuperJSP); " on the porlet side.

So, what is this "mvcPath" parameter used for within actionURL?

Thank you.
Jiri
thumbnail
Ankit Kulshrestha, módosítva 10 év-val korábban

RE: ActionURL & mvcPath

Junior Member Bejegyzések: 28 Csatlakozás dátuma: 2013.05.22. Legújabb bejegyzések
HI Jiri,

MvcPath variable to which you are referring to is a render Parameter which helps in passing information from Action Phase to Render Phase.

Please refer to this link for detailed explaination.

Thanks,
Ankit Kulshrestha
Jiri P., módosítva 10 év-val korábban

RE: ActionURL & mvcPath

New Member Bejegyzések: 9 Csatlakozás dátuma: 2013.12.02. Legújabb bejegyzések
Hello,

yep, nice description, but the problem was that I did not call super.processAction(actionRequest, actionResponse). This got the mvcPath working as expected.

Thank you.
Jiri
thumbnail
Jose Miguel Loor, módosítva 10 év-val korábban

RE: ActionURL & mvcPath

New Member Bejegyzések: 11 Csatlakozás dátuma: 2013.11.27. Legújabb bejegyzések
i am doing a similar thing in liferay 6.2, but i cannot get the desired outcome

i have this in a page called view 2

<portlet:actionURL var="viewActionURL">
<portlet:param name="mvcPath" value="/view2.jsp"/>
</portlet:actionURL>

<aui:form action="<%=viewActionURL%>" method="POST">
<aui:input label="Mensaje" name="message" type="text" />
<aui:button type="submit" />
</aui:form>

and the portlet class is like this
public void processAction(ActionRequest actionRequest,
ActionResponse actionResponse) throws IOException, PortletException {
String message = actionRequest.getParameter("message");
actionResponse
.setRenderParameter("upperMessage", message.toUpperCase());
super.processAction(actionRequest, actionResponse);
}

but everytime the portlet goes to the view.jsp page, instead of view2.jsp
thumbnail
Sagar A Vyas, módosítva 10 év-val korábban

RE: ActionURL & mvcPath

Liferay Master Bejegyzések: 679 Csatlakozás dátuma: 2009.04.17. Legújabb bejegyzések
Jose,

What kind of Portlet are you developing ? Make sure your portlet controller extends MVCPortlet.

Or in other words you will get advantages of all existing variable if and only if you are extending MVCPortlet class which Liferay provides.

Thanks,
Sagar Vyas
thumbnail
meera prince, módosítva 10 év-val korábban

RE: ActionURL & mvcPath

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
Hi Please have look into

MVCPortlet.java class source code you can understand all .

protected String getPath(PortletRequest portletRequest) {
		String mvcPath = portletRequest.getParameter("mvcPath");

		// Check deprecated parameter

		if (mvcPath == null) {
			mvcPath = portletRequest.getParameter("jspPage");
		}

		return mvcPath;
	}




Regards,
meera prince
thumbnail
Fernando Paz, módosítva 6 év-val korábban

RE: ActionURL & mvcPath

New Member Bejegyzések: 11 Csatlakozás dátuma: 2016.09.16. Legújabb bejegyzések
Jiri P.:
Hello,

I understand the difference between actionURL and renderURL. Talking about renderURL, it's clear what "mvcPath" parameter does, but what is this parameter used for within actionURL?

Example:
<portlet:actionurl var="myActionURL" name="myAmazingAction">
    <portlet:param name="mvcPath" value="/superPage.jsp" />
</portlet:actionurl>

<aui:form action="<%=myActionURL%>" method="post">
        <aui:input label="Field" name="field" type="text" />
        <aui:button type="submit" />
</aui:form>


It works in the same way with and even without this parameter (talking about this line: "<portlet:param name="mvcPath" value="/superPage.jsp" />"). I found that developer guide v6.2 also describes this in the same context of actionURL.

My first thinking was that this can forward to appropriate page ("/superPage.jsp" page as mentioned in my example), but everytime "view.jsp" is rendered after the submit and if you really want, you have to do it by calling "actionResponse.setRenderParameter("jspPage", mySuperJSP); " on the porlet side.

So, what is this "mvcPath" parameter used for within actionURL?

Thank you.
Jiri


thanks... for this "actionResponse.setRenderParameter("jspPage", mySuperJSP);" works great, otherwise if you put "actionResponse.setRenderParameter("mvcPath", mySuperJSP);" you get "Set render parameter has already been called"