Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Carlos Adolfo Ortiz Quirós
LIferay Porlet Spring MVC full portlet example (with Maven)
April 25, 2013 6:31 AM
Answer

Carlos Adolfo Ortiz Quirós

Rank: Junior Member

Posts: 40

Join Date: May 22, 2010

Recent Posts

Hi

Do you know of a full example to write a porlet using Spring MVC Portlet and Maven support for liferay 6.1.x?
Manish Yadav
RE: LIferay Porlet Spring MVC full portlet example (with Maven)
April 25, 2013 7:26 AM
Answer

Manish Yadav

Rank: Expert

Posts: 467

Join Date: May 26, 2012

Recent Posts

Hello Carlos,
I recommend Portlet In Action book.You can get Step by step tutorial of Portlet Spring MVC with hibernate and using Spring DAO. Each chapter have example source code written in Spring MVC and with both build tools maven and ANT.
you can download source code of Each chapter from below link

www.manning.com/sarin/PiA_sourcecode.zip
David H Nebinger
RE: LIferay Porlet Spring MVC full portlet example (with Maven)
April 25, 2013 10:33 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11492

Join Date: September 1, 2006

Recent Posts

I think he's talking about Liferay in Action. Portlets in Action is a generic alternative, but won't give you the full Liferay exposure.
Carlos Adolfo Ortiz Quirós
RE: LIferay Porlet Spring MVC full portlet example (with Maven)
April 26, 2013 7:36 AM
Answer

Carlos Adolfo Ortiz Quirós

Rank: Junior Member

Posts: 40

Join Date: May 22, 2010

Recent Posts

Thanks

I have that book, I'll have a check on it.
I now wonder from what you have told me if the Maven support includes using the latest Maven Support from Liferay, that is, a way to create a Porlet entirely using Maven pointing to Liferay artifacts.

Have a look here
Developing plugins using Maven chapter of the Liferay Developer's Guide
Carlos Adolfo Ortiz Quirós
RE: LIferay Porlet Spring MVC full portlet example (with Maven)
April 26, 2013 7:38 AM
Answer

Carlos Adolfo Ortiz Quirós

Rank: Junior Member

Posts: 40

Join Date: May 22, 2010

Recent Posts

Yes Indeed
Carlos Adolfo Ortiz Quirós
RE: LIferay Porlet Spring MVC full portlet example (with Maven)
July 8, 2013 2:53 PM
Answer

Carlos Adolfo Ortiz Quirós

Rank: Junior Member

Posts: 40

Join Date: May 22, 2010

Recent Posts

Carlos Adolfo Ortiz Quirós:
Hi

Do you know of a full example to write a porlet using Spring MVC Portlet and Maven support for liferay 6.1.x?


Hi everybody.
I am taking on this post again because I have not found any question so far.
This post was originally posted Apr.25/2013

What I really want is as follows?

