Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

How useful is Struts?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've only browsed Struts, so I really can't say that I have any real experience or friends who know what they are talking about. From what I see from Struts is that it is a lot of work and a lot of overhead that can be accomplished with other methodologies.
What benefits are there to gain from using Struts?
I know there's the separation of concerns, like HTML developers don't have to know what scriptlets are doing, but come on, if a Web Developer doesn't know (or hasn't learned) Java, is it really going to be any easier for them to learn Struts? You have to learn a whole new tag set because it seems that Struts decided normal HTML wasn't clear enough, they had to rewrite darn near the entire HTML library.
Is this really easier for someone who isn't a programmer to learn than the simplest of logic (which should be all that you'd find in a scriptlet)?
I'm just looking for someone to explain the bloat. What's the tradeoff?
{PA}
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An excellent set of questions. My experience with J2EE has solely been based upon lone JSPs and the odd servlet here and there... naturally I've heard of Struts, but a lot of the "press" on it nowadays seems to be negative. What does Struts offer to the developer? Why use it over other frameworks such as Webwork / JSF?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would say the selling point for Struts is the built-in facilities for common functionality (form handling, validation, layout with Tiles, etc.) -- not the ability to separate the "HTML coder" from the "Java coder".
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't even have to use JSP, so a lot of your concerns are inadvertently misplaced. Struts is a framework. You either have a framework or you need one. So, Struts is not extra overhead. If you want to use taglibs, they are separate. You have stressed the incidental. What is important is the framework within which the web-oriented MVC pattern is implemented. Struts does this well and simply with actions, forms, messages, controller, forwards, errors, exceptions, resources, etc. I cannot think of much wasted effort, actually.

Originally posted by D. Paul Allen:
I've only browsed Struts, so I really can't say that I have any real experience or friends who know what they are talking about. From what I see from Struts is that it is a lot of work and a lot of overhead that can be accomplished with other methodologies.
What benefits are there to gain from using Struts?
I know there's the separation of concerns, like HTML developers don't have to know what scriptlets are doing, but come on, if a Web Developer doesn't know (or hasn't learned) Java, is it really going to be any easier for them to learn Struts? You have to learn a whole new tag set because it seems that Struts decided normal HTML wasn't clear enough, they had to rewrite darn near the entire HTML library.
Is this really easier for someone who isn't a programmer to learn than the simplest of logic (which should be all that you'd find in a scriptlet)?
I'm just looking for someone to explain the bloat. What's the tradeoff?
{PA}

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with the previous post. The object-oriented nature of the Struts framework significantly eases maintenance of web applications, and optimized reuse of its different components. Previous to Struts, we were using lone JSPs to do a lot of the processing that should not have been done by a JSP. Performance was lagging, reuse was non-existant (copy-paste previous solutions), and maintenance became a nightmare once more people were brought on a particular project. Struts has also helped in design estimates, as each set of components lends itself very well to formulas (with some form of qualifier for more complex Actions, for example). There are potentially many solutions out there, but none seemed to help us more than Struts.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The previous two posts are accurate IMHO.
In response to your question:

"if a Web Developer doesn't know (or hasn't learned) Java, is it really going to be any easier for them to learn Struts?"


Struts requires the ability to code Java. If someone has done only HTML, JavaScript, ASP, PHP, etc. the transisition to developing Java web apps will be easier using the Struts framework (because of the reasons above) than if you don't use it, but Java will still require a significant learning curve.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
To me, there are three benefits to using struts.
1. The struts-config.xml file provides an easy place for anyone familiar with struts to sit down and start learning how an application works.
2. The large collection of helpful classes to deal with common html problems (ie error validation, logging, internationalization)
3. The MVC and taglibs encourage you to keep scriptlets out of jsps.
I remember when I first learned struts I was continually bewildered by the variables and conventions that appeared (to me) to be coming from out of nowhere. But I find that struts is very well documented and a google search for almost any problem will get you most of the way to a solution.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm used to think that today, in a modern J2EE web application, if you choose to not use a framework like Struts you will finish to write a similar one for you own with about the same functionalities. I did the same error and it was a waste of time and money.
Struts gives you (for free and with a short learning curve) a lot of pre built "core" pieces of software and a good implementation of well-known web application patterns. Front controller, form validation, flow control, dispatching... and so on.
Of course, these considerations matters only if you're not developing a flat, unmaintainable, unscalable JSP-based application like many PHP or ASP programmers very often do.
 
Ben Poole
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apologies for the delay in coming back to this thread: thanks for these summaries, they're really useful. )
 
Ranch Hand
Posts: 1327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have used and wrote a lot of web applications using Intershop Marked Up Language(ISML) I heard its a high quality version of Struts (like mercedes benz in cars) but I have never used Struts, anyway I have to learn and use struts for the next projects
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fabrizio, I feel you are so right!!! So if you are just planning to write a simple web application, don't try Struts otherwise get involved.
Pep
Computer engineer, SCD, SCWCD
 
reply
    Bookmark Topic Watch Topic
  • New Topic