Upgrading a Struts 1 Portlet

Upgrading Portlets

Step 6 of 6

Struts is a stable, widely adopted framework that implements the Model View Controller (MVC) design pattern. If you have a Struts portlet for previous versions of Liferay Portal, you can upgrade it to the new DXP version.

Upgrading Struts portlets to the new DXP version is easier than you might think. Liferay DXP lets you continue working with Struts portlets as Java EE web applications.

This tutorial demonstrates how to upgrade a portlet that uses the Struts 1 Framework.

Here’s a sample Struts portlet’s folder structure with file/folder descriptions:

Upgrading a Struts 1 portlet involves these steps:

  1. Adapt the portlet to the new DXP version’s API using the Liferay Upgrade Planner. When running the planner’s Fix Upgrade Problems step, many of the existing issues are autocorrected. For remaining issues, the planner identifies code affected by the new API and ways to adapt it.

  2. Resolve its dependencies

You’ve resolved the Sample Struts portlet’s dependencies. It’s ready to deploy.

On deploying a Struts portlet Web Application aRchive (WAR), Liferay DXP’s Web Application Bundle (WAB) Generator creates an OSGi module (bundle) for the portlet and installs it to Liferay’s OSGi framework. The server prints messages indicating the following portlet status:

The Struts portlet is now available on your Liferay DXP instance. The Struts portlet behaves just as it did on previous versions on your the new DXP version site.

Congratulations on upgrading your Struts portlet to the new DXP version!