File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes difference between JSP and JSF? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "difference between JSP and JSF?" Watch "difference between JSP and JSF?" New topic
Author

difference between JSP and JSF?

Ravissant Markenday
Ranch Hand

Joined: Nov 12, 2006
Posts: 47
hi everyone!

I was doing JSP(java server pages) when i came across this term-JSF(java server faces) .Could anyone tell me the difference between JSP and JSF? also does JSF have anything to do with STRUTS?

Many thanks,

Ravissant MArkenday
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961

JavaServer Pages (JSP) is a Java technology that allows software developers to dynamically generate HTML, XML or other types of documents in response to a Web client request.



JavaServer Faces (JSF) is a Java-based Web application framework that simplifies the development of user interfaces for Java EE applications. Out of the box, JSF uses JavaServer Pages for its display technology, but JSF can also accommodate other display technologies, such as XUL, for example.



Apache Struts is an open-source framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller (MVC) architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000. Formerly located under the Apache Jakarta Project and known as Jakarta Struts, it became a top level Apache project in 2005.
Ravissant Markenday
Ranch Hand

Joined: Nov 12, 2006
Posts: 47
Thanks for the reply Edwin. Ok so do i need to do JFC too to master JSP?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

JFC (Java Foundation Classes, basically a very outdated name for Swing) has nothing to do with the Web; it's a desktop GUI framework.


[Jess in Action][AskingGoodQuestions]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Ravissant Markenday:
Thanks for the reply Edwin. Ok so do i need to do JFC too to master JSP?


So, you jumped on JFC from JSF. I think I should take it as mistake and rather think JSF.

No. You don't need to learn JSF to master JSP.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Originally posted by Adeel Ansari:
No. You don't need to learn JSF to master JSP.


In fact, it would be best advised to go the other way. Learn JSP's before moving to JSF, though moving to JSF for any reason is arguably a bad idea, IMHO. ;)


GenRocket - A Test Data Generation Platform
Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Posts: 138
Sherriff, Sir, please elaborate on why moving to JSF is a bad idea? Tanks and guns.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

Because, in my opinion (as well as others), JSF is an abomination that should never have seen the light of day.

Here is my view of how JSF would be used to wipe your mouth:


And then there are those who love JSF. To each.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Posts: 138
Fair enough! Good, Sir, said the juggler to the world's strongest man :-)
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
I have just finished studying JSF. I found it good in the abstract but lousy in its implementation for the following reasons:

1. There is too much to do to get anything done - even the simple things. You have to create Java, JSP, and XML files and get them all running together

2. The runtime errors are not descriptive at all so it takes a long time to debug

3. The runtime sometimes give you an error pointing to one place when the error is actually in another place, requiring you to take even more time to debug

4. You have to spend a lot of time coding presentation objects when the framework should better support your value objects.

5. Changing anything is difficult because of all the runtime errors introduced by the framework. Compile time errors are your friend. Runtime errors are evil.

6. Because of all the above, you have to do baby-step incremental programming which, again, is time-consuming.

7. Using the debugger (in Eclipse) kept crashing the server. While this is not a JSF problem per se, it stills slows development.

8. It adds yet more syntax to JSP code, which means developers have to learn and retain this knowledge.

So to sum up, it will take you longer building a JSF app then using something else. And time is money.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Well then check JBoss Seam framework, it makes JSF development more easier and productive.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

John Todd wrote:Well then check JBoss Seam framework, it makes JSF development more easier and productive.

When you need a framework to use a framework, you gotta know something is wrong!
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
John Todd wrote:Well then check JBoss Seam framework, it makes JSF development more easier and productive.


If you use JBoss Seam framework, are you restricted to using JBoss?
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Bear Bibeault wrote:
John Todd wrote:Well then check JBoss Seam framework, it makes JSF development more easier and productive.

When you need a framework to use a framework, you gotta know something is wrong!

You are right Mr. Bear.
I'm not advocating JSF, actually I deleted it from my mind but JBoss Seam makes JSF development doable.
Tom,
Seam provides tight integration with many JBoss projects (like RichFaces and Drools) but this doesn't mean it will locks you in.
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 383

Thanks for all the knowledge ... I have a question ...

for web development in java one should move towards which framework ... ??? and obviously which one has more future prospects ???



http://plainoldjavaobject.blogspot.in
aur rashed
Greenhorn

Joined: Sep 28, 2011
Posts: 2
Would it be too late to ask about the same title ?

I am studying Servlets and JSPs , and since a short time I've turned to JSF , but I'm kinda confused about the difference between them , so I have some questions here which I -hopefully- would find their answers :

1- What is the "real" difference between JSPs and JSFs ? I reviewed many definitions for both , but couldn't grasp the difference exactly
many definitions describes JSPs as a "Java View Technology" , while JSF is "Component-based framework . In other words : when should I - after viewing a code for a java web app - shout : "This is JSP" or "This is JSF" ?

2- I'm confused about the tag libraries of both JSP and JSF :

JavaServer Faces HTML Tag Library prefixed : h
JavaServer Faces Core Tag Library prefixed : f
JSTL Core Tag Library prefixed : c

can I use any tag library with both of JSP and JSF ?


3- where does the Facelets fit in all of this ? the relation between facelets->JSFs and facelets->JSPs.

4- When to use JSP/JSF ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between JSP and JSF?
 
Similar Threads
Question on JSF
To Hans: Difference between Struts and JSF
JSF and JSP
future of JSF
differenc e between JSP & JSF TECHNOLOGY