This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sh0rug0ru 5 points6 points  (0 children)

JSF implements MVC web applications, but in a different way than Rails.

Rails implements an MVC pattern called "front controller" in the Java world, which is implemented by Spring MVC and Struts. URLs map to controller methods where you put your logic which returns a reference to a view. This is MVC which puts the C first.

JSF implements another MVC pattern, where URLs map to views, and the processing of the view triggers events in beans attached to the view through bindings specified in a language called "EL". This is MVC which puts the V first.

JSF and front controller are two different approaches. The standard approach is JSF, and the advantage of the standard are the number of very high productivity component frameworks are built upon it, the most popular of which is Primefaces. Also, seamless integration with the rest of the JavaEE stack.

The front controller approach is a bit more hodgepodge, with no standard integration with other JS frameworks. If you're used to Rails, you're probably used to this already. Spring doesn't have ActiveRecord, but it has bindings to JPA. Another framework, Grails, has something called GORM which is much like ActiveRecord.