Saturday, September 27, 2008

Create Basic JSP Portlet

To create simple JSP portlet, you have to modify these files:


Step I :

[the xml files are located under "ext/ext-web/docroot/WEB-INF"]

1. portlet-ext.xml
2.liferay-portlet-ext.xml
3. liferay-display.xml
4. view.jsp
5. Language-ext.properties


Step II:

ant deploy

===========================

Step I :

1.1. portlet-ext.xml

<portlet>

<portlet-name>EXT_2</portlet-name>

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

<portlet-class>com.liferay.portlet.JSPPortlet</portlet-class>

<init-param>

<name>view-jsp</name>

<value>/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
<portlet>

<portlet-name>EXT_2</portlet-name>

</portlet>


1.3. liferay-display.xml

<category name="category.example">

<portlet id="EXT_2"></portlet>

</category>


1.4 view.jsp
(create this file under "ext/ext-web/docroot/html/portlet/ext/jsp_portlet"
and enter the below contents)


Welcome to simple Basic JSP Portlet


1.5 Language-ext.properties


javax.portlet.title.EXT_2=JSP Portlet


Step II :

Go to inside the ext in terminal then give ant deploy

ext>ant deploy


- Gnaniyar Zubair

2 comments:

Anonymous said...

i did jsp portlet in ext environment.but not apper in add application list. without ext it is apper. what problem in ext environment?

murphy said...

hi
i'm using liferay 5.2 and i can't find language-ext.properties file

can you help me with that

thanks & regards
murphy