掲示板

LIferay Porlet Spring MVC full portlet example (with Maven)

thumbnail
10年前 に Carlos Adolfo Ortiz Quirós によって更新されました。

LIferay Porlet Spring MVC full portlet example (with Maven)

Junior Member 投稿: 40 参加年月日: 10/05/22 最新の投稿
Hi

Do you know of a full example to write a porlet using Spring MVC Portlet and Maven support for liferay 6.1.x?
thumbnail
10年前 に Manish Yadav によって更新されました。

RE: LIferay Porlet Spring MVC full portlet example (with Maven)

Expert 投稿: 493 参加年月日: 12/05/26 最新の投稿
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
thumbnail
10年前 に David H Nebinger によって更新されました。

RE: LIferay Porlet Spring MVC full portlet example (with Maven)

Liferay Legend 投稿: 14914 参加年月日: 06/09/02 最新の投稿
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.
thumbnail
10年前 に Carlos Adolfo Ortiz Quirós によって更新されました。

RE: LIferay Porlet Spring MVC full portlet example (with Maven)

Junior Member 投稿: 40 参加年月日: 10/05/22 最新の投稿
Yes Indeed
thumbnail
10年前 に Carlos Adolfo Ortiz Quirós によって更新されました。

RE: LIferay Porlet Spring MVC full portlet example (with Maven)

Junior Member 投稿: 40 参加年月日: 10/05/22 最新の投稿
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
thumbnail
10年前 に Carlos Adolfo Ortiz Quirós によって更新されました。

RE: LIferay Porlet Spring MVC full portlet example (with Maven)

Junior Member 投稿: 40 参加年月日: 10/05/22 最新の投稿
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
10年前 に Vijayakumar L によって更新されました。

RE: Liferay Porlet Spring MVC full portlet example (with Maven)

New Member 投稿: 13 参加年月日: 13/04/30 最新の投稿
Hi Carlos,
Refer this site, http://books.dzone.com/articles/hello-world-portlet-using-Spring-3-portlet-MVC
thumbnail
10年前 に Carlos Adolfo Ortiz Quirós によって更新されました。

RE: Liferay Porlet Spring MVC full portlet example (with Maven) (回答)

Junior Member 投稿: 40 参加年月日: 10/05/22 最新の投稿
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.
thumbnail
10年前 に Jahangir Zinedine によって更新されました。

RE: Liferay Porlet Spring MVC full portlet example (with Maven)

New Member 投稿: 5 参加年月日: 11/10/31 最新の投稿
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
thumbnail
10年前 に David H Nebinger によって更新されました。

RE: Liferay Porlet Spring MVC full portlet example (with Maven)

Liferay Legend 投稿: 14914 参加年月日: 06/09/02 最新の投稿
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.
thumbnail
10年前 に Jahangir Zinedine によって更新されました。

RE: Liferay Porlet Spring MVC full portlet example (with Maven)

New Member 投稿: 5 参加年月日: 11/10/31 最新の投稿
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
9年前 に Nilang I Patel によって更新されました。

RE: Liferay Porlet Spring MVC full portlet example (with Maven)

Junior Member 投稿: 31 参加年月日: 11/07/26 最新の投稿
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
9年前 に Ranjit Reval によって更新されました。

RE: Liferay Porlet Spring MVC full portlet example (with Maven)

New Member 投稿: 13 参加年月日: 14/06/25 最新の投稿
Using following link we can get full example of liferay spring mvc portlet
http://www.liferaysavvy.com/2013/12/liferay-spring-portlet.html

Thanks.
8年前 に hicham bouderaa によって更新されました。

RE: LIferay Porlet Spring MVC full portlet example (with Maven)

New Member 投稿: 2 参加年月日: 15/09/15 最新の投稿
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
6年前 に Nilang I Patel によって更新されました。

RE: LIferay Porlet Spring MVC full portlet example (with Maven)

Junior Member 投稿: 31 参加年月日: 11/07/26 最新の投稿
Hi,

Follow steps to create Spring MVC Portlet with Maven

If you are new to Maven, you can check how to create Liferay Maven Plugin

Regards
Nilang