Child pages
  • Struts 1 Plugin

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

The Struts 1 plugin INLINE

Excerptallows you to use existing Struts 1 Actions and ActionForms in Struts 2 applications

...

This plugin provides a generic Struts 2 Action class to wrap an existing Struts 1 Action, org.apache.struts2.s1.Struts1Action. The wrapper class provides the expected calls to the legacy Struts 1 Action and ActionForm, converting incoming and outgoing objects into the expected forms. It works by using the scoped model driven technique that uses a single Object as the model for every page, very similar to how the Struts 1 ActionForm works. The plugin also provides several interceptors to emulate Struts 1 logic:

...

The Struts 1 plugin is currently only intended to allow you to run Strust 1 actions inside a Struts 2 application. It DOES NOT allow you to continue to use the Struts 1 tag libraries in your JSPs. Your JSPs must be converted to use the Struts 2 tag library.

There is a JIRA ticket open for enhancing this plugin to allow a more seamless transition from Struts 1 to Struts 2 by supporting continued use of the Struts 1 tag libraries in JSPs, however, there is not a scheduled time frame for that functionality to be made available. (Patches are welcomed!)

...

In the most simple case, where you have a Struts 1 Action that you want to use in Struts 2, configure a Struts 2 action using the wrapper:

...

Most likely, you will have an ActionForm that your Struts 1 Action expects. To use an ActionForm, the setup is a little more complicated because you'll need an interceptor that manages the creation and scope (to support request and session scoping like Struts 1) of the ActionForm.

...

Example

This example shows a few Struts 1 Actions, a session-scoped ActionForm, and validation that uses Commons Validator:

...

Settings

This plugin doesn't support any global settings.

...