Insights & Blog

Apache Struts to Spring Boot: Modernizing Legacy Java Web Applications

Struts 1, 2.3 and 2.5 get no more fixes from Apache. How Struts maps to Spring Boot 4, which strategy fits, and a screen-by-screen migration plan.

By Hetal KSoftware Architecture, .NET & APIs

An Eclipse project for a Struts 1.3 claims web application on Java 7 and Tomcat 7 with actions, ActionForms, struts-config.xml, validation.xml and Tiles definitions, marked end of life, flowing through Spring controllers, validation and Thymeleaf into Spring Boot 4, Spring Security, Thymeleaf or REST and Java 25 containers, with a Spring MVC handler method snippet

A Struts to Spring Boot migration moves Java web applications off a framework line that is past end of life, or close to it, onto Spring Boot 4 with Spring MVC, Jakarta EE 11 and a Java 17 or later runtime. Apache lists Struts 1.x as end of life since 5 April 2013, Struts 2.3.x since 12 September 2019 and Struts 2.5.x since 30 October 2023, with no further security fixes for those lines. There is no official automated converter, so the migration is a planned rewrite of the web layer that keeps your business logic. This guide maps Struts concepts to Spring, compares migration strategies and gives a practical roadmap.

Technically reviewed by Harshita Pipaliya.

This is the fifteenth article in our Legacy Modernization Series and the second in its Java section. It follows Java 6/7/8 to Java 25 LTS, because most Struts applications also need a Java upgrade.

Executive summary

  • Support: the Apache Struts end-of-life page lists Struts 1.x (5 April 2013), 2.3.x (12 September 2019) and 2.5.x (30 October 2023) as end of life. For those lines Apache “no longer provides security patches, bug fixes, or updates” (Apache Struts).
  • Current Struts: Struts 6.x and 7.x are the maintained lines. Struts 7 requires Java 17 and moves to Jakarta EE, so even staying on Struts means a significant upgrade.
  • Target: Spring Boot 4.0 reached general availability in November 2025, with baselines of “JDK 17 (while embracing JDK 25), Jakarta EE 11, and Kotlin 2.2” (InfoQ).
  • No converter: Struts actions, forms, tags and configuration have to be rewritten as Spring MVC controllers, validated models and templates. Service and data access code can usually be reused.
  • Our recommendation: migrate the web layer screen by screen with a strangler approach, behind one reverse proxy and one login, onto the latest supported Spring Boot 4.x release on Java 25. Upgrade to a supported Struts release first only if the migration will take longer than your security risk allows.

Struts support status in 2026

Struts lineStatusEnd-of-life dateWhat it means
Struts 1.xEnd of life5 April 2013No security or bug fixes
Struts 2.3.xEnd of life12 September 2019No security or bug fixes
Struts 2.5.xEnd of life30 October 2023No security or bug fixes after the final security-only period
Struts 6.xMaintainedNot listedJava EE (javax) based
Struts 7.xMaintainedNot listedJava 17+, Jakarta EE (jakarta) based

Source: Apache Struts end-of-life versions page and the Struts 1 and Struts 2.5 end-of-life announcements. The Struts 2.5 announcement noted that moving from 2.5 to 6.x “will be smoother” than moving to 7.x.

What this means: applications on Struts 1, 2.3 or 2.5 run on a framework that receives no fixes from Apache. Upgrading to Struts 7 is a real option, but it already involves a Java 17 upgrade, the jakarta namespace and changed core packages, so many teams use that moment to move to Spring Boot instead.

Why Struts applications are a risk

  • Security exposure. Struts 2 has a history of serious vulnerabilities, including CVE-2017-5638, a remote code execution flaw in the Jakarta Multipart parser. End-of-life lines will not receive fixes for new ones.
  • Old Java and servers. Struts 1 and early Struts 2 applications often run on Java 6, 7 or 8 and old WebLogic, WebSphere, JBoss or Tomcat versions (see the previous article).
  • Server-rendered JSP with custom tags. Struts tag libraries, OGNL expressions and Tiles layouts tie the user interface to the framework.
  • Skills. Fewer developers know Struts, while Spring is widely used for Java web development.
  • Blocked upgrades. Old Struts versions pin old libraries, which blocks moves to current Java, Jakarta EE and container platforms.

