aspose file tools*
The moose likes Struts and the fly likes Struts or JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts or JSF" Watch "Struts or JSF" New topic
Author

Struts or JSF

bob connolly
Ranch Hand

Joined: Mar 10, 2004
Posts: 204
Hello!

I bought a book on STRUTS but i'm hearing the Java Server Faces may be the best way to go!?

Can anyone tell me which methodology will probably be the best approach going forward?

Thanks very much!
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

I'm moving this to the Web Application Framework forum -- this kind of question is perfect for that forum.

So please post your replies there, thanks!
Marco Tulio Borges
Ranch Hand

Joined: Sep 14, 2004
Posts: 45
Well, I'm just starting to use JSF now and I have used Struts last year. Word around the campfire is Struts is going to die and JSF will arise... I heard it from a guy in a conference. He said that the Struts project will not move on (or will slow down a lot) and JSF will be the next force in the Frameworks world. That makes sense, because Craig McClanahan, Struts creator, is now working as one of the Specification Leaders of JSF.

I think that JSF is just great, it's a great idea, a beautiful framework and it's not that hard to use. But, if you are about to start an Application now, consider this: there are more people using Struts than JSF today, so, if you have a problem, if you get stuck somewhere in your development process (and you probably will), it will be easier to get help with Struts (at least it is today).

Maybe you should take a look at Craig McClanahan's explanation about Struts, JavaServer Faces and Java Studio Creator.
[ January 06, 2005: Message edited by: MTulio Borges ]

.: SCJP 1.4 (95%) / SCWCD 1.4 (91%) / SCBCD (77%) :.
"Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us." - Calvin
bob connolly
Ranch Hand

Joined: Mar 10, 2004
Posts: 204
Thanks MTulio!

I think i will finish reading the STRUTS book and then start taking a look at JSF!

MTulio! I really appreciate your very thoughtful reply!

bc
Dave Wood
bronco
Ranch Hand

Joined: Aug 02, 2004
Posts: 161
Bob,

I very recently went through a similar process. I did some prototyping with both Struts and JSF and ending up deciding to go with JSF. It's a new project, and I just felt like going with the technology that seems to be gaining momentum (i.e. bring added to J2EE) vs. one that's losing momentum (first JSTL, now JSF...) was the way to go. I'm sure there may be a few more bumps in the road on this path, and part of me fears that they may make significant changes to JSF at some point in the future that will bite me, but I still feel good about the decision.

Aside from the momentum issue, I found that I really like the JSF model better...it just "feels right" to me.

I've been away from actual implementation for a few weeks now (working on requirements), so I can't relay any detailed experiences yet...but soon!


Co-Author of <a href="http://www.oreilly.com/catalog/jswing2" target="_blank" rel="nofollow">Java Swing</a><br />Co-Creator of <a href="http://www.sun.com/training/catalog/courses/CX-310-055.xml" target="_blank" rel="nofollow">SCJP 5.0</a> and <a href="http://www.sun.com/training/certification/java/associate_beta.xml" target="_blank" rel="nofollow">SCJA</a> exams
Dave Wood
bronco
Ranch Hand

Joined: Aug 02, 2004
Posts: 161
BTW, be sure to check out this thread if you think there's a good chance you'll end up choosing JSF and you want to be able to find JSF answers more easily.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I think MTulio Borges's response about Struts not moving on is a bit hasty. The Struts team is currently working on Struts 2.0, aka Shale. There is a plan to move from the Struts html taglib to JSF for the view. So I don't see Struts dying anytime soon. Just evolving.

With that being said...

There are a ton of Struts vs JSF threads not only in this very forum that you can search for but also on Google. Searching for these threads and links may give you some quicker satisfaction than waiting for people to reply here. As a kick start here is a thread in which I linked to about 4 JSF vs Struts threads. There are many many more. Searching for "Struts JSF" in this forum turns up 107 results. But that should get you going.


GenRocket - Experts at Building Test Data
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

The strength of Struts is where there's a fair amount of logic - putting logic into "JavaBeans" a la JSF makes me uneasy. Conversely, JSF is very strong in presentation and editing. Although Struts never evolved a really good workflow. JSF does somewhat better there.

And, of course, JSF is supposed to lead us to the Silver Bullet of webapp design - drag-and-drop design a la Visual Basic. Now if only someone would do a good open-source DND JSF designer. At the moment the only freebie JSF aids I know of are for the config files.

Just to make life more interesting, there's Tiles, which was an add-on for Struts 1.0, an integral part of Struts 1.1 and may become completely independent of Struts in the near future (or so David Geary hopes).


