wood burning stoves 2.0*
The moose likes JSP and the fly likes JSF vs .HTML/JSP and Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSF vs .HTML/JSP and Servlets" Watch "JSF vs .HTML/JSP and Servlets" New topic
Author

JSF vs .HTML/JSP and Servlets

mike nelson
Greenhorn

Joined: Jan 30, 2002
Posts: 1
Why use JSF vs. using html/jsp and Servlets?
Any good examples of JSF (full/complete application using jdbc/databases).
Maybe a web site/url.

thanks
Mike
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
HTML and JSP are views. Browsers only understand HTML, and thus, JSF cannot replaces HTML, but it can be used to generate HTML codes for fancy client interface.
Since JSF is client component stuffs, i dont know whether it can make connections to JDBC, but if not, I guess, JSP or Servlets can embed it, and provide the interface, and the database connection job is done by Servlets.
Personally, I think JSF shares the similar ideas of JSTL, which provides a standardize method to generate the client interface. And all technologies you mentioned are supplementary, not competative.
Nick.


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Nicholas Cheung:
...but it can be used to generate HTML codes for fancy client interface.
Since JSF is client component stuffs, i dont know whether it can make connections to JDBC, but if not, I guess, JSP or Servlets can embed it, and provide the interface, and the database connection job is done by Servlets.
Personally, I think JSF shares the similar ideas of JSTL, which provides a standardize method to generate the client interface. And all technologies you mentioned are supplementary, not competative.
Nick.

Nick, you might want to consider reading up more on JSTL and what it is used for. I don't think your statement is very accurate. JSTL doesn't really do any HTML rendering. At least, not the same way that JSF does. JSF shares similar ideas to Struts more than it does to JSTL. JSF is not merely a UI Rendering Framework. It utalizes a Navigation Model similar to Struts ActionForwards but a bit simpler. It also implements it's own validation framework for the UI Components.
And again, as I said in another post, JSF cannot render anything fancy beyond that of HTML. It might make it easier, but that remains to be seen. You still have to apply CSS to JSF components for them to be "fancy".


GenRocket - Experts at Building Test Data
Bill Dudney
Author
Ranch Hand

Joined: Sep 05, 2003
Posts: 234
Hi All,
Yes Nick you should read up a bit more. JSF is a component framework but not a clientside framework. It is a serverside component framework for building web applications. (thanks again Greg)
Now to Mike's original post -- My blog has some code on it that I posted late last year that does hit the db (through hibernate though which is much simpler than JDBC IMO). The code that comes with the RI does not hit the db but there is a full fledged app there (car store).
Why JSF instead of JPS/Servlet? -- Well one of the most practical reasons in my mind is not having to implement a navigation model again. How many times do we as an industry have to implement the FrontController? Lets use one of the existing ones instead of cooking our own. There are lots of other reasons. If I get time today I'll repost to this thread...


TTFN,<br /> <br />-bd-<br /> <br /><a href="http://www.amazon.com/exec/obidos/ASIN/0471449156/qid=1064343733/sr=2-1/ref=sr_2_1/002-8375300-3666449" target="_blank" rel="nofollow">Jakarta Pitfalls</a> | <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0471146153/qid=1064343733/sr=1-2/ref=sr_1_2/002-8375300-3666449?v=glance&s=books" target="_blank" rel="nofollow">J2EE AntiPatterns</a> | <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0471462071/qid=1064343733/sr=1-3/ref=sr_1_3/002-8375300-3666449?v=glance&s=books" target="_blank" rel="nofollow">Mastering JavaServer Faces</a> | <a href="http://bill.dudney.net/roller/page/bill" target="_blank" rel="nofollow">Blog</a> | <a href="http://www.jroller.com/page/BillDudney" target="_blank" rel="nofollow">Eclipse Blog</a> | <a href="http://www.sourcebeat.com/TitleAction.do?id=2" target="_blank" rel="nofollow">Eclipse 3 Live</a>
 
jQuery in Action, 2nd edition
 
subject: JSF vs .HTML/JSP and Servlets