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

Java Productivity tools

Here are the list of Java Productivity tools that help in simplifying the daily life of a developer. Eclipse as an IDE simplifies the development life cycle which has a lots of plugins to support different programming languages and frameworks. Some of useful Eclipse plugins are - Sonarlint that helps to do static code analysis and give suggestions as we go along the development life cycle. JDGUI - Is the Eclipse Plugin that supports the decompilation of the Java application within eclipse, this is very handy when debugging and need to look at the out of the box code from a framework/library. JUnit is the unit testing framework that supports Unit Testing of Java Applications. Mockito is the framework that supports the Mock Unit Testing of the Java Application.

Core Java Interview Questions

1) Is Java Compiled or Interpreted languages? Java is both, first it is compiled by Java Compiler into ByteCode(which is a form of machine language just for the JVM). Then JVM interprets this byte code and converts it into machine understandable language. 2) How JVM Memory is organized? Which are stored in which part of JVM Memory? Classes and Methods are stored in Perm Gen space. String internalized are also stored in Perm Gen space. This space is very limited compared to the HeapSize. 3) Difference between PrintWriter and Buffered Writer PrintWriter is used for small and dirty applications where we can display/write the messages on to the console. More over PrintWriter swallows the exceptions, later can read the exceptions by calling checkError() method. 4) Difference between BufferedWriter vs FileWriter BufferedWriter stores the data in the buffer and won't make those many calls to the operating system, it also lets us to specify the size of the buffer, if the buffer size is s...