Liferay JSP Portlet Development

Liferay JSP Portlet Development

[portlet-ext.xml, liferay-portlet-ext.xml, liferay-display.xml — placed under .. ”  ext/ext-web/docroot/WEB-INF  “

  1. create portlet entry in “portlet-ext.xml”



<display-name>Simple JSP Portlet</display-name>











<title>Simple JSP Portlet</title>

<short-title>Simple JSP Portlet</short-title>

<keywords>Simple JSP Portlet</keywords>












2.Create liferay specific portlet entry in “liferay-portlet-ext.xml”




3. create a JSP file named view.jsp inside “/portlet/ext/library/”

<H1> Some Text

4. Create package for JSP portlet class


Create a “Class” SimpleJSPPortlet in the created package

package com.ext.portlet.jspportlet;

import com.liferay.portal.kernel.util.ContentTypes;

import com.liferay.portal.kernel.util.ReleaseInfo;



import javax.portlet.ActionRequest;

import javax.portlet.ActionResponse;

import javax.portlet.GenericPortlet;

import javax.portlet.RenderRequest;

import javax.portlet.RenderResponse;

public class SimpleJSPPortlet extends GenericPortlet {

public void processAction(

ActionRequest actionRequest, ActionResponse actionResponse) {


public void doView(

RenderRequest renderRequest, RenderResponse renderResponse)

throws IOException {


PrintWriter writer = renderResponse.getWriter();

writer.print(“Simple Liferay Portal 5.2.1 JSP Portlet “);



5.Create Categoryadd add this portlet under the new one

Open iiinside directory “/ext/ext-impl/src/content”

category.extworks=My Works

add this entry to liferay-display.xml

<category name=“category.extworks”>

<portlet id=“JSPPortlet” />



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s