views:

50

answers:

2

Hello all,

I have heard that you can run an ASP.NET application and ASP.NET mvc application side by side so that you can port existing code over one piece at a time. I was wondering if you could do this with a java framework?

I have a legacy servlet application that I am currently in the process of refactoring. I am thinking about turning it into a jsp application incrementally as this is relatively easy to accomplish ( can call jsps from servlet ). I was wondering if I could maybe take it one step further and instead of porting to jsps, port directly to a framework, like struts / jsf / tapestry / whatever. Is this sort of thing possible? I would need to ensure that it would be done in a side-by-side one component at a time way.

Are there any resources that deal with this specific issue?

Thanks.

A: 

I would think this is more an issue of configuring your web server (apache?) to route different addresses to different servlet containers through a trickily-configured mod_proxy setup.

There may be an easier way that i'm unaware of, however.

Chris
+1  A: 

It all depends very much on the specific framework you want to use.

In broad terms, web frameworks tend to fall into two categories:

  1. page-oriented: JSP + plain-servlets, JSP + Spring MVC, struts, etc
  2. component-oriented: JSF, tapestry, wicket, etc

As your legacy application is page-oriented, it would make sense to port your application also to page-oriented framework, reducing the amount of new concepts that you (and your team) need to learn (and reducing the amount of code you will need to rewrite).

Out of all possible options, I would recommend to use:

  • JSP for view layer - similar to your existing approach of using servlets
  • Spring MVC for non-view layer - quite similar to servlets, but solves quite many common issues out-of-the-box.
  • optionally also use Tiles with these two frameworks (integrates well with JSP). Here is a small example of this approach.
Neeme Praks