I want to write a portlet using the Spring Framework, and particularly the Spring MVC Portlet Framework. I need to use Maven support (and best with official Maven Support which is supplied since V6.1, see chapter for maven in user's guide.

Hope this time I am lucky
Vijayakumar L
RE: Liferay Porlet Spring MVC full portlet example (with Maven)
July 18, 2013 6:32 AM
Answer

Vijayakumar L

Rank: New Member

Posts: 13

Join Date: April 29, 2013

Recent Posts

Hi Carlos,
Refer this site, http://books.dzone.com/articles/hello-world-portlet-using-Spring-3-portlet-MVC
Carlos Adolfo Ortiz Quirós
RE: Liferay Porlet Spring MVC full portlet example (with Maven)
July 19, 2013 12:53 PM
Answer

Carlos Adolfo Ortiz Quirós

Rank: Junior Member

Posts: 40

Join Date: May 22, 2010

Recent Posts

Thanks Vijayakumar L

I have read that blog entry. But it did not solve another issued I had. I searched the internet and found this entry 'http://portalhub.wordpress.com/2012/05/12/spring-mvc-portlet-hello-world-based-on-annotations'

In fact I wanted to use Spring Framework with annotations but also to have at least two Portlets packaged in just on WAR.

I have a Github repository where I put all of my study resources, here is the link: https://github.com/cortizqgithub/try_git
Specifically go to 'https://github.com/cortizqgithub/try_git/tree/master/liferay/maven/mvnspring-parent-project' To learn about the solution.
Jahangir Zinedine
RE: Liferay Porlet Spring MVC full portlet example (with Maven)
March 1, 2014 10:21 PM
Answer

Jahangir Zinedine

Rank: New Member

Posts: 5

Join Date: October 31, 2011

Recent Posts

I've pushed a simple liferay porlet usign spring mvc and hibernate by putting together pieces from other projects.
It's availabe at https://github.com/jzinedine/FirstPortlet
David H Nebinger
RE: Liferay Porlet Spring MVC full portlet example (with Maven)
March 3, 2014 6:51 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11492

Join Date: September 1, 2006

Recent Posts

And it is just plain wrong; let me tell you why...

Portlets are deployed as separate wars. As separate wars, they have their own runtime context. Part of that context will be, of course, separate database connections.

I'm sure what you have will work, but you haven't thought of the bigger picture. Say you created 30 separate portlets, all built using your spring mvc and hibernate solution. Let's say for the worst case scenario that your 30 portlets are all pointed at the same database.

Your failure will be that each of the 30 will have their own database connection, their own ehcache layer (and hence their own set of dirty caches), their own set of pending uncommitted writes, ...

So you've massively blown out your resource allocations (especially if those 30 portlets are using a database connection pool, multiply 30 by the number of connections you define for your pool to maintain), you've got a bunch of dirty caches and uncommitted writes resulting in invalid data all through your portlet implementations yet no real idea why data is getting corrupted and the portlets aren't showing the right things.

You could, of course, mitigate this by using an app container database connection (defined and accessed using JNDI) to control your resource usage, disable all caching to mitigate the dirty reads and flush after every insert/update to mitigate uncommitted data.

But at this point you've crippled your implementation so much that your performance is now going to blow chunks.

Service Builder eliminates all of these things as issues. Define one SB portlet that manages all data access. The 30 portlets use the SB api to query and update all data, SB can still do caching (cuz there's only one entry point so it's caches never get dirty), it can still have uncommitted data (it's the only one doing data access so it will return the right thing whether it's been committed yet or not), and the single point of entry also manages your resource (db connection) usage.
Jahangir Zinedine
RE: Liferay Porlet Spring MVC full portlet example (with Maven)
March 4, 2014 10:10 PM
Answer

Jahangir Zinedine

Rank: New Member

Posts: 5

Join Date: October 31, 2011

Recent Posts

Thanks for your insightful response.

This was the first Protlet I've tried to develop, though it does not contains any meaningfull functionality but I couldn't find a working version with those specifications, that's why I decided to put together one.

And I knew that as a first Portlet it does not represent best practices.
Most notably I've concerned about how to develop a fully-fledged application with numerous use cases using Portlet.
Should they all belong to a single Portlet or not and if they should be divided into more fine-grained Portlets, how to handle the common services, libraries and functionalities.

IMHO using Liferay Service Builder would bind us to Liferay, I want to develop portable applications.

Worth to mention that I want to develop Portlets using Clojure in near future, I'd appreciate your notes regarding that.
I just think that it would speed up the development cycle beside many other advantages of Clojure itself and it's ecosystem.

Thanks again,
Jani
Nilang I Patel
RE: Liferay Porlet Spring MVC full portlet example (with Maven)
May 8, 2014 7:42 AM
Answer

Nilang I Patel

Rank: New Member

Posts: 18

Join Date: July 25, 2011

Recent Posts

Hi,
You can refer my blog http://www.opensource-techblog.com/2012/09/spring-mvc-portlet-in-liferay.html to get working example of Spring MVC portlet.

Regards
Nilang
Ranjitsinh Reval
RE: Liferay Porlet Spring MVC full portlet example (with Maven)
January 5, 2015 3:49 AM
Answer

Ranjitsinh Reval

Rank: New Member

Posts: 13

Join Date: June 25, 2014

Recent Posts

Using following link we can get full example of liferay spring mvc portlet
http://www.liferaysavvy.com/2013/12/liferay-spring-portlet.html

Thanks.
hicham bouderaa
RE: LIferay Porlet Spring MVC full portlet example (with Maven)
September 15, 2015 10:03 AM
Answer

hicham bouderaa

Rank: New Member

Posts: 2

Join Date: September 15, 2015

Recent Posts

hi,
if u find the answer about your question, so please send me an example of how to use maven, spring MVC and liferay portlet.

Thank you so much