掲示板
ActionURL & mvcPath
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:
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
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
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
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
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
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
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
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
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
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
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 .
Regards,
meera prince
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
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"