views:

33

answers:

2

This question just flows through my mind and I hope you here can tell me how.

And since each framework extends the servlets, so I wonder how to share data across them such as I insert an Integer into Session using Struts, can I get that Integer in SpringMVC or Seam.

A: 

Well, frameworks like Struts, Spring MVC, JSF can technically coexist and one could use the application context, the session or even the request depending on the situation to share things between them.

But IMO the real question is why would you do that? Why multiplying configuration files, why loading classes from overlapping frameworks, why making things more complicated and harder to maintain? People usually don't do that, they pick one solution and use it.

Pascal Thivent
This thought just flows through my mind since I see many PHP sites out there use multiple frameworks.
Truong Ha
+1  A: 

I have mixed feeling on this one. Most framework do rely one way or the other on a front-controller, that is, a servlet than intercepts the requests to various URL and dispatch the processing. You could maybe configure each framework to intercept different URL (e.g. /faces/* for JSF, /actions/* for Struts) to avoid clashes and make them coexist.

They are all based on the Servlet API, so you could maybe forward the processing of request from one framework to another using the Servlet API or access whatever is stored in the request using the Servlet API, but that sounds rather tricky to me, plus I don't see exactly the need to combine two frameworks.

ewernli