Advanced MVC portlet
We have discussed the basic MVC portlet in the previous section. In this section, we will discuss the advanced MVC portlet features, such as portlet bridge extension, bringing portlets into the Control Panel, portlet configuration and preferences, redirecting, more actions, and interacting with the database.
Portlet bridge extension
As mentioned earlier, MVCPortlet
extends LiferayPortlet
and LiferayPortlet
extends GenericPortlet. MVCPortlet
is useful, since it specifies a set of JSP views such as about-jsp, config-jsp, view-jsp
, and so on. In the real world, MVCPortlet
may not be sufficient. Thus you should extend it.
For example, for the knowledge base admin, MVCPortlet
got extended as com.liferay.knowledgebase.admin.portlet.AdminPortlet
. In the portlet.xml
file, the portlet-class
element contains the fully-qualified class name of the portlet. Thus, to extend the MVC portlet bridge, the portlet-class
element could be specified as follows:
<portlet-class>com.liferay...