DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Running a Self-Hosted WAF in Production: Practical Lessons From SafeLine
  • Designing Java Web Services That Recover From Failure Instead of Breaking Under Load
  • Cookies Revisited: A Networking Solution for Third-Party Cookies
  • Using Event-Driven Ansible to Monitor Your Web Application

Trending

  • The Man Who Invented Selenium Also Built Its Replacement
  • Agent Harness, Memory Indexing, and AI Governance in Test Automation
  • Building a Feature Store With Neo4j and Feast
  • Designing a Polling Pipeline for Rate-Limited APIs Without Losing Data

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

Struts Migration Strategies

Ready to make the jump to Struts 2? Here is an overview of the differences between Struts 1 and 2 and how to successfully move your projects.

By 
Kapil Bhardwaj
·
Sep. 20, 17 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
29.8K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

This article talks about the strategies for migrating from  Struts 1.1 to Struts 2.0. The Struts framework is one of the most popular web application frameworks in the Java EE world. It has been widely adapted in enterprises and has been a de-facto standard for web applications. Of late, there have been few areas where the Struts community felt the need to improve on some of the architectural areas. Hence, a new version of Struts, Struts 2.x, was released. Therefore, existing applications need to migrate from Struts 1.x to Struts 2.x to leverage the enhanced features of Struts without rewriting the whole application. This document is an effort to allow you to do that.

Table of Contents

  • Introduction

  • Major changes introduced in Struts 2

  • Migration Strategies 

  • Migration Steps

Introduction

Struts 1.0

  • Officially released in 2001 by Craig McClanahan.
  • Provides a unified framework for deploying Servlet and JSP applications using MVC architecture.
  • Multiple utility classes to handle common tasks.

  •  Reached EOL (End-Of-Life)

Struts 2.0

  • Based on the OpenSymphony WebWork2 framework (MVC2 architecture).

  • Cleaner, extensible, and flexible with annotation-based support.

  • Support for REST, Ajax, JSON with plugin-based architecture.

Major Changes in Struts 2

  • S2 Action Classes are POJOs with execute() instead of mandatorily extending S1 abstract Action classes provided by the framework.
  • S2 Actions are thread-safe, as they are instantiated for each request, as compared to S1 Actions, which are singletons.
  • S2 Action classes are more testable as compared to S1, as execute() exposes the Servlet API.
  • OGNL and Interceptors had been introduced in S2, which makes S1 ActionForms obsolete.
  • Convention-over-Configuration support for annotations (e.g. validations).
  • An S2 ValueStack feature allows accessing objects without coupling views.
  • Enhanced Taglib with support for Ajax.
  • Enhanced View technology with support for Velocity and Freemarker templates and XSLT transformations besides JSP.

Struts 1->2 Migration Strategies

Image title

Migration Steps

Image title

Migration Considerations

Image title

Web application

Opinions expressed by DZone contributors are their own.

Related

  • Running a Self-Hosted WAF in Production: Practical Lessons From SafeLine
  • Designing Java Web Services That Recover From Failure Instead of Breaking Under Load
  • Cookies Revisited: A Networking Solution for Third-Party Cookies
  • Using Event-Driven Ansible to Monitor Your Web Application

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook