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
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • 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
  • The Blue Elephant in the Room: Why PHP Should Not Be Ignored Now or Ever

Trending

  • From AI Chaos to Control: Building Enterprise-Grade LLM Gateways With MuleSoft Anypoint
  • Building a DevOps-Ready Internal Developer Platform: A Hands-On Guide to Golden Paths, Self-Service, and Automated Delivery Pipelines
  • Migrate a Hardcoded LangGraph Agent to LaunchDarkly AI Configs in 20 Minutes
  • When One MVP Is Really Four Systems: A Better Way to Plan Multi-Role Apps

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 user avatar
Kapil Bhardwaj
·
Sep. 20, 17 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
29.6K Views

Join the DZone community and get the full member experience.

Join For Free

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

  • 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
  • The Blue Elephant in the Room: Why PHP Should Not Be Ignored Now or Ever

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • 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