Using Spring MVC with JSF [duplicate]
Im using 开发者_开发问答Spring MVC by itself till now, works great, but i hear from friends that JSF is also good, has some good visual stuff, even though i dont really know much bout JSF. So my question is: Is it possible to mix Spring MVC with JSF? If it is, is it a good thing to do or theres a better way to do it?
Try to stick with this equations:
- Spring MVC + ORM (hibernate) + JSP + Jquery
or - EJB + JSF + RichFaces
It is definitely possible but with lot of effort. It's better to use spring framework only for the DI for services and DAO layer and use JSF for front end components. You can define two controllers with two different mappings say one with jsf and one with do and forward requests accordingly.
JSF is primarily component based MVC framework and probably the first successful event based web technology (analogous to Microsoft ASP .Net). One can easily integrate with Spring MVC and it is good approach assuming existing business/web-application has been developed on Spring framework.
It is better to go with JSF2+JDBC(or JPA2) on Tomcat7/JavaEE6 certified servers.
- JSF+EJB3.1+EclipselinkJPA or Hibernate JPA/your choice of JPA implementation
- JSF+JDBC with or without traditional DAO
(1)EJB3.1+JSF2.1/2.2+PrimfeFaces/Tomahawk/Icefaces. Primefaces is one of the best and most popular JSF implementation; because primefaces has got rich UI components and excellent support from forum and nice examples and documentation, inbuilt JQuery support. Few things would be better in Tomahawk adn Icefaces. With JSF2 you can use more than one JSF implementation (i.e. Primefaces & Icefaces). JSF2 is easily pluggable into JDBC, Spring, and other widely used java web technologies.
(2)Just use JDBC+JSF with or without traditional DAOs for small, medium and large commercial web-application projects; because your application would be more easy to develop and maintain, more portable across tomcat and other webcontainers, no need of JavaEE certified (J2EE app servers) servers.
JSF is MVC and best used as View part of MVC
Integrating Spring MVC and JSF 2.1
精彩评论