views:

18

answers:

1

I'm not a fan of JSF. Spring MVC makes a lot of sense to me and I've used it in the past.

Can you talk me out of it or provide tips for integrating it nicely into JEE6 and share and gotchas with CDI.

I don't mind having an application context just for the MVC stuff but if I use @Inject or @EJB in my MVC controllers, what's going to go wrongly?

Seam3 seems interesting though is it ready for production?

A: 

Can you talk me out of it or provide tips for integrating it nicely into JEE6 and share and gotchas with CDI

Maybe I'm wrong but I think that you somehow have to make a choice between CDI and the DI part of Spring, one of them has to be responsible of creating objects for the magic to occur. So if you want to use CDI with Spring MVC, you'd have to make your controllers CDI beans. From JavaOne 2010 : Java EE 6 Panel "What do we do now?" notes:

SpringMVC and CDI? => Technically possible: use CDI beans as controllers (but Reza says they're not seeing enough demand for SpringMVC to do the work).

I also warmly suggest to have a look at Java EE 6 (CDI / EJB 3.1) XOR Spring Core Reloaded.

I don't mind having an application context just for the MVC stuff but if I use @Inject or @EJB in my MVC controllers, what's going to go wrongly?

Spring provides built-in support of "at inject" from JSR-330 and also provides some magic for @EJB. If that's all you're looking for, Spring will work. But that's just not what CDI (JSR-299) gives you.

Pascal Thivent