Differences between JSF and JSP


I've been programming web for a short time (4 months) and I went straight to JSF , that is, I didn't study anything about JSP . I started taking a course and my teacher sort of belittles JSF saying that it has a lot of limitations, that JSP is synonymous with performance, etc.

JSP all that, or are these people not familiar with JSF ? Because as this same teacher of mine says, he implements several things in "Hand" while with PrimeFaces I have everything ready. What are the main differences between the two?


Differences between JSF and JSP

Strictly speaking these are technologies of distinct scope: JSP is a framework* for building views while JSF is a framework* for the entire presentation layer, based on (but not limited to) MVC .

But in practice JSF replaces JSP, as with JSF 2.0 came Facelets , this one with the objective of replacing JSP as it is also a framework* for building views and is entirely JSF oriented.

*Actually they are not frameworks but framework specifications.

The official Java documentation states that the JSP is deprecated , being replaced by Facelets : Java EE 6 Tutorial .

Advantages and disadvantages

JSF and Facelets brought numerous advantages over the old way of doing (JSP), for example: templates, composite components , stricter separation between view and presentation logic, AJAX facilities, etc.

I don't know of any disadvantages of JSF and Facelets over JSP, I don't think there's anything that can be done with JSP that can't be done with their replacements. The JSP "pages" are actually "compiled" into Java code to become Servlets, and using JSF you can still extend your application by creating your own Servlets. I also can't imagine where one could perform better than the other.

So maybe it's time to ask your teacher for a list of disadvantages and then you can analyze them and find out if they are problems for you and your applications. I particularly doubt they are.

Scroll to Top