Spring Boot 4 as the target

ComponentSpring Boot 4.0 baseline
JavaJDK 17 minimum, with JDK 25 supported
FrameworkSpring Framework 7.0
Jakarta EEJakarta EE 11 (Servlet 6.1, Persistence 3.2, Validation 3.1)
Embedded serversTomcat 11.0, Jetty 12.1 (Undertow not supported yet)
JSONJackson 3.0 (packages move from com.fasterxml.jackson to tools.jackson)
ORMHibernate 7.2

Sources: Spring Boot 4.0 release notes and InfoQ’s Spring Framework 7 and Spring Boot 4 report.

Spring Boot open source support windows are short, so plan for regular minor upgrades. HeroDevs’ November 2026 summary lists open source support for Spring Boot 3.5 as ended on 30 June 2026 and for 4.0 as ending on 31 December 2026, with 4.2.0 released on 19 November 2026. Check the official Spring support page for current dates and start on the latest 4.x release.

Struts to Spring concept mapping

Struts 1 / Struts 2Spring Boot / Spring MVCNotes
Action / DispatchAction (Struts 1), action class (Struts 2)@Controller class with handler methodsOne controller per feature, not per screen
ActionForm, Struts 2 action propertiesModel or form object bound with @ModelAttributePlain Java objects or records
struts-config.xml / struts.xml@GetMapping and @PostMapping annotationsRouting lives next to the code
ActionForward, result typesView names, redirect: prefixes, ResponseEntity
Struts Validator (validation.xml), validate()Jakarta Bean Validation (@NotBlank, @Valid) and BindingResultAnnotations on the model
Interceptors (Struts 2), RequestProcessorHandlerInterceptor, servlet filters, Spring Security filters
JSP with Struts tags and OGNLThymeleaf templates, or JSP with Spring form tagsThymeleaf is the common choice with Spring Boot
Tiles layoutsThymeleaf fragments or layout templates
MessageResources (ApplicationResources.properties)MessageSource (messages.properties)Keys can usually be reused
Plug-ins, ServletContext setupSpring beans, @Configuration, auto-configuration
Container-managed or custom securitySpring SecurityAuthentication, authorization, CSRF

Migration strategies compared

StrategyWhat it meansBest forRisk
Upgrade Struts firstMove to a supported Struts 6 or 7 release, then migrate laterLarge apps under urgent security pressureTwo projects; Struts 7 still needs Java 17 and jakarta
Big-bang rewriteRebuild the whole web layer in Spring Boot and switch at onceSmall applications with few screensLong freeze, one risky cutover
Strangler, screen by screenRun Struts and Spring Boot side by side behind a reverse proxy, moving routes in wavesMost enterprise applicationsNeeds shared login and session handling
API plus new front endExpose services as Spring Boot REST APIs and build a new React or Angular UIApps that also need a new user experienceLargest scope; UI redesign decisions

Our recommendation: the strangler approach for most applications. Keep one domain at a time in each wave, reuse service and DAO code where it is sound, and retire Struts routes as their Spring replacements go live. If a full UI redesign is planned anyway, use the API plus new front end route.

Tools and automation

ToolUse
OpenRewrite Spring Boot, Jakarta and Java recipesAutomate dependency, namespace and Java version changes in the reused code
jdeps and jdeprscanFind JDK internal and removed API use before moving to Java 25
Spring InitializrGenerate the new Spring Boot project skeleton
Static analysis of struts-config.xml / struts.xmlBuild the inventory of actions, forwards, forms and validators
AI coding assistantsDraft controllers, models and templates from existing actions and JSPs; every change needs review and tests
Playwright or SeleniumRecord end-to-end tests on Struts screens and replay them against Spring screens

No tool converts Struts actions and JSPs into Spring MVC automatically and reliably. Plan the web layer as a rewrite with tool support.

Code patterns: before and after

The examples below are illustrative and simplified.

1. Struts 1 action and form (before):

public class OrderSearchAction extends Action {
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response) {
        OrderSearchForm f = (OrderSearchForm) form;
        request.setAttribute("orders", orderService.search(f.getCustomerId()));
        return mapping.findForward("success");
    }
}
<action path="/orderSearch" type="com.acme.web.OrderSearchAction"
        name="orderSearchForm" scope="request" validate="true"
        input="/jsp/orderSearch.jsp">
  <forward name="success" path="/jsp/orderList.jsp"/>
