This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes When to use JSF or Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "When to use JSF or Struts" Watch "When to use JSF or Struts" New topic
Author

When to use JSF or Struts

Ajay Singh Rathore
Ranch Hand

Joined: Mar 27, 2008
Posts: 64
Hi All,
As there isnt anything interesting thread running currently. So i just wanted to start a new constructive thread.

What is the difference in Struts and JSF. As we all know that both are web frameworks, and are based on the Model 2 architecture. What we are bothered here is about the factors that affect the decision of using either of the two. Also when should we be using plain JSP/Servlet combination for the presentation layer. Specially i would like all those who have already cleared the exam to provide their thoughts on this based on the type of questions they faced on the actual exam.

Thanks
Ajay Singh Rathore

SCJP, SCDJWS
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
There is a major different between Struts and JSF that Struts is Action-based, but JSF is Component-based.

How to choose? For me, I'll choose a framework that team members familiar with.

It's just a taste.


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Hmmmmm.....

It is a SUN certification exam forum. And the question is, when would you suggest to use something SUN is behind, or something SUN is not behind?

If the exam was called the Struts Certified Enterprise Architect, I would use Struts. Seeing that this is a Sun exam, I'd probably suggest Sun backed frameworks, and stay away from things like Struts or .NET solutions.

Having said that, though, I do know of people who have passed the original SCEA exam while recommending to use Struts.

For the most part, both frameworks address many of the same problems, so at a high level, both are valid.

-Cameron McKenzie
[ September 10, 2008: Message edited by: Cameron Wallace McKenzie ]
Jeff Walker
Ranch Hand

Joined: Apr 25, 2004
Posts: 116
Originally posted by Cameron Wallace McKenzie:
Hmmmmm.....

It is a SUN certification exam forum. And the question is, when would you suggest to use something SUN is behind, or something SUN is not behind?

If the exam was called the Struts Certified Enterprise Architect, I would use Struts. Seeing that this is a Sun exam, I'd probably suggest Sun backed frameworks, and stay away from things like Struts or .NET solutions.

Having said that, though, I do know of people who have passed the original SCEA exam while recommending to use Struts.

For the most part, both frameworks address many of the same problems, so at a high level, both are valid.

-Cameron McKenzie


Oh boy, what a minefield!
As many of us suspect but never seem to state openly, Sun is more interested in promoting their own technologies than actually certifying people as true architects! Isn't an architect supposed to pick the best technology/platform available that satisfies the business requirements? If the above person can make a well-justified case as to why Struts is better or more suited to the problem at hand than JSF, isn't that acting like an architect?

Now, realistically, I'd choose JSF "to pass the exam", but a few weeks ago, a poster had the (forgiveable) audacity to ask if a Spring-based solution would be acceptable. He thought it a good idea to try. No doubt a viable Spring-based architecture could be made to work, but I remember a few of the experienced hands here trying to bend over backwards to politely point out to him that "Hey, um, it's a Sun exam, right? Maybe you should stick with JEE here".

Also, on a separate thread, a person asked if the SCEA5 ia worth doing, (that poster had already passed an earlier version of the SCEA).

Since passing this cert is obviously biased to Sun technologies, I am now wondering the value of such a cert myself ??

To be honest, I believe all certs from any company are a way to promote their own technologies, and very little else. Having said that, I will complete SCEA5 as part of completing my own set of personal goals I set myself two years ago. But I will do no more certs after this one.
-jeff
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
In regards to "certifications", these are good revenue generators for organizations...worthy of development of comprehensive marketing campaigns.
(See my
review of the new version of the SCEA exam posted last month for more insight).


The big benefit of using Struts for building the web component of an application is the extensible Controller that is provided. It really is stable and extensible enough to handle complex mediation between View and Model. That said, the Struts JSP tag libraries are good too. For more complex UI needs, Java Server Faces presents a more complex UI framework which separates data and HTML for view customization and reusability.

To compare the entire Struts framework and Java Server Faces is not appropriate, in my opinion. Java Server Faces compared to the Struts JSP tag libraries is a more reasonable comparison. You can certainly do a lot more with Java Server Faces than you can with the Struts JSP tag libraries, if you need to. You can certainly use Struts and Java Server Faces together, they are very compatible.

I doubt the instructional designers that work on creating exams can actually discern the details of each framework to determine any sound question regarding any comparison, especially if their knowledge base consists entirely of marketing websites and Google search results, in my opinion.
[ May 20, 2008: Message edited by: James Clark ]
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

The big benefit of using Struts for building the web component of an application is the extensible Controller


I'm guessing the extensible controller mentioned here is the ActionServlet? I'm not sure if the ActionServlet is any more extensible than the JSF FacesServlet.

A common misconception is that JSF is only about GUI. JSF provides the same front controller/command pattern provided by JSF, with built in validation and error handling. I'm not sure of anything major Struts does that JSF can't do. All the more reason why, when chosing between the two on the SCEA exam, I'd favour JSF.

-Cameron McKenzie
[ May 20, 2008: Message edited by: Cameron Wallace McKenzie ]
Sekhar Chand
Ranch Hand

Joined: Apr 05, 2006
Posts: 73
I think it will be better if we choose Struts 2.0 in which we plug in as many as third party tools.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

For Part I, you will get questions about JSF, but not Struts.

In Part II, you are asked to design an application.

I didn't use JSF at all. I had a front controller issuing command objects. Command objects called business delegates that wrapped the complexities of accessing middle tier components. The middle teir components invoked service objects, and the service objects interacted with DAOs. No mention of JSF whatsoever.

I did write "much of this could be achieved by using the JSF framework, as opposed to implementing it from scratch" but that was in the comments section.

So basically, you don't have to use JSF at all.

-Cameron McKenzie
Sekhar Chand
Ranch Hand

Joined: Apr 05, 2006
Posts: 73
Hi Cameron,
Is that type of framework works for every projects means if we have so many users online,
and submitting page same time.
Lets think about the soccer tickets online booking or India and pakisthan cricket online booking.
Can we use your framework for those types of projects.
I donot know my question is relevant to this thread or not.

thanks in advance
sekhar
Kamatchi sundaram Rajasekaran
Greenhorn

Joined: Jan 13, 2004
Posts: 2
I have real time experience to decide JSF or Sturts. We have application which is running in Oracle forms. Each screen contains around minimum of 30 fields. When we are migrating from forms to Web, we selected JSF instead of Struts, coz, JSF has rich set of components. More over we have extended our JSF component usage to Apache MyFaces, Apache Tobago, ICEFaces which has in-build support for Ajax implementaion for Components and other good UI components. For my case, we want to have good UI represention instead of Oracle forms. So we choose JSF
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: When to use JSF or Struts