Foren

struts 1.x portlet

HB Liu, geändert vor 13 Jahren.

struts 1.x portlet

New Member Beiträge: 10 Beitrittsdatum: 02.07.10 Neueste Beiträge
Confusion in Liferay user community centered around struts seems high.

We have a number of StrutsPortlet (MyPortlet extends it) built at the time of 4.4.1 running in production.
Trying to upgrade to Liferay 6, we realize we may need to rewrite these portlets as it seems Liferay is no longer supporting struts 1.x any more. Is that the case? If yes, can you provide some advice so we can assess the effort needed for rewriting?

More about where I come from, sample-struts-liferay-portlet in plugin sdk doesn't work due to StrutsPortlet in portal-impl.jar, which is not available to portlet WAR. I copy paste the sentences from Liferay when I tried to copy the jar to its WEB-INF\lib folder.

Detected inclusion of portal-impl.jar in WEB-INF/lib.
portal-impl.jar is designed with a large number of singleton classes which are
instantiated on the basis that they will exist alone in the application server.
While compile time issues may be resolved, portlets cannot be made to work by
simply adding portal-impl.jar, because doing so violates the above assumption,
and the resulting problems will be extremely difficult to debug.
Please find a solution that does not require portal-impl.jar.


Pulling portal-impl.jar (and its dep) up classloader hierarchy will work but not a good solution.
Pedro Neto, geändert vor 12 Jahren.

RE: struts 1.x portlet

New Member Beiträge: 8 Beitrittsdatum: 26.01.12 Neueste Beiträge
Someone can help me? I have the same problem!
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: struts 1.x portlet

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
Struts 1 is supported, but there's some changes you need to make at the project level. Create a new plugin portlet using the SDK. Copy your code to the appropriate locations. Compile and cleanup, continue as necessary.
Pedro Neto, geändert vor 12 Jahren.

RE: struts 1.x portlet

New Member Beiträge: 8 Beitrittsdatum: 26.01.12 Neueste Beiträge
I'm using struts2 Portlet Plugin, and the same problem continue.
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: struts 1.x portlet

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
Because of the changes from the older version(s) of the SDK. It used to be okay to rely on portal-impl.jar, but no longer. Anything you need access to is in portal-service.jar, and anything not in there you do not have access to.

If you need access, you'd have to go through an EXT plugin.
Venkat Koppavolu, geändert vor 12 Jahren.

RE: struts 1.x portlet

Junior Member Beiträge: 85 Beitrittsdatum: 26.07.10 Neueste Beiträge
1. Go to http://www.liferay.com/downloads/liferay-portal/community-plugins
2. Type StrutsPortlet and download some sample Strut based portlets for your reference.

As per my understand, As we are building portlets as plug-ins, that can be deployed and work independently on portal servers.

Each portal will have some service, we can make use of those services and implement in our own way if we want. portal-service.jar is meant for this and placed at <TOMCAT_HOME>/lib/ext so that each and every plug-in make use of util and some other classes inside it.

Plug-ins should not be more dependent on the implementation part(portal-impl.jar), Liferay recommends try to avoid portal-impl.jar and try for better options(using hooks or ext-plug) if you want to really customize.

Thanks,
Venkat