File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes JSF and MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "JSF and MVC" Watch "JSF and MVC" New topic


guru prasanth
Ranch Hand

Joined: Aug 20, 2009
Posts: 102
Iam doing assignment for part2.I can use JSF or i can use normal MVC (With serverlet as controller and jsp as model)
Iam very much familiar with Servlet/jsp combination i can design it pretty easy.I have read JSF but never really worked on it.I don't see a great advantage of using JSF although i appreciate what they have done.Infact my concern is that application performance can be slow becuase it's not a very tried and tested technology.Also there is a technolgical risk that there may not be many good devlopers of JSF.Moreover JSF is only specification and not implementation.So the performance of the application would depend on
implementation.Whereas Servlet/JSP is a tried and tested technology.Are the above statement justify my use of MVC using Servlets/JSP OVER JSF.Or just to be on a safer side shoiuld i use JSF.Also iam not sure how exactly to handle autherization/authentication using JSF.I can use filters but it's outside the life cycle of JSF.
Rajan Choudhary
Ranch Hand

Joined: Mar 17, 2011
Posts: 196
Here is what I learned from part3 exam today. You can suggest the solution you want but be prepared to answer, why that particular approach over others? I tried my best to convince the examiner why did I use JSF.

BTW, you can JSF phase listeners to use them as interception filters.
guru prasanth
Ranch Hand

Joined: Aug 20, 2009
Posts: 102
Thanks rajan for your reply.But my question is slightly different.When will someone choose JSF over JSP/Servlets.
This is my thoughts.I want people to debate this point so that i can be sure about my decision.

1) If the application designed is going to be an ajax.Then we can use the partial submit use of ajax.
To decide if the application needs ajax or not the application needs have a dynamic UI where in one
page you can show mutiple things or mutiple edits in same page.

2) If the UI has too many reusable component then we can go for composite components.

3) Better separation of work between UI and java developers

These are the two things i can think of.I have just studied JSF and do not realtime expereince in JSF.So I want to know if there are more
advantage of using JSF than just this.

In MVC using Servlets/JSP these are the advantage

1) It's a tried and tested technology.There are more developers who have worked on this.

2) And lots of appserver implementing Servlets and jsp have improved their implementation over years.In case of JSF it's
an emerging technology and it depends on the implemetation like facelets and icefaces.Iam not sure if their implementation
is very stable.

3) Performance wise it wouild be good becuase there is not a overhead of any framework.Most of the framework like struts and Springs MVC is built of top of this framework.

Disadvantage of JSF.

1) No sure how efficiently the session handling coiuld be handled in JSF.

2) Lots of Javascripts are generated by JSF implemetations for field validation etc.Not sure how well these javascript will work across browsers.Also not sure how efficient will
these javascript be for complex validation.Again a lot would depend on the implementation

Disadvantage in Sevlets/jsp

1) The separation of work separation of work between UI and java developers

2) Code has to be exclusively be written for validaions(both business and UI validations conversions.It could add more to developemnt and testing efforts.

3) A lot would depend on the way it's implemented.Say a client side validation would be efficient with a good clientside java script code.But just choosing this Servlet/JSP does't
guarantee performance.

A better way i think couild be to use either a Struts or a Spring MVC.But can i do it for the assignent and give then the reason behind it.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33111

I'm sure session handling is fine in JSF. Note that Sun/Oracle doesn't consider JSF an emerging technology anymore. (I don't either for that matter. There are many things I don't like about jSF, but it's been around long enough to be stable.)

I think your notes about components and AJAX are right on.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Senthil Kumar
Ranch Hand

Joined: Mar 13, 2006
Posts: 264
Go for JSF when the SuD requires rich UI which cannot be given in Struts/SP. There are numerous components available already and you can write your own component as well. besides these componets can be reused. Peformance wise i havent heard anything negative about JSF. Another thing to be noted here is every componet is going to be stored an server side object in memory. Plus clear separtion of concerns. And finally your view code doesnt have to be coded in JSP. We can have customer renderers.

when you really want something, all the universe always conspires in your favour.<br /> <br />SCJP1.5-77%<br />SCWCD-89%
I agree. Here's the link:
subject: JSF and MVC
It's not a secret anymore!