Other codes also use the new PortletURLImpl () directly. My portlet cannot see this class.
Since this class is located in portal-impl.jar , it is also not recommended to use classes from this jar. Starting with Liferay 6.1, you cannot build your portlet from plugins-sdk if the classes point to portal-impl.jar .
Now, to answer your question:
Any jsp is rendered using the render or doView method (if using liferay MVCPortlet ), and this method will be called part of the normal portlet life cycle.
Here are the steps you need to take:
set the render parameter (using response.setRenderParameter () in your processAction method, which will be available in your rendering method, as follows:
actionResponse.setRenderParameter("myID", 1201);
For information only: After using setRenderParameter you cannot use sendRedirect
extract this "myID" in your rendering method when you receive any other request parameter:
or
String strMyID = renderRequest.getParameter("myID"); long myID = Long.parseLong(strMyID);
After that just use
include(renderPage, renderRequest, renderResponse);
were renderPage - this is nothing more than a string containing the path to your jsp inside the docroot , e.g. /html/yourportlet/view.jsp
Like an afterthought:
If you are using the Liferay IDE, you can try creating a simple portlet project using MVCPortlet and then look at the generated portlet.xml <init-param>
Thus, basically you need to transfer information from the action phase to visualization, the development guide is a good place to explain this in detail.
What is it.
Hope this helps.
Let me know if you have any confusion in this regard.
source share