Migrating from the Apache Struts stack to modern platform alternatives

  • struts_vs.jpg

I recently wrote about migrating from Oracle ADF / APEX technologies, but there are other platforms that have their own restrictions, such as the topic of this article – Apache Struts. Struts caught some flak in the news recently when the Equifax hack was revealed to be a result of an unpatched Struts security vulnerability, although that’s not exactly one of the main reasons companies would want to potentially migrate away from the Struts framework.

There’s no doubt that Struts is a mature framework, and although it is still being maintained, it’s unlikely that many new projects are being started on this platform, at least in comparison with other alternatives.

I’ve had my own experiences working in a Struts environment, and it was probably similar to many of the legacy applications out there – big, monolithic environment that’s been patched over by many different developers that don’t have the time and/or patience to fix deeply rooted issues from accrued technical debt. These issues not only caused defects that were so long-standing they basically became product features, they also introduced performance bottlenecks which were usually solved by throwing more hardware into the servers to compensate.

The aforementioned issues from my previous experience are not necessarily an issue with Struts, but something more common with maintaining legacy applications. However, there are many reasons to upgrade from Struts to something more modern:

  • Struts is a relatively tightly coupled framework in the wrong ways, such as forcing JSP usage on the presentation layer
  • Meanwhile the business object layer is not standardized and left up to implementing as teams see fit, causing more overhead and maintenance
  • Despite being an MVC framework, the division between the models, views and controllers is not as clean as other alternative frameworks.
  • Struts is constantly losing market share, and although it has many plugins available for rapid development, other platforms that are more supported will provide better options

Why a migration instead of a repair or application overhaul?

Many of the legacy platforms on Struts are so large that refactoring simply isn’t a reasonable option – it would take just as much – if not less – time to rebuild it from the ground up, and in doing so opens up new opportunities. Of course, since it’s not likely to be migrating from a Java EE environment to something like .Net, I’ll keep some of these topics related to the JVM architecture.

Here are a few architecture modernizations to consider:

  • Micro Services – feel free to mix and match Java, Scala, Kotlin, Clojure or Python, while leaving flexibility to freely upgrade your loosely coupled application in the future. While Struts can kind of be run in a microservices architecture, it’s not an ideal candidate due to how it’s coupled with JSP on the presentation layer.
  • Devops – Implement continuous integration and end-to-end automation testing with commonly used platforms like Docker and Jenkins
  • Upgrading messaging services to something more modern like Apache Kafka, Amazon Kinesis, or Rabbit MQ.
  • Upgrading search engines – Solr is commonly used with legacy Struts applications, but there can be many benefits to updating to something with shema-less JSON like Elasticsearch

Struts replacement option – Spring MVC

The most likely candidate is a replacement is Spring MVC, which is widely gaining popularity as the go-to JVM based framework. Spring is designed around the servlet stack, and has a focus on easy configuration and deployment, which helps speed up your migration efforts.

My employment opportunities over recent years have almost had an identical mixture of technologies with heavy reliance of Spring while also incorporating other platforms like Kafka, Elasticsearch, Docker, and Jenkins. I definitely can attest that from my experience using both Struts and Spring in the past, I have a definite preference for Spring based applications.

Some reasons why migrated from Struts to Spring is a good option:

  • Rapid development with many plugin options and incorporation of Spring Boot
  • Cleaner separation of models, views, and controllers
  • Better web tier integration and simpler testing implementations
  • Ability to work with any presentation layer technologies, Spring has nothing to do with your views at all – just setup your APIs and use any front-end framework you want!
  • Better future-proofing – with Struts usage waning, it will more than likely be phased out in the future and stop receiving major updates. Might as well get ahead of the game and move to something more widely supported.

Rebuilding or migrating a legacy Struts application with Spring doesn’t have to be as daunting as a task as you might think it is. Sure, it’s a lot of work – especially for large enterprise applications, but tools like Spring Boot give a lot of free resources and simplify deployment, meaning new features can also be implemented quickly and more efficiently without having to navigate through bloated legacy application code.

For those who want to live on the cutting edge

Of course, Spring isn’t the only option out there, and companies may want to be pioneers with implementing non-standard platforms that could be considered more cutting-edge. For those that want to be the new trend-setters, read on for some other alternatives.

The MEAN Stack

The MEAN stack, comprising MongoDB, Express.js, AngularJS, and Node.js, is another great option. Despite the acronym indicating that the stack relies exclusively on those technologies, the components can be replaced by other Javascript based frameworks, and can vary widely in implementation. Not a fan of Angular? Swap it out for something like React or Vuejs (my personal front-end favorite).

This open source stack uses Javascript end to end, thereby minimizing complexities arising out of the use of more than one language. This also translates to cost benefits since organizations don’t need to hire specialists in different languages.

MEAN is especially suitable for startups, as Vidit Saxena states in his //medium.com/@viditsaxena/why-mean-stack-is-a-great-technology-choice-for-new-startups-50a200c103a6“>Medium post: “It gives them something they can use when they’re still small, but which will also grow along with them to support more and more intensive applications

without needing to change any of the fundamental work already done.” I believe this capability for seamless scalability is crucial for business owners.

Conclusion

My research online for this article has led to many differing opinions about Struts and its capabilities vs. the competition. In fact, some articles even go so far as to recommend Struts over Spring. Some people can be opinionated on the topic, but it seems like in some cases the writers are really trying hard to find reasons to recommend Struts. For example, in that article I linked above, one of the selling points of Struts is support of AJAX – the writer isn’t exactly wrong, but I would also like to know what platform out there doesn’t support AJAX. That’s like saying the benefits of a sink is that it drains water.

While there isn’t a perfect framework choice out there, I believe most technical people tend to agree that Struts is showing its age, and that options such as Spring are a much better solution. I’ve seen first-hand that most technologies building out newer products are moving away from Struts, and usage statistics certainly add validity to that.

Are you considering migrating away from the Struts framework? Perhaps you have some thoughts on this topic or some alternative suggestions? If so, feel free to leave some feedback in the comments below!

Gain Time, Increase Currency, Contact Us

It’s amazing how one quick email can change your life. Give us a shout! We’ll get back to you right away with the right person for what you’re looking to accomplish.

You don't have to go into a lot of detail now, we'll dial it in later.
=
What our clients are saying…

schneider-national

Aptude provides onsite and offshore Oracle DBA support, which includes troubleshooting, back-up, recovery, migration, upgrades, and daily maintenance of Oracle database servers. Aptude has been working with our team for the past four years and we continue to use them and are satisfied with their work

Warren E., Schneider National

build

Aptude provided Build.com a Java, MySQL, Webservices and other UI based solution in the business domain of analyzing and reporting on user activities for our ecommerce website. Utilizing Omniture’s APIs to download, parse, and regenerate and upload back so that we could be more effective in our marketing. I was satisfied with their project work and delivery and would consider utilizing them for future projects.” Build.com

Dan D., build.com

ugahead

Aptude provided us with Oracle DBA migration support, including an upgrade from Oracle 11.1 to Oracle 11.2, and the project was completed on time and to specifications. The project manager and project consultants were responsive and proactive, resulting in a successful conclusion to the work. I would definitely contract with them again, and have recommended them to other technical offices at the University of Georgia.

David C., University of Georgia

wolters-kluwer

Thank you for the hard work your team has put forth to staff the contract positions at Wolters Kluwer. Aptude has consistently scored high in our supplier carding and even more important you are a vendor we can always trust. I am especially impressed with your ability to tackle our positions that other vendors have not been able to fill.

Andrea G., Wolters Kluwer
By |2018-10-09T18:36:16+00:00June 30th, 2018|

About the Author:

Jerry Virgo
Jerry is a software engineer and content writer with an expertise in developing desktop, mobile, and web applications. To contact Jerry, please feel free to reach out to jvirgo@aptude.com.

It's What We Do