</action>

2. Spring Boot controller (after):

@Controller
@RequestMapping("/orders")
public class OrderController {

    private final OrderService orderService;

    public OrderController(OrderService orderService) {
        this.orderService = orderService;
    }

    @GetMapping("/search")
    public String searchForm(@ModelAttribute("criteria") OrderSearch criteria) {
        return "orders/search";
    }

    @PostMapping("/search")
    public String search(@Valid @ModelAttribute("criteria") OrderSearch criteria,
                         BindingResult result, Model model) {
        if (result.hasErrors()) {
            return "orders/search";
        }
        model.addAttribute("orders", orderService.search(criteria.customerId()));
        return "orders/list";
    }
}

3. Validation moves from validation.xml to annotations:

public record OrderSearch(
    @NotBlank @Size(max = 12) String customerId,
    @PastOrPresent LocalDate fromDate) { }

4. Struts tags become Thymeleaf:

<!-- Before: JSP with Struts 1 tags -->
<html:form action="/orderSearch">
  <html:text property="customerId"/> <html:errors property="customerId"/>
  <html:submit value="Search"/>
</html:form>

<!-- After: Thymeleaf -->
<form th:action="@{/orders/search}" th:object="${criteria}" method="post">
  <input type="text" th:field="*{customerId}">
  <span th:if="${#fields.hasErrors('customerId')}" th:errors="*{customerId}"></span>
  <button type="submit">Search</button>
</form>

5. Spring Security replaces custom login checks:

@Bean
SecurityFilterChain security(HttpSecurity http) throws Exception {
    http.authorizeHttpRequests(auth -> auth
            .requestMatchers("/css/**", "/login").permitAll()
            .requestMatchers("/admin/**").hasRole("ADMIN")
            .anyRequest().authenticated())
        .formLogin(Customizer.withDefaults());
    return http.build();
}

6. Strangler routing at the reverse proxy (NGINX example):

