struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J_e_f_f <>
Subject Re: Running Struts1 and Struts2 together?
Date Tue, 31 Aug 2010 12:09:13 GMT

Stephen Turner wrote:
> but I've no idea how big a job it is, what the pitfalls  
> are etc.
It's not difficult to add struts 2 to an existing struts 1 app. We have two
apps that have both struts1 and struts 2 actions. You just define your
struts 2 filter in your application's web.xml like Andrew's example, and
follow the struts 2 documentation for setting up the rest.

When we made the decision to create any new actions in Struts 2 it seemed
like a good idea but has proven painful at times. If I had the decision to
make again in the same situation, we would have done something
different--staying with Struts1, converting everything to Struts 2, or even
trying the Struts 1 plugin. 

The biggest problem is when you have a struts 1 action configured with a
struts 2 forward. Reasonably so, you have to set the redirect flag to true.
Most of the time this isn't a big deal but if your Struts 1 action has to
propagate error messages to a struts 2 page you have to glue it together,
which is ugly. 

We've had several similar gotchas along the way related to transitioning
from one to the other as well. If you do mix the frameworks, draw a line in
the sand that an action defined in one framework can't have a result in the
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message