Skip to content

ibm-self-serve-assets/wca-struts-to-springboot-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

watsonx Code Assistant - Struts to Springboot migration

Struts application can be Migrated to Springboot application using the watsonx Code Assistant (WCA).

This feature needs to be GAed by Q2.

Migration Process

WCA does the following steps to convert the Struts to Springboot application.

  • Analyze Java code for modernization opportunities
  • Generate migration recommendations
  • Transform code between different Java frameworks and specifications
  • Preserve business logic while updating implementation patterns
  • Convert build configurations between different build systems

Sample Code and migrated code

The sample struts code, the converted springboot code and the logs are given for few sample applications.

Application Struts Code Converted springboot code Logs Fix Instruction
Sample App Link Link Link Link
Auto Insurance Link Link Link
Banking Link Link Link

Installation (IBMers only)

  1. Clone the repository:
git clone https://github.ibm.com/watsonx-apac/wca-springboot.git
cd wca-springboot
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up your IBM Cloud API key in .env file:
IAM_APIKEY=your_api_key_here
  1. Execute the below command.
python wca_springboot.py migrate-structs ./path/to/struts/app --output ./custom/output/path

Migration

Here are the code changes done by this tool.

1. Spring Boot Project Structure

As a first step, it creates Spring Boot project structure

You can view the entire Spring Boot code here.

2. Struts Actions to Spring boot rest controller

The CustomerAction from Struts is converted into CustomerController

The converted springboot controller is accessed through RESTful endpoints instead of a method parameter.

The CustomerService from Struts is converted into service layer CustomerService

3. Migrate Form beans and DTOs

The Struts Form/DTO is converted into Spring Boot DTO equivalent.

The CustomerForm from Struts is converted into springboot Customer

The CustomerDTO from Struts is converted into springboot CustomerDTO

4. Migrates JSP views to modern templates

The JSP pages are migrated to Thymeleaf.

form.jsp ---> form.html

list.jsp ---> list.html

5. Updates dependencies and configuration

pom.xml file is migrated.

pom.xml ---> pom.xml

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published