Fórumok

extends struts.action.Action or com.liferay.portal.struts.PortletAction ???

thumbnail
Woody Borraccino, módosítva 13 év-val korábban

extends struts.action.Action or com.liferay.portal.struts.PortletAction ???

New Member Bejegyzések: 5 Csatlakozás dátuma: 2010.11.23. Legújabb bejegyzések
Hi all

I'm starting a project with liferay 5.2.3 trying to implement some struts portlets.
I'm are working on a maven enviroment, and what I'm trying to create is a .war with my portlet to deploy under JBoss.

I found same problem as here

Now, reading forum and so on, I've found some workaround, but atm I need to start in the right direction, using things in the best way possible.

My main problem is to understand if I've to extends
org.apache.struts.action.Action
or the provided
com.liferay.portal.struts.PortletAction

In the first case, extending struts.action.Action, I don't have access to PortletConfig, ActionRequest and ActionResponse useful to use methods as addUSer etc...

On the other side, using PortletAction I've to add to my maven pom this dependency
<dependency>
    <groupid>com.liferay.portal</groupid>
    <artifactid>portal-impl</artifactid>
    <version>5.2.1</version>
    <scope>provided</scope>
</dependency> 


With the problem linked above.

Probably moveing my solution to an ext can be a solution, but I don't want to use ext, because seems to be not a good solution in general..

Moving on struts.action.Action extension I've try to add dependency to portal-service and use the addUser in a standard Action but I don't have all data a I need to do that (companyID, serviceContext, etc...) normally retrieved from ActionRequest, not available in the standard struts.Action.

I really don't know which is the right direction to take... please help me emoticon
thumbnail
Woody Borraccino, módosítva 13 év-val korábban

RE: extends struts.action.Action or com.liferay.portal.struts.PortletAction

New Member Bejegyzések: 5 Csatlakozás dátuma: 2010.11.23. Legújabb bejegyzések
Probably I made a little bit confusion in post above.

My problem is that, deploing a portlet as a .war on JBoss I cannot use the ClassLoader fix usable in tomcat, like this:

<!--?xml version="1.0" encoding="UTF-8"?-->
<context>
<loader loaderClass="com.liferay.support.tomcat.loader.PortalClassLoader" />
</context> 


The solution proposed on this forum is to set JBoss configuration as

<property name="useJBossWebLoader">true</property>


but I cannot do that on my enviroment, because of others projects running on Jboss instance.

At this point I've to implement some Struts Portlet, extending struts.action.Action or liferay.struts.ActionPortlet as action.

In first case I'm not able to use some methods, also througth portal-serive.jar, because I don't have the portal contenxt in my action.
In the second case, extending ActionPortlet the war need the previous "useJBossWebLoader" configuration, and this is not possibile for me.

Is there a possibility to configure the portlet .war t be deploy within the liferay war instead of a separeted war, to use the same classloader, giving Maven dependencies (relative to liferay) as provided?