Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF vs .HTML/JSP and Servlets

 
mike nelson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
Bill Dudney
Author
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic