Monday, July 20, 2009

Basic JSP Portlet

1.Basic JSP Portlet

~~~~~~~~~~~~~~~~~~~

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


1.1. portlet-ext.xml

--------------------


(insert the below content)


<portlet>

<portlet-name>EXT_2</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

----------------------------



(insert the below content)



<portlet>

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

</portlet>



1.3. liferay-display.xml

------------------------



(insert the below content)



<category name="category.example">

<portlet id="EXT_2">

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



Note: after this step 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,



javax.portlet.title.EXT_2=JSP Portlet



category.example=Example



Note: after this step do "ant deploy" from "ext-impl"

No comments :