Powered by Syntax Highlighter scripts!

Upgrading JSR 168 portlets to JSR 286 specifications

Recently we had to upgrade our JSR 168 portlets to JSR 286 specifications for utilizing the powerful features of JSR 286 mainly AJAX.
Following steps below outilne the minimal set of changes to be done for upgrading the portlets to JSR 286.
1. portlet.xml XSD reference changes
The portlet.xml should refer to the new xsd definitions.
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
to be changed to
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
note the changes highlighted. So after these changes we will refer to the new specifications defined in _2_0 XSD files.

2. portlet.xml - add default namespace for portlet
Im JSR 286 portlets we need to give hte default name space for the portlet as in the line below.

3. Tag library change in all JSP files
The portlet 1.0 tag library used in JSR 168 to be replaced with the portlet 2.0 tag library as defined in JSR 286 portlet.
Tag library in portlet 1.0 specification:
<%@taglib prefix="portlet" uri="http://java.sun.com/portlet"%>

Tag library in portlet 2.0 specification:
<%@taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%>

Change all the JSPs in the portlet where tags are used.

This completes the minimal changes that are required for upgrading the JSR 168 portlets to JSR 286 portlets.