Differences between JSF and JSP

Asked

Viewed 9,352 times

16

Web programming a little while ago (4 months) and went straight to JSF, I mean I didn’t study anything about JSP. I started taking a course and my teacher kind of belittles JSF saying that it has many limitations, that JSP is synonymous with performance, etc.

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

  • 4

    Here is a great response from @Balusc at Soen http://stackoverflow.com/a/2097732/5165064

  • Thanks for the comment @Rafael. From what I read the JSP runs on the server, it can run on the client machine as well, so it can reduce the processing consumption of the server hardware?

  • What runs JSP on the client side is HTML and Javascript

  • I’ve seen too much "JSP is deprecated", but from what I understood in documentation he is considered deprecated when JSF is present. So much so that in the Java EE8 specification it is there: JSR 366.

  • JSF Framework Component based handles the Servlets under the carpets, JSP can work with FW action based, spring,Struts,struts2,vraptor, but if you choose to work on "nail" it is also possible. I will post a response after1

  • 1

    tries to do a JSP table manipulation and sees the suffering.... then thank you for knowing JSF

  • @Pedrolaini when he says "table" is referring to an element table or that code generated by JSF all in table?

  • in JSF, with datatable, you manipulate the data easily... but in JSP it is a suffering

Show 3 more comments

1 answer

12


Differences between JSF and JSP

Strictly speaking, they are technologies of different 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, since along with JSF 2.0 came the Facelets, this yes in order to replace JSP as it is also a framework* for building views and is all JSF oriented.

*Actually they are not frameworks but frameworks specifications.

The official Java documentation informs that 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, more rigid separation between vision and presentation logic, AJAX facilities, etc.

I don’t know any disadvantages of JSF and Facelets compared to JSP, I don’t think there is anything that can be done with JSP that can’t be done with its 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. Nor can I imagine where one could perform better than another.

Then perhaps it is 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 that they are.

  • Thanks for the reply @Caffé

Browser other questions tagged

You are not signed in. Login or sign up in order to post.