Customer surveys are for companies who didn't pay proper attention to begin with.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

The strength of Struts is where there's a fair amount of logic - putting logic into "JavaBeans" a la JSF makes me uneasy.

What about ActionForms? Aren't they just JavaBeans with some logic?

Now if only someone would do a good open-source DND JSF designer Well, that would be nice. However, I still wouldn't use it. Just like I don't use Swing GUI builders. Inevitably you just end up with unmmaintanable generated code. Also note that JSF isn't just something to make web app development easier, although that was a high priority. Sun needed something to market. JSF Tools are a gold mine waiting to happen if JSF takes off like Sun hopes. Think Sun Studio Creator.

Personally, I find Tiles more cluttering than helping. I don't see what the big deal is about a couple of includes on each page. All tiles does for me is give me 1 more XML file to take care of.
[ January 06, 2005: Message edited by: Gregg Bolinger ]
Dave Wood
bronco
Ranch Hand

Joined: Aug 02, 2004
Posts: 161
Personally, I find Tiles more cluttering than helping. I don't see what the big deal is about a couple of includes on each page. All tiles does for me is give me 1 more XML file to take care of.

I'm really glad to hear someone else say this. I hand't used tiles until recently and found myself wondering what the big deal was once I did try using them. Then I tried using tiles with JSF...not pretty!

It seems to me that something like this works just fine in most cases...

...and then in header.jspf...

[ January 06, 2005: Message edited by: Dave Wood ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Oddly enough I am almost done with a medium sized webapp and I didn't have to touch anything outside of what JSF provides, using MyFaces of course. No tiles, no JSTL, no scriplets. I'm pretty proud of myself.
Marco Tulio Borges
Ranch Hand

Joined: Sep 14, 2004
Posts: 45
Originally posted by Gregg Bolinger:
I think MTulio Borges's response about Struts not moving on is a bit hasty. The Struts team is currently working on Struts 2.0, aka Shale.


I don't know... I really think that Struts will move slowly after JSF.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

Originally posted by Gregg Bolinger:
The strength of Struts is where there's a fair amount of logic - putting logic into "JavaBeans" a la JSF makes me uneasy.

What about ActionForms? Aren't they just JavaBeans with some logic?

Well, I didn't exactly impress the authors of Struts when I put the persistency mechanism in my FormBeans (anticipating EJB usage), but I'll forgive initiators and validators. I've seen raw business logic done in FormBeans, and that's not forgivable. Especially the one that kept a JDBC Connection as a Form Bean instance variable (SHRIEK!).

Now if only someone would do a good open-source DND JSF designer Well, that would be nice. However, I still wouldn't use it. Just like I don't use Swing GUI builders. Inevitably you just end up with unmmaintanable generated code. Also note that JSF isn't just something to make web app development easier, although that was a high priority. Sun needed something to market. JSF Tools are a gold mine waiting to happen if JSF takes off like Sun hopes. Think Sun Studio Creator.


Well, if a JSF page designer worked like a VB form, it would work - after all, VB forms work. I'm not asking it to write the backing JavaBean, just allow me to do WYSIWYG page layout so I don't have to spend all my time pairing up raw XML tags.


Personally, I find Tiles more cluttering than helping. I don't see what the big deal is about a couple of includes on each page. All tiles does for me is give me 1 more XML file to take care of.

[ January 06, 2005: Message edited by: Gregg Bolinger ]


The tiles docs were so confusing that only recently have I felt like I could make sense of them. And that's a pretty sad statement considering that it's not exactly rocket science. Of course, so were the Struts docs, which is why I wrote that JavaPro article back in 2K1.

The benefit to tiles is in not having to go back in and modify each and every bloody stupid page in the event that the original includes didn't fit in right. But I agree. I don't like keeping two sets of descriptive info and hoping they'll stay in sync. I've got a Tiles project in the works and I'll either find some way to put that stuff in the metadata the same way I do using XDoclet for the Struts actions or, failing that, go back to includes.
John Applebey
Greenhorn

Joined: Oct 02, 2003
Posts: 4
I agree that JSF, from Sun, will replace Struts.


John Applebey<br />847-438-6372
Daniel Massie
Greenhorn

Joined: Jan 08, 2005
Posts: 28
Apparantly Tiles are getting removed from struts and promoted to their own project within apache.

I'm not a fan of them either, I've recently taken a liking to SiteMesh for my templating needs
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Struts or JSF