For creating simple Jsp portlet in Liferay we have to modify following files.
Following xml files are located under "ext/ext-web/docroot/WEB-INF"
1.1. portlet-ext.xml
--------------------
Add entry for your portlet
<portlet>
<portlet-name>Sample</portlet-name>
<display-name>JSP Portlet Introduction</display-name>
<portlet-class>com.liferay.util.bridges.jsp.JSPPortlet</portlet-class>
<init-param>
<name>view-jsp</name>
<value>/html/portlet/ext/jsp_portlet/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
1.2. liferay-portlet-ext.xml
----------------------------
Make an entry for your portlet.
<portlet>
<portlet-name>Sample</portlet-name>
</portlet>
1.3. liferay-display.xml
------------------------
Make an entry for the category in which you want to display your portlet.
<category name="category.sample">
<portlet id="Sample" />
</category>
1.4. view.jsp
-------------
create this file under "ext/ext-web/docroot/html/portlet/ext/jsp_portlet"
and put some contents
do "ant deploy" from "ext-web"
1.5 Language-ext.properties
---------------------------
(under /ext/ext-impl/src/content)
Add two new entries in the above file, this helps us in I18N
javax.portlet.title.Sample=Sample JSP Portlet
category.sample=Example
do "ant deploy" from "ext-impl"
1 comment:
Nice code. But not properly explained and finished i think?????
Please make it fine and clear.
Thank You
Post a Comment