Showing posts with label Spring MVC. Show all posts
Showing posts with label Spring MVC. Show all posts

Thursday, July 25, 2013

Liferay portlet with Spring MVC


How to setup a liferay portlet with Spring MVC?

Again, a nicely written and very well explained blog by Nilang Patel explaining the complete setup of a liferay portlet with Spring MVC.

Here you will find one more blog on how to setup render and action method in Spring MVC portlet.

Few things which I want to highlight here:

You can implement diff mode of Liferay portlet within the same Controller.

Below I added a code snippet from my Controller class.


Here I am telling the controller which method serve which mode of the portlet.Now, lets say you want to implement one more method. One action method name=”submitForm”.Now in that case you need to first annotate the method with @ActionMapping(params = “actionParameterName=actionParameterValue”) along with @RequestMapping(“VIEW”) annotation.I put view because I want to tell controller that I want o perform this action method on portlet’s VIEW mode.


Feel free to ask your queries and Happy learning :)