• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Struts vs Struts2

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been working in java web development for 8-9 months. I think it's time to begin to use a framework and i would like Struts.

I consider which one is better to begin with. Struts 1 seems to be easier, but it gets older through time. How do you think? Which one is better for begining?
Which literature is better for that reason? I've started a few time ago to read some books on Struts2, but i don't like their style. It's given an exempla of struts.xml and they
say to write such and such content. But, they do not explain why do i have to write exactly this and not anything else.....
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, Struts 2 is not responsible for the books that get written about it :-)

While Struts 1 is still used widely in existing projects, it's no longer being developed, so unless you have a need to know it (if maybe your company uses it) I wouldn't spend much effort learning it.

But Struts 2 isn't compatible to Struts 1, so for many people it's not the automatic framework of choice to upgrade to (and it's market share is much smaller than that of Struts 1).

So before deciding which one to learn in depth you might want to check out some other frameworks (like JSF, Wicket, Stripes, ...) so you know what frameworks can do for a web app in general.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Ulf (except that Struts 1 is still under active development, though few new features are likely to be introduced)--it's worth exploring various frameworks to see which ones work for you.

There is still a surprising amount of new development using Struts 1, although I don't really understand why--even the latest versions would be considered "behind the times" in terms of flexibility, testability, and so on. Unless you have a compelling business reason to learn it (your company uses it, you *want* to work with it, etc.) I'd focus on Struts 2.

Personally I'm still not a huge fan of JSF, although some of the surrounding technology makes it pretty attractive (Seam, for example). I also think JSF and its associated technologies are more complex than things like S2, Wicket, Stripes, Tapestry, and so on, but that's likely to be because of my particular background.

I haven't had the same experience with the S2 books--most of them *do* explain why to write what's being written, provide alternatives, and so on. A book about a specific technology should never be considered a standalone resource--it should be read alongside the official framework documentation. S2, for example, has a reasonably extensive (although somewhat disorganized at times) documentation wiki.

Any book, besides its own information, should be considered a "window" into the API and other documentation. It's almost always up to the reader to explore topics that aren't covered in the book--and the reader will come out a stronger developer in many regards as a result.

Most framework-oriented books also assume a fairly high comfort level with Java and Java web app development in general: most frameworks rely heavily on other libraries and/or frameworks to accomplish what they do. It's usually assumed that book readers have the initiative to go beyond what's written in the book: there's simply no replacement for experimentation and experience.
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,


I am totally agree with David. If you want to learn some framework then why you think about older version.

That is but obvious that new version get and add new functionality which is not added at version 1.3.

And struts 2 is so advance than 1.3 .It adds so many new features, plug in., It gives rapid development also.

So better to understand concept of struts 1.3 and move to new version.


 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Struts 1.3 is a solid API and very easy to learn. I suggest learning how to use and extend the framework. Don't pay attention to the age of the API and the fact that there is another version. Many new projects are still using Struts 1.3 and the reason why is that it is still stronger and easier to learn and develop with.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On that we'll have to agree to disagree; I don't find S1 easier to learn (or teach), and I find it noticeably less easy to develop for. YMMV.
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently learning S2 and doing a project for S2 as Mr. Newton probabily knows that I have posted several questions about S2 (Thanks for all your input) Based from the earlier post of this thread, S2 is still not widely used but that's not my concern. I would like to know from your opinion, do you think S2 would gain market share in the next 5 to 10 years? What I am asking is do you believe S2 will have potential growth giving all these nice features that I have yet to learn.

Thanks for your thoughts
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
10 years? I suspect that's looking quite a bit too far ahead in the web application space.

Struts 1 achieved its longevity due to its "perfect storm" timing and functionality. The web app framework space is saturated now, unlike then--IMO it's unlikely there will be another Java web app framework as ubiquitous as S1.

S2 *is* gaining traction, but it's a little late to the game--there are several other attractive alternatives. For me S2 happens to work well with my brain, others might prefer Spring MVC or Stripes, or a more component-oriented framework like Tapestry, Wicket, or JSF.

I'm sure S2 will gain market share, but I wouldn't want to make any predictions regarding how much or for how long--things move pretty quickly these days, and with so many other good alternatives, and the big uptick in other JVM languages and frameworks, nothing will match S1's adoption rates.

(I could, of course, be completely wrong.)
 
Ranch Hand
Posts: 128
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is an excellent debate!!!

Until now, I would have tended to agree with James Clark ... Struts 1 is solid, proven and reliable ... there are good books and tutorials ad nauseum ...

When I finally took a look at Struts2 (aka WebWork) a few months ago ... I thought the structure a little strange and just blew it off ...

But David Newton's comments are interesting!!! and I think I need to give Struts2 a more careful second look.

Lastly ... why call it Struts2 ??? The frameworks (Struts2 Webwork vs. Struts1.x) aren't similar at all IMHO.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a very simple reason why Struts1 is still used: many people knows how to use it, so it doesn't require much trainning, and all design issues are already well known.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Vitor: When so many other, better alternatives are available, any of which provide a superior development experience, sticking to the past doesn't make technical or business sense to me. Inertia may well be a reason, but that doesn't make it a *good* one. Better to train people for a month and reap the benefits long-term, it'd pay for itself easily and quickly.
 
Nishan Patel
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


HI,


There is a very simple reason why Struts1 is still used: many people knows how to use it, so it doesn't require much trainning, and all design issues are already well known.




Right. But once if for beginner if starts to learn Struts 1.3 and Struts 2.0 and compare which one easy to learn.

Struts 2 is too easy to learn and it provide so advance functionality than 1.3 so code required to develop some thing is too reduce using 2.0.


The development with Struts 2is so fast. And it provide advanced plug-in to integrate it.

 
Vitor Santos
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


@Vitor: When so many other, better alternatives are available, any of which provide a superior development experience, sticking to the past doesn't make technical or business sense to me. Inertia may well be a reason, but that doesn't make it a *good* one. Better to train people for a month and reap the benefits long-term, it'd pay for itself easily and quickly



I agree with you (I am learning Struts 2 and I plan to study other View frameworks as well (Tapestry 5, Shale, Mentawai...)), I just pointed why struts 1 is still a popular choice.

Many times managers and executives really don't care about those things, and it's funny that they make such decisions sometimes (even when they know nothing about Java or web development), so they usually stick to something that's "foolproof". That's why COBOL still has such a large codebase... sometimes the manager/executive sees no value in training if something already has a "good' solution. Sad but true....
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nishan Patel wrote:

HI,


There is a very simple reason why Struts1 is still used: many people knows how to use it, so it doesn't require much trainning, and all design issues are already well known.




Right. But once if for beginner if starts to learn Struts 1.3 and Struts 2.0 and compare which one easy to learn.

Struts 2 is too easy to learn and it provide so advance functionality than 1.3 so code required to develop some thing is too reduce using 2.0.


The development with Struts 2is so fast. And it provide advanced plug-in to integrate it.


Ok that's something positive for me, I know only Struts 1.x, no knowledge of S2, except the struts-config.xml is changed to struts.xml, with slight change in "How action mapped ?"
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's more than a "slight change", it's completely different.
 
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic