I have two portlets : 1. Blog Portlet. 2. Author Portlet.
- I used the concept of Public render parameter to send data (say key "urlTitle") from Blog portlet to Author portlet
- But after sending "urlTitle" from Blog portlet how can I remove the data from Public render parameter
In Blog Portlet
EX code: view.jsp
<portlet:renderURL var="viewEntryURL">
<portlet:param name="struts_action" value="/blogs/view_entry" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="urlTitle" value="<%= entry.getUrlTitle() %>" />
</portlet:renderURL>
<a href="${viewEntryURL}">Send Data</a>
Now how I can remove "urlTitle" form the public render parameter after data is sent.
Please give feedback. -Thanks in advance
You could think about the following:
The LiferayPortletURL (the class that models portlet render, action and resource URLs tags) offers a method called
setCopyCurrentRenderParametershttps://docs.liferay.com/portal/6.2/javadocs/com/liferay/portal/kernel/portlet/LiferayPortletURL.html#setCopyCurrentRenderParameters(boolean)
which when set to false, avoids copying render parameters, and the URLs are "cleaned" from those.
The caveat with this is that you would need to create a LiferayPortletURL in the back end doing the following:
and after that pass it to your JSP set as an attribute (maybe renderRequest.setAttribute("renderUrl",renderUrl)?). I haven't done this for render URLs, but for resource URLs and it works!