留言板

Liferay 7 - MVCAction vs StrutsPortletAction

Enrico Costanzi,修改在6 年前。

Liferay 7 - MVCAction vs StrutsPortletAction

New Member 帖子: 21 加入日期: 17-2-11 最近的帖子
Is it possible to override a Liferay MVC Portlet Action with a StrutsPortletAction?

I'm asking because there something I don't get in BaseStrutsPortletAction blade sample: the "/login/login" path in the is now mapped by an liferay LoginMVC*Command. So I don't understand if overriding the same path with a BaseStrutsPortletAction could bring to something.

From what I understood I can override the /login/login path only by providing a MVCActionCommand OSGi component with an higher ranking.
thumbnail
David H Nebinger,修改在6 年前。

RE: Liferay 7 - MVCAction vs StrutsPortletAction

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Um, no, they are not the same thing.

Liferay 7 still uses limited struts 1 for handling internal routing of requests to internal action handlers; there's no form handling, no web page returns, heck no real UI at all in this implementation.

Separately, Liferay has migrated all of the portlets to use the Liferay 7 MVC framework that leverages OSGi for all of the routing, and building out a separate override module for the LoginMVC*Commands are necessary.

They are two completely different things and are used for different purposes.

In fact, for the most part there is zero need for a struts action override anymore because the struts actions all handle internal portal tasks, not portlet activities, and rarely would a customization need to touch any of these.







Come meet me at the 2017 LSNA!
Enrico Costanzi,修改在6 年前。

RE: Liferay 7 - MVCAction vs StrutsPortletAction

New Member 帖子: 21 加入日期: 17-2-11 最近的帖子
Thank you David. I Understend, actually we notices the reduced number of struts action.

Now I'm just wondering if the sample is still relevant. And, if it is, what is that supposed to overwrite? I don't find any BaseStrutsPortletAction anywhere in liferay-portal code.
thumbnail
Olaf Kock,修改在6 年前。

RE: Liferay 7 - MVCAction vs StrutsPortletAction

Liferay Legend 帖子: 6403 加入日期: 08-9-23 最近的帖子
The usecase for a struts-action plugin is: When you find something in Liferay that you desparately need to customize and it happens to be implemented as a struts-action: This is what you need to use. The sample shows you how, but it might indeed point to a nonexistent struts-action. You'll need to adopt to your usecase.