Struts 1 The beginning of Struts

Huy Châu - August 16, 2010 - Struts



By using struts, you can create a nice separation between the code that presents the data (Java) and the code that presents the data (HTML/Jsp).


Tons of java code in JSP is bad, and Struts is huge improvement .


Advantages :
  1. Centralized file-based configuration : 
    1. not hard-coding in Java programs
    2. Struts values represented in XML or property file.
  2. Form beans :
    1. populating a bean based on request parameters, and accessing that bean from Java code
  3. Bean tags :
  4. HTML tags :
    1. set of custom Jsp tags to create HTML form
  5. Form field validation :
    1. check form values in required format
    2. (if values is missing or improper format)
    3. perform on both client and server
  6. Consistent approach :
    1. MVC (that's all) 
So, that's it . Look how great Struts is compared to 10 million lines of Java code in  Jsp pages. 


STRUTS is an EXTREMELY USEFUL WEAPON IN YOUR DEVELOPMENT ARSENAL. 


Disadvantages :
  1. Bigger learning curve 
    1. Complicated, long time to learn 
    2. hard for new developer
    3. Before committing to Struts, count the cost (for projects)
  2. Worse Documentation 
    1. [Full paragraph] 
      1. Guess who pays the Struts developer to work on Struts ? NOBODY ! . So guess what parts of the system they spend the most time working on ? Raise your hand if your favorite task is writing documentation. See my point. Compared to the standard servlet and JSP APIs, Struts has fewer online resources, and many users find the online Apache documentation confusing and poorly organized. 
  3. Less transparent
    1. Struts do all for you. but  there are  many of tasks you normally would have to do it yourself. => that's bad. 
  4. Rigid approach
    1. if you use Struts, you need to do things the Struts way.
  5. Community fragmentation