Skip to content

andoan16/struts-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Struts 2 Migration Tool

Overview

This is a Python 3 application designed to facilitate the migration of Struts 2 source code by refactoring CSS class names and JSP property classes. It handles Java Action classes and Java objects that map with JSP properties.

Prerequisites

  • Python 3.6 or higher
  • Tkinter (usually included with Python)
  • Required Python packages:
    pip install tkinter

Installation

  1. Clone or download the repository
  2. Ensure Python 3 is installed
  3. Place the struts_migrator.py and rules_example.json in your working directory

Usage

  1. Run the application:

    python struts_migrator.py
  2. Use the GUI to:

    • Select the Struts 2 project folder
    • Select the rules JSON file
    • Click "Start Migration" to begin the refactoring process
  3. The application will:

    • Create a backup of the project folder
    • Process all JSP and Java files
    • Apply refactoring rules
    • Display progress and status messages

Rules File Format

The rules file must be in JSON format. See rules_example.json for an example:

{
    "css_class_name_changes": {
        "oldClassName": "newClassName",
        "anotherOldClass": "anotherNewClass"
    },
    "jsp_property_changes": {
        "oldProperty": "newProperty",
        "oldAction": "newAction"
    }
}

Features

  • Intuitive GUI with file selection and progress monitoring
  • Automatic backup of original files
  • Error handling for invalid paths and parsing issues
  • Logging of operations and errors
  • Support for CSS class name refactoring
  • Support for JSP property and Java Action class refactoring

Notes

  • Always verify the backup before proceeding with migration
  • Test the rules file with a small project first
  • The application creates a timestamped backup folder
  • Check the status window for detailed processing information

Troubleshooting

  • Ensure all paths are valid
  • Verify the rules file is properly formatted JSON
  • Check the console for detailed error messages

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages