掲示板

ActionURL & mvcPath

10年前 に Jiri P. によって更新されました。

ActionURL & mvcPath

New Member 投稿: 9 参加年月日: 13/12/02 最新の投稿
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
10年前 に Ankit Kulshrestha によって更新されました。

RE: ActionURL & mvcPath

Junior Member 投稿: 28 参加年月日: 13/05/22 最新の投稿
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
10年前 に Jiri P. によって更新されました。

RE: ActionURL & mvcPath

New Member 投稿: 9 参加年月日: 13/12/02 最新の投稿
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
9年前 に Jose Miguel Loor によって更新されました。

RE: ActionURL & mvcPath

New Member 投稿: 11 参加年月日: 13/11/27 最新の投稿
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
9年前 に Sagar A Vyas によって更新されました。

RE: ActionURL & mvcPath

Liferay Master 投稿: 679 参加年月日: 09/04/17 最新の投稿
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
9年前 に meera prince によって更新されました。

RE: ActionURL & mvcPath

Liferay Legend 投稿: 1111 参加年月日: 11/02/08 最新の投稿
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
6年前 に Fernando Paz によって更新されました。

RE: ActionURL & mvcPath

New Member 投稿: 11 参加年月日: 16/09/16 最新の投稿
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"