A portlet is a component of a portal application. It is a part of the portal. Several portlets combined make a portal application.
If you are new to Liferay check “how to setup Liferay portal” on windows.
This is a simple tutorial about how to create a simple portlet using Liferay Developer Studio. The following are the steps.
- Open LDS and Navigate to File > New > Liferay Plugin Project, as shown below:
- Add the Project Name in the field, set up the SDK location and run time environment.
- Please note that we have selected the checkbox Include sample code below. This will add a sample JSP page and other required portlet configurations.
- We can add new portlets to the plugin project from New > Liferay Portlet option.
- A Liferay plugin project can contain multiple portlets.
- Plugin SDK can be configured by adding plugin path from plugin SDK configuration window as shown below and click on the OK button.
- Run time environment can be set up using Liferay Runtime configuration window as follows:
- Select the version of the server and click on the Next button. Select the tomcat path as shown below and click finish button.
- Click on next button of portlet configuration window and select Liferay MVC radio button and click on the finish as shown:
- The Portlet is now created. It contains the following folder structure:
- Deploy the portlet by Right Click on portlet > Liferay > SDK > direct-deploy/deploy as shown below:
- Add the portlet from the Add button of Liferay application page as shown:
Note: Version details: Liferay version 6.2 + Apache Tomcat 7 server.