Skip to main content

SpringMVCPortlets using JSR-286(Spring 3.0)

SpringMVC portlet framework that wish to make use of the JSR-286 features need to have Spring 3.0 jars and the relevant methods need to be implemented in the code.

All JSR-286 features are supported in Spring 3.0 Portlet WebMVC framework.


To Convert SpringWebMVC 2.0 portlet to SpringWebMVC3.0 portlet, the changes required are listed below.

1) portlet.xml , for changes to portlet 2.0 schema from portlet 1.o schema.

2) liferay-display.xml, for changes to DTD for liferay 5.2.*, as it was there for liferay 4.0 previously.(This is specific to liferay, requires no change on other servers)

3) liferay-portlet.xml for changes to DTD for liferay 5.2.*, as it was there for liferay 4.0 previously.(This is specific to liferay, requires no change on other servers)

4) removed spring 2.0 jars from WEB-INF/lib and added spring 3.0 jars to WEB-INF/lib

5) added portlet.jar in the WEB-INF/lib as it contains the support for Portlet 2.0 specification, excluded this jar during WAR creation as liferay contains duplicate jars.(This jar name is taken from liferay , may be different if the target server is diferent)

6) build.xml for excluding the portlet.jar during WAR creation.(This is required as the target server may contain duplicate jar with the same name and may fail the deployment).

7) common.xml for chages DTD for spring 3.0

8) *-portlet.xml for changes DTD for spring 3.0

9) Add new imports to the Controller classes and implement EventAwareController,ResourceAwareController interfaces and their methods

All of the Portlet2.0(JSR-286) features can be implemented by following the steps above.


Comments

  1. Do you any sample code which uses spring mvc porlets (JSR 268) and do inter portlet communication or doing some thing like Remote Control Portlet.
    I am not able to make this combination work sp. when in 3.0 you are suppose to use annotations.

    ReplyDelete

Post a Comment

Popular posts from this blog

HashMap in Java

1) Implement HashMap in Java, with the put and get operations   HashMap can be implemented in Java Using Arrays. Use the same logic that the Out of the Box   HashMap follows, for resizing, and load factor, when ever the HashMap reaches the size of the   resize with the load factor a new Array is created, and the previous array contents are copied over   to the new Array.  HashMap is Not Synchronized by default. We can synchronize the whole map by using Synchronization, or by using collection.synchronizedmap(map), which synchronizes all the operations on the map. Alternatively We can use the CocurrentHashMap which does not lock the read operations, rather locks the segments that are being written. 2) HashMap vs LinkedHashMap vs IdentityHashMap 3) HashMap vs ConcurrentHashMap 4) Implement a Cache using LinkedHashMap