Hello Guys
We can add multiple Pages Inside One Liferay Portlet from portlet class.
You can display any JSP page's you want via the PortletRequestDispatcher in your doView, doHelp, doEdit etc. method.
Below example help you to add multiple Pages Inside One Liferay Portlet :
protected void doView(RenderRequest req, RenderResponse resp)
throws PortletException, IOException, UnavailableException {
resp.setContentType("text/html");
String myview = req.getParameter("myview");
String view = "/WEB-INF/jsp/" + (myview==null ? "bar" : myview) + ".jsp";
PortletRequestDispatcher dispatcher =
getPortletContext().getRequestDispatcher(view);
dispatcher.include(req, resp);
}
You could use a parameter to set the view page. In the JSP with the links, you need to use the Portlet API to create/encode the links to the Portlet.
For example:
<portlet:renderURL>
<portlet:param name="myview" value="foo"/>
</portlet:renderURL>
0 Comment(s)