Liferay Struts Portlet Development – 1

Liferay Simple Struts Portlet Development

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



<display-name>Library Home</display-name>











<title>Library Home</title>

<short-title>Library Home</short-title>











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






  1. Create “/ext/library/viewhome” struts pageflow in struts-config.xml for the entry ‘<value>/ext/library/viewhome</value>’ in portlet-ext.xml

<action path=“/ext/library/viewhome” forward=“portlet.ext.library.viewhome” />

4. Create tiles pagelayout for “/ext/library/viewhome” – struts path in tiles-defs.xml

<definition name=“portlet.ext.library” extends=“portlet” />

<definition name=“portlet.ext.library.viewhome” extends=“portlet.ext.library”>

<put name=“portlet_content” value=“/portlet/ext/library/view_home.jsp” />


  1. Create JSP file view_home for the pageto be displayed

    <%@ include file=“/html/portlet/ext/library/init.jsp” %>

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”;>



<meta http-equiv=“Content-Type” content=“text/html; charset=UTF-8”>

<title>Library Home</title>



Library Home

<br> <h3>Home Page &nbsp;&nbsp;&nbsp;&nbsp; will be used entry point for Libarary Process </h3>



  1. Include init.jsp /html/portlet/ext/library/init.jsp

    This is for our portlet initialization parameter or preferences …

  1. init.jsp

// this is for liferay, xtra tags file to be used in our jsp while development .. Eg: image tag, display tag, etc …

<%@ include file=“/html/common/init.jsp” %>

<portlet:defineObjects />


WindowState windowState = renderRequest.getWindowState();


  1. End..

    Create a category, and add this..


Struts portlet with Struts Action will be available in Next Post



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