Fórumok

Difference between <actionURL>,<renderURL> and <resourceURL>

Manohar Reddy, módosítva 9 év-val korábban

Difference between <actionURL>,<renderURL> and <resourceURL>

Junior Member Bejegyzések: 48 Csatlakozás dátuma: 2014.08.07. Legújabb bejegyzések
Hi,
I am new to Liferay. Any One can explains what is the difference between <actionURL>,<renderURL> and <resourceURL>.
And In which scenarios we can use those tags?

Advanced thanks,
Manu
thumbnail
Pankaj Kathiriya, módosítva 9 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Liferay Master Bejegyzések: 722 Csatlakozás dátuma: 2010.08.05. Legújabb bejegyzések
In Simple words, actionURL calls action phase(action method), renderURL calls render phase(render method), resourceURL used for dynamic generation of image, json data, xml etc. Refer to link
Mahendra Panchal, módosítva 9 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

New Member Bejegyzések: 21 Csatlakozás dátuma: 2014.02.25. Legújabb bejegyzések
in simple word

actionURL is used when you need to perfom operation with database. just like to submit data to database. perform some action.

renderURL is for you need to render page from one page to another page.

and

finally resourceURL is used for ajax call from your application..

hope it help to understand.
ANIKET VERMA, módosítva 9 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

New Member Bejegyzések: 7 Csatlakozás dátuma: 2013.10.22. Legújabb bejegyzések
hi

action URL is used for form saving on the server side and you can send parameter to the server side .

render URL is used for communication between two jsp pages and you can send parameter also in the render url,

resourse URL is basically used for ajax call , upload image , display image , json etc.
thumbnail
Madhava Venganapalli, módosítva 9 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Junior Member Bejegyzések: 26 Csatlakozás dátuma: 2013.06.05. Legújabb bejegyzések
Hi,
In Simple

ActionURL - forwards your request to processAction()
RenderURL - forwards your request to doView()

The most important difference is how the portal must handle both requests.
As the portlet specification says:

If the client request is triggered by an action URL, the portal/portlet-container must first trigger the action request by invoking the processAction method of the targeted portlet.

The portal/portlet-container must wait until the action request finishes.Then, the portal/portlet-container must trigger the render request by invoking the render method for all the portlets in the portal page with the possible exception of portlets for which their content is being cached.

The render requests may be executed sequentially or in parallel without any guaranteed order.
thumbnail
Neha Goyal, módosítva 9 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Regular Member Bejegyzések: 121 Csatlakozás dátuma: 2013.05.14. Legújabb bejegyzések
Thanks Madhava,It was nice.
Nilang I Patel, módosítva 9 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Junior Member Bejegyzések: 31 Csatlakozás dátuma: 2011.07.26. Legújabb bejegyzések
As rightly said by Pankaj, Render URL is used to call render method of portlet. Action url is used to perform action (and call action method ) on portlet while resource url is used in Ajax call to fetch content other than HTML. (HTML content can also be server through resource URL).

You can get more details about render url and action urls from below links.
===Render Phase of Portelt===
What is Portlet Render Phase / Lifecycle
Create Render URL by Portlet Tag
Render URL by Liferay Tag
Render URL by Java API
Render URL by Javascrpt - AUI Module

===Action Phase of Portelt===
Portlet Action Phase
Action URL by Portlet Tag in Liferay
Create Action URL programatically - through PortletURLFactoryUtil class
Action URL through Javascript module (AUI - Liferay.PortletURL)
How Portlet Action method invoked internally.

Hope You will get details information from above links.

Regards
Nilang
thumbnail
Neha Goyal, módosítva 9 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Regular Member Bejegyzések: 121 Csatlakozás dátuma: 2013.05.14. Legújabb bejegyzések
Thank you Nirag.
thumbnail
Aditya Bhardwaj, módosítva 9 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Junior Member Bejegyzések: 78 Csatlakozás dátuma: 2015.01.08. Legújabb bejegyzések
Hi,
Every one is saying actionUrl is for form submission but we can also submit form by Ajax very well .
So my answer is by using actionUrl you will be able to send request further but by using renderUrl this is not possible.
Nilang I Patel, módosítva 8 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Junior Member Bejegyzések: 31 Csatlakozás dátuma: 2011.07.26. Legújabb bejegyzések
Hi Aditya,

Do you know, even with renderURL you can submit form. Then why portlet specification introduced action phase / lifecycle ? Because portlet action phase will be called just once while render phase will be called every time the page is refreshed.

So if you wrote some logic in render method, it will be called everytime the page is refreshed. So you should write logic which you want to call just once (when action url is clicked) in action method.

Hope this gives desired explanation.

Regards
Nilang
thumbnail
Neha Goyal, módosítva 8 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Regular Member Bejegyzések: 121 Csatlakozás dátuma: 2013.05.14. Legújabb bejegyzések
Nilang I Patel:
Hi Aditya,

Do you know, even with renderURL you can submit form. Then why portlet specification introduced action phase / lifecycle ? Because portlet action phase will be called just once while render phase will be called every time the page is refreshed.

So if you wrote some logic in render method, it will be called everytime the page is refreshed. So you should write logic which you want to call just once (when action url is clicked) in action method.

Hope this gives desired explanation.

Regards
Nilang


Totally agreed with you :-)
thumbnail
Aditya Bhardwaj, módosítva 8 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Junior Member Bejegyzések: 78 Csatlakozás dátuma: 2015.01.08. Legújabb bejegyzések
Nilang I Patel:
Hi Aditya,

Do you know, even with renderURL you can submit form. Then why portlet specification introduced action phase / lifecycle ? Because portlet action phase will be called just once while render phase will be called every time the page is refreshed.

So if you wrote some logic in render method, it will be called everytime the page is refreshed. So you should write logic which you want to call just once (when action url is clicked) in action method.

Hope this gives desired explanation.

Regards
Nilang



Hi Nilang,

Yup i know this very well.
But the question is from render method can we forward request by using Dispatcher??
I think not that's why i write this as a difference .Correct me if i am wrongemoticon
thumbnail
David H Nebinger, módosítva 8 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
No you cannot redirect during render. Render is responsible for creating the html fragment for the current view and cannot make such changes.
thumbnail
Aditya Bhardwaj, módosítva 8 év-val korábban

RE: Difference between <actionURL>,<renderURL> and <resourceURL>

Junior Member Bejegyzések: 78 Csatlakozás dátuma: 2015.01.08. Legújabb bejegyzések
Thanks David