Liferay PortletURL(Render, Action, Resource)

1.To get currentURL :
PortletURL url = PortletURLUtil.getCurrent(renderRequest, renderResponse);

2. Creating PortletURL from renderResponse : 

a.For renderURL:
PortletURL renderURL = renderResponse.createRenderURL(); 

b.For actionURL:
PortletURL actionURL = renderResponse.createActionURL();

c. For resourceURL

ResourceURL addChannelURL = renderResponse.createResourceURL();
addChannelURL.setResourceID(RESOURCEURL_ID);
addChannelURL.setParameter(RESOURCEURL_PARAM, currentSourceGuid);

3.Using TLD's in Liferay :

a. renderURL
<portlet:renderURL windowState="<%= WindowState.ur_state.toString() %>">
<portlet:param name="param_name" value="param_value" />
<portlet:param name="param_name" value="param_value" />
</portlet:renderURL>
b. actionURL
<portlet:actionURL windowState="<%= WindowState.ur_state.toString() %>">
<portlet:param name="param_name" value="param_value" />
<portlet:param name="param_name" value="param_value" />
</portlet:actionURL>

c. resourceURL

<portlet:resourceURL">
<portlet:param name="param_name" value="param_value" />
<portlet:param name="param_name" value="param_value" />
</portlet:resourceURL>

你可能感兴趣的:(liferay,PortletURL,renderurl,resourceURL,actionURL)