Chapter 31. Spring Framework Portlet Development

Support for Spring Portlet Model-View-Controller (MVC) is limited in the Red Hat JBoss Portal. It is recommended that other fully supported options such as JSP, JSF or JSF with RichFaces are considered as replacements to Spring Portlet MVC.

Important

Using other Spring components must be carefully evaluated as their support in the Portal environment may be limited.
See the Portlet MVC Framework section ( http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/portlet.html) of the Spring Framework Reference Documentation for detailed Spring-based portlet project configuration instructions.

Important

When generating an Action URL using the portlet tag library, ensure that escapeXml="false" is included in the definition of portlet:actionURL, as described in Example 31.1, “Action URL”. A page not found issue due to the Action URL not being able to map the URL to a Spring controller is likely if this advice is not followed.

Example 31.1. Action URL

<portlet:actionURL var="myAction" escapeXml="false" />
Deploying a Spring-based portlet, importing it, and adding it to a page uses the same process as any other portlet.
See Import Portlets and Gadgets and Manage Pages in the User Guide for further guidance about using the Web interface to import and manage portlets.

Limitation for Spring portlet on version 2.5

During development or migration of a Spring Portlet on version 2.5 for the platform, the configuration <context:component-scan base-package="org.classname.etc"/> fails to locate the beans for scanning. Spring 2.5 cannot interpret the VFS file system used by Red Hat JBoss Enterprise Application Platform therefore it cannot scan the JAR files to find the beans. Spring 3.x versions do not have this limitation. To resolve the problem, replace the <component-scan> tag with the bean tags for each required bean.
Spring 2.5 only supports JSR 168 (Portlet Spec 1.0), it does not include support for ResourceRequest which was introduced by JSR 286 (Portlet Spec 2.0). Without the ability to use a ResourceRequest, the means by which Ajax calls are handled in a portlet, it is not possible to use Ajax calls with a Spring 2.5 portlet. If your portlet requires Ajax calls, it must be upgraded to Spring 3.x.