location /orders/ { proxy_pass http://spring-boot-app:8080; }
location /        { proxy_pass http://legacy-struts-app:8080; }
Apache Struts to Spring Boot target architecture: a legacy Struts 1 or Struts 2 application with actions, ActionForms, struts-config.xml, JSP tags, OGNL, Tiles and the Struts Validator on an old Java application server runs behind a reverse proxy alongside a new Spring Boot 4 application with Spring MVC controllers, Bean Validation, Thymeleaf or a REST API for a new front end, Spring Security and Spring Data, sharing reused service and data access code, on Java 25 with containers, CI/CD and observability
  1. Entry point: a reverse proxy or API gateway that routes migrated paths to Spring Boot and the rest to Struts.
  2. Web layer: Spring MVC controllers with Thymeleaf, or REST controllers for a React or Angular front end.
  3. Security: Spring Security with single sign-on (for example OpenID Connect) shared by both applications during the transition.
  4. Business and data layers: existing service code moved into Spring beans; data access on Spring Data JPA or JDBC.
  5. Platform: Java 25, embedded Tomcat or Jetty, container images, CI/CD and observability with metrics, logs and traces.

Running Struts applications you need to retire? Talk to our modernization team about an inventory and a screen-by-screen plan.

Step-by-step migration roadmap

  1. Inventory (2 to 4 weeks): list actions, forms, forwards, validators, JSPs, Tiles definitions, interceptors, plug-ins and integrations from the Struts configuration; rank screens by usage and risk.
  2. Reduce immediate risk: patch or upgrade to a supported Struts release, or add web application firewall rules, if the migration will take many months.
  3. Separate business logic: move logic out of actions into services that both applications can call.
  4. Set up the platform: Spring Boot project, reverse proxy, shared login, CI/CD, containers and test automation.
  5. Pilot a domain: migrate one set of screens end to end and run both versions in parallel.
  6. Migrate in waves: move domains one at a time, switching routes at the proxy and comparing behaviour with recorded end-to-end tests.
  7. Decommission: remove Struts once traffic to its routes reaches zero, then retire the old application server and Java runtime.

Security considerations

  • Close the gap early: end-of-life Struts lines will not get fixes for new vulnerabilities, so prioritize internet-facing screens and file upload features in the first waves.
  • Input handling: replace OGNL-based binding with explicit model binding and Bean Validation.
  • Authentication: use Spring Security with your identity provider; avoid custom session flags for login state.
  • CSRF and headers: Spring Security enables CSRF protection by default for form posts; add security headers at the proxy or in the application.
  • Supply chain: generate an SBOM, scan dependencies and remove old libraries that Struts pulled in.

Testing, deployment and support

Testing

  • Record end-to-end tests on each Struts screen before migrating it, then replay them against the Spring version.
  • Unit test controllers with Spring MVC test support and models with Bean Validation tests.
  • Run security scans and load tests on the new routes before switching traffic.

Deployment

  • Deploy Spring Boot as a container with health checks; switch routes at the proxy, so rollback is a routing change.
  • Keep both applications on the same login and session timeout policy during the transition.

Support

  • Plan regular Spring Boot minor upgrades to stay within open source support, or budget for commercial support.
  • Track Java LTS and Spring support dates together.

Cost, effort and timeline

The ranges below are indicative planning assumptions, not benchmarks or quotes.

Application profileTypical scopeIndicative cost (USD)Indicative duration
SmallUp to 30 screens, simple forms, logic mostly in services$30,000 to $100,0002 to 4 months
Medium30 to 150 screens, Tiles, custom tags, integrations$100,000 to $450,0004 to 10 months
Large150+ screens, logic in actions, multiple apps, EJB or app server APIs$450,000 to $1.5M+10 to 24+ months

Cost drivers: screen count, how much logic sits in actions and JSPs, custom tags, test coverage, the Java upgrade and UI redesign decisions. See legacy application modernization cost and ROI and microservices vs monolithic architecture if you are also deciding how to split the application.

FAQs

Is Apache Struts still supported?

Struts 6.x and 7.x are maintained. Apache lists Struts 1.x, 2.3.x and 2.5.x as end of life, with no further security patches or bug fixes for those lines.

Can Struts be converted to Spring Boot automatically?

No reliable tool converts Struts actions, forms and JSPs into Spring MVC. Tools such as OpenRewrite help with dependencies, Java versions and the jakarta namespace, and AI assistants can draft code, but the web layer needs a planned rewrite and testing.

Should we upgrade to Struts 7 instead of moving to Spring Boot?

It can be a short-term fix for security. Struts 7 still needs Java 17 and the jakarta namespace, so the effort is significant. If you plan to leave Struts anyway, moving to Spring Boot usually gives more long-term value.

Which Spring Boot version should we target?

Start on the latest supported Spring Boot 4.x release. Spring Boot 4 requires Java 17 or later and Jakarta EE 11, and works with Java 25 LTS.

Can Struts and Spring Boot run side by side?

Yes. A reverse proxy can route migrated paths to Spring Boot and the rest to Struts. Shared single sign-on keeps users logged in across both.

Do we have to replace JSP?

No, Spring MVC supports JSP. Most teams move to Thymeleaf with Spring Boot because it works with embedded servers and executable JARs, or build a new front end on REST APIs.

How long does a Struts to Spring Boot migration take?

Small applications can move in two to four months. Large applications with hundreds of screens and logic in actions often take one to two years in waves.

Conclusion

Struts 1, 2.3 and 2.5 receive no more fixes, and even current Struts requires a large upgrade. Moving to Spring Boot 4 on Java 25 gives a widely supported platform. Inventory the Struts configuration, pull business logic into services, put a proxy and shared login in front, and migrate screen by screen with recorded tests until Struts can be switched off.

Previous in this series: Java 6/7/8 to Java 25 LTS. Next: AngularJS to Modern Angular.

Related services: Legacy Software Modernization · DevOps Services · Microsoft Azure · AWS · Hire DevOps Engineers

Sources

Plan your Struts to Spring Boot migration

Prominent.tech helps teams move Apache Struts applications to Spring Boot on Java 25, screen by screen, with recorded end-to-end tests, shared sign-on, CI/CD and containers in place. Talk to our modernization team or explore our legacy software modernization services.

From insight to implementation

Turn these ideas into a practical plan

Discuss how the ideas in this article apply to your business, systems and data. We’ll help you identify a focused first step.