Differences between JSF and JSP

16

Web programming recently (4 months) and went straight to JSF , that is, I did not study anything about JSP . I started to take a course and my teacher kind of belittles JSF saying that he has many limitations, that JSP is synonymous with performance, etc.

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

    
asked by anonymous 18.08.2015 / 14:00

1 answer

12

Differences between JSF and JSP

Strictly speaking, they are distinct-scoped technologies: JSP is a framework for building visions while JSF is a framework for the entire presentation layer based on (but not limited to) a) MVC .

But in practice JSF replaces the JSP, since along with JSF 2.0 came Facelets , this one meant to replace the JSP since it is also a framework * for building visions and is all JSF oriented.

* In fact they are not frameworks but framework specifications.

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

Advantages and disadvantages

JSF and Facelets have brought many advantages over the old way of doing (JSP), for example: templates, composite components, more rigid separation between vision and presentation logic, AJAX facilities, etc.

I do not know of any disadvantages of JSF and Facelets in relation to the JSP, I do not think there is anything that can be done with JSP that can not be done with your substitutes. The JSP "pages" are actually "compiled" for Java code becoming Servlets, and using JSF you can still extend your application by creating your own Servlets. Also I can not imagine where one could perform better than another.

Then it may be the case 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.

    
18.08.2015 / 15:45