Migration Struts 1.x to what?

I have an application that was build with Struts 1.x and her front-end is JSP with FLEX (Action-Script), my idea is to change the front to Angular 6. And my back-end dosen't support REST.

What is the best option to Struts suport REST? I should just add Jersey, or upgrade the entire application to Struts 2.x or even more upgrade to SpringMVC?

Upvotes: 0

Views: 709

Answers (2)

Deva Gerald
Deva Gerald

Reputation: 334

Here’s a discussion on whether it is good to have struts 1 and 2 co-exist in your server. I had a similar situation as you and I started developing all the new REST APIs using struts 2 + REST plug-in and left the older APIs exist in struts 1. As I define newer REST APIs which are alternates to the older struts 1 based APIs, I deprecate the older APIs and remove the respective code.

Upvotes: 1

JCampy
JCampy

Reputation: 191

It's been a while since I have done Struts 2 work, but as I recall, I designed the system I worked on to have a business layer that would support Struts 2 and/or support a REST API. The idea of having Struts in turn use REST, or in some way implement REST seems a bit convoluted to me.

I would suggest that you should take your Struts code and use the underpinnings as a basis to write a REST API. Most of the underlying code should be reusable in that effort. And then write your Angular code to use that new REST interface.

In fact, you may want to approach the problem the way I did: refactor your code to support a business logic layer that gives a solid definition of what you want to allow the upper UI layers to do. Use that as a basis for your existing Struts code as a proof of concept that you can at least support the existing functionality. Then you can use that layer as a basis for the REST API that would be used by an Angular UI. You can then run both, if you want, as users are migrated from one to the other in small sets. This will help with any scaling issues you might encounter in the new code base as well, as opposed to just "flipping a switch" and putting everyone on the new system, just hoping it supports the load.

Upvotes: 1

Related Questions