aspose file tools*
The moose likes JSF and the fly likes JSP vs JSF ?!! 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 » JSF
Bookmark "JSP vs JSF ?!!" Watch "JSP vs JSF ?!!" New topic
Author

JSP vs JSF ?!!

Sirisha Reddy
Ranch Hand

Joined: Jun 09, 2003
Posts: 75
What is the future of the web front end. As I see one of these two should go out as they both serve pretty much same thing.. with JSF offering more in my view.

Does it mean learning jsf is better than jsp in the long run?

Please post your insights.. specially those who used best of JSP and JSF.

Siri.


SCJP 1.4
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

You can't compare JSF and JSP like you are trying to do. JSF uses JSP. Now, if you mean JSF as a framework vs Servlet/JSP programming, then we can have a discussion. One of which that has been discussed many many times before.

Frameworks allow you to get your work done quicker. Frameworks take care of mundane details that you would have to create from scratch if using straight JSP/Servlets.

I doubt JSP/Servlet development will ever disappear. I feel that in order to use any J2EE based framework, you need to know how the underlying system is working. You need to know how JSP's and Servlets work without the framework.


GenRocket - Experts at Building Test Data
Jack Wiesenthaler
Ranch Hand

Joined: Jul 26, 2001
Posts: 75
I have not messed around with JSF yet, but from what I've read so far JSF and Struts are pretty much the same idea... a MVC (Model 2) architecture. Now, JSF is supposed to provide a "rich component set". What does that mean? How do these components work within the browser, do they run in an applet container?
Thomas Waltair
Greenhorn

Joined: Jun 14, 2005
Posts: 1
JSF because it adds many benefits of a front controller, but at the same time gives you the flexibility of the Page Controller. JSF can have several event handlers on a page while Struts is geared to one event per request. In addition, with Struts, your ActionForms have to extend Struts classes, creating another layer of tedious coding or bad design by forcing your model to be ActionForms. JSF, on the other hand, gives developers the ability to hook into the model without breaking layering

Navigation is a key feature of both Struts and JSF. Both frameworks have a declarative navigation model and define navigation rules inside their XML configuration file. There are 2 types of navigation: static navigation - when one page flows directly to the next; and dynamic navigation - when some action or logic determines which page to go to.

JSF Static Navigation

JSF supports navigation by defining navigation rules in the faces configuration file. The example below shows a navigation rule defining how one page goes to the next.



<navigation-rule>
<from-view-id>/FromPage.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/ToPage.jsp</to-view-id>
</navigation-case>
</navigation-rule>

JSF Dynamic Navigation
JSF also supports dynamic navigation by allowing components go to an action handler.

JSF was built with a component model in mind to allow tool developers to support RAD development.
Anselm Paulinus
Ranch Hand

Joined: Sep 05, 2003
Posts: 389
Originally posted by Kevin Arouza:
I have not messed around with JSF yet, but from what I've read so far JSF and Struts are pretty much the same idea... a MVC (Model 2) architecture. Now, JSF is supposed to provide a "rich component set". What does that mean? How do these components work within the browser, do they run in an applet container?


Struts can not be placed on the same pedestrial as JSF. JSF is a componenet based framework which is built on top of the raw Http protocol, just like Tapestry. Though, still at its infancy, if comparisons of frameworks are to be made then JSF should be compared to frameworks such as Tapestry. On the other hand I do not see JSP going away, as a good grasp of Servlet/JSP would be necessary for effective use of these java based web frameworks.
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
The good thing about JSF is that the UI
is object-oriented. ( while STRUTS uses just plain HTML )
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP vs JSF ?!!