留言板

How to Create Spring MVC portlet in Liferay 7 using Gradle?

thumbnail
Anuvab Ghosh,修改在6 年前。

How to Create Spring MVC portlet in Liferay 7 using Gradle?

Regular Member 帖子: 130 加入日期: 15-4-18 最近的帖子
Hi,

I am using Liferay 7 ga3. I want to develop a Spring MVC portlet using Gradle. But could not find such proper document or tutorial.
Anyone can guide me step by step? If links are available please provide the links.

I have created an MVC portlet through Gradle and also added the Spring dependencies in Gradle. But WEB-INF, web.xml, portlet.xml are not available in this project structure due to the new Liferay 7 changes. I am unable to proceed further.

Please help me out.

Thanks in advance.

Regards,
Anuvab
thumbnail
David H Nebinger,修改在6 年前。

RE: How to Create Spring MVC portlet in Liferay 7 using Gradle?

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Anuvab Ghosh:
Anyone can guide me step by step? If links are available please provide the links.


You must not have looked very hard...https://web.liferay.com/web/user.26526/blog/-/blogs/creating-a-spring-mvc-portlet-war-in-the-liferay-workspace








Come meet me at the 2017 LSNA!
thumbnail
Anuvab Ghosh,修改在6 年前。

RE: How to Create Spring MVC portlet in Liferay 7 using Gradle?

Regular Member 帖子: 130 加入日期: 15-4-18 最近的帖子
Thanks for the link.

But I want to know why we are using all the xml related to liferay/portlet here?

In case of creation of MVC portlet using Gradle no xmls are created in the project.

Regards,
Anuvab
thumbnail
David H Nebinger,修改在6 年前。

RE: How to Create Spring MVC portlet in Liferay 7 using Gradle?

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Two different things...

The Liferay MVC is fully supported as an OSGi module because it has no dependencies on a corresponding servlet context.

War-based containers are necessary for Spring MVC (and I think faces, but I don't know for sure) because they have dependencies on a servlet context. For those, they cannot be turned directly into module jars on their own.









Come meet me at the 2017 LSNA!
thumbnail
Neil Griffin,修改在6 年前。

RE: How to Create Spring MVC portlet in Liferay 7 using Gradle?

Liferay Legend 帖子: 2655 加入日期: 05-7-27 最近的帖子
The Portlet API, Faces API, and FacesBridge API do not have any compile-time dependencies on the Java Servlet API but the Portlet Spec does recognize that portlets are deployed as WAR modules and may take advantage of Servlet API features like javax.servlet.ServletContainerInitializer and javax.servlet.ServletContextListener. Also, frameworks like JSF require a WAR shaped layout (directory structure) because the framework expects to be able to see files like WEB-INF/faces-config.xml, etc.