wood burning stoves 2.0*
The moose likes JSP and the fly likes Questions about JavaServer Face Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Questions about JavaServer Face" Watch "Questions about JavaServer Face" New topic
Author

Questions about JavaServer Face

Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Hi all,
I am new to the world of JavaServer Face.
From SUN, I know:

JavaServer Faces is a server-side technology for developing web applications with rich user interfaces. It is a user interface framework for building web applications that run on the server side and render the user interface back to the client.

However, if in such case, what is the difference between JSF and Struts?
I feel both of them try to provide an ease-to-create and manage mechanism for handling Web layout.
Any ideas?
Thanks.
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)
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Nicholas Cheung:
However, if in such case, what is the difference between JSF and Struts?
I feel both of them try to provide an ease-to-create and manage mechanism for handling Web layout.

No Nick. JSF is purely intended for purely interface to the users, while Struts is some kind of framworks that a web app is built on... I heard that those who are fluent in SWING will find JSF to easy to adapt for them...
I used to develop SWING seriously in the past... I am willing to have a taste of JSF in the future as well... But I'm not that sure about JSF as well... Will it be able to replace HTML traditional interface?
What do u think, Nick?


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

I used to develop SWING seriously in the past... I am willing to have a taste of JSF in the future as well... But I'm not that sure about JSF as well... Will it be able to replace HTML traditional interface?

But if the server-side stuff, and thus, does this possible?
From your info, seems to me that JSF creates sth like Swing stuffs, and then send to the front end for displaying?
So interesting!
I think it is quite similar to what JSP does, the server side HTML generation, and then send the results to the front end. But Swing components can do the same?
Nick.
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
In addition, Struts and JSTL are doing the same thing, rite?
They tries to provide ease-to-create HTML or user interface in server side, like ActionForm, HTML custom Tag lib, so that a greater flexibility is supported.
Persoanlly, I think many technologies are doing the same thing, but just on different focus.
Nick.
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Nicholas Cheung:
In addition, Struts and JSTL are doing the same thing, rite?

Yeah, they are doing the same thing... I also hope that JSF is working the same like JSP, but JSF might be more things to do with interfaces from server side...

Persoanlly, I think many technologies are doing the same thing, but just on different focus.

Yeah, Nick, I hope so. The new things are developed based on the existing ones with a little changes... But I think JSF will have a big impact on the J2EE world...

I think it is quite similar to what JSP does, the server side HTML generation, and then send the results to the front end. But Swing components can do the same?

No, Nick, SWING is client side like applet... They are window-based components... But I heard that SWING's fade is going down and I do hope Sun to pay attention to the development of SWING as well...
Bill Dudney
Author
Ranch Hand

Joined: Sep 05, 2003
Posts: 234
Hi All,
The main difference between JSF and Struts is the idea of a component. While you could call Struts tag's components they are not true components.
JSF and Struts will compete for mind share. They do the same things. Allow you to specify an HTML user interface that is connected to server side 'stuff' that does all the real business processing.
The very early releases of JSF did not have a real navigation model and in that early stage JSF needed Struts or something like it, to be able to manage the navigation from page to page. With the EA4 release (the one just before the beta that is currently available) we got a full featured and robust navigation model. Now JSF can be seen and thought of as a full replacement for Struts.
However JSF is more than Struts. Since JSF is built on components you have a much richer server side programming model.
Hope this helps.


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>
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I heard that those who are fluent in SWING will find JSF to easy to adapt for them...
I don't find anything about JSF, from what I have seen so far, that is similar to Swing in terms of building a UI. The only thing they might have in common is the MVC pattern that both JSF and Swing rely on. Basically, Listeners and Actions.
I think a lot of people are making this comparison ignorantly. Either that or I have no idea what I am talking about. I guess you can take your pick.


GenRocket - Experts at Building Test Data
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Gregg Bolinger:
I think a lot of people are making this comparison ignorantly.

Yes, Gregg, I just heard like that... Actually I have never tried JSF at all... As you said, in the context of listeners and actions, they two are in common...
I am also wondering how JSF can generate Client side component to the user, who are using browsers to view the web pages... Or is it like applets? Is there any website using JSF to taste so that we can figure what actually it is...
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Ko Ko Naing:

Yes, Gregg, I just heard like that... Actually I have never tried JSF at all... As you said, in the context of listeners and actions, they two are in common...
I am also wondering how JSF can generate Client side component to the user, who are using browsers to view the web pages... Or is it like applets? Is there any website using JSF to taste so that we can figure what actually it is...

If you have used Struts, JSF will be very similar. It uses Custom Tags to generate the HTML for Web UI Components. Below is a sample of how to render an HTML input type="text" using JSF
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Hi Gregg,
The code provides seems also similar to JSTL, which tries to display HTML codes using standardize custom tag model.
I am still confuse about those JSTL, JSF and Struts.
In fact, does all those stuffs are supplementary to each other?
Nick.
 
 
subject: Questions about JavaServer Face