We will first get brief introduction about Spring MVC (Web MVC) framework and then we see how to write Spring MVC Portlet in Liferay step by. Spring MVC is one of the most popular framework to create portlets. Liferay supports creating Maven Spring MVC Portlet. You can add multiple. Liferay MVC vs Spring MVC is one of the most hot topic for liferay developer. It always creates confusion as what to choose when. In this article I.
|Published (Last):||8 December 2009|
|PDF File Size:||8.78 Mb|
|ePub File Size:||12.78 Mb|
|Price:||Free* [*Free Regsitration Required]|
It covers the high points, assuming you already have familiarity with Spring MVC. Almost identical to any other Spring MVC portlet.
The Spring front controller needs to know where the application context file is, so specify it as an initialization parameter in the portlet. Provide an application context file portlet-context. Next configure your web application. Dpring addition to your Spring MVC configuration, your web.
Your application must be able to convert javax. PortletRequest s to javax. ServletRequest s and back again. Add this to the web. To configure the Spring view resolver, add ljferay bean to your application context file portlet-context.
Now the front controller, org. Make sure to define any controller classes in your application context file by adding a bean element for each one:.
Develop your controllers and your views as you normally sprinf in a Spring MVC portlet. You must also provide some necessary descriptors for Liferay. Liferay portlet plugins that are packaged as WAR files should include some Liferay specific descriptors.
Find the complete DTD here. A complete list of the attributes you can set can be found here.
Configuring a Spring MVC Portlet – Liferay – Liferay Developer Network
They define the Liferay roles used in the portlet. The DTD is here. MF file when you deploy your WAR file.
You have to use Service Trackers. Portlet Configuration In the portlet. Views To configure the Porhlet view resolver, add a bean to your application context file portlet-context.
View Mode Controller A simple controller class supporting View mode might look like this: With Spring MVC, you can only support one portlet phase in each controller.
Spring MVC Portlet
Edit Mode Controller An edit mode controller might contain render methods and action methods. Dpring Descriptors Liferay portlet plugins that are packaged as WAR files should include some Liferay specific descriptors. Next consider how to package and deploy your Spring MVC portlet.