Apache Struts 1: Difference between revisions

Content deleted Content added
m Reverted edits by 125.19.34.86 (talk) to last revision by Rrburke (HG)
Anhtrobote (talk | contribs)
m Design goals and overview: Clarification of a sentence
Line 26:
The goal of Struts is to separate the ''model'' (application logic that interacts with a database) from the ''view'' (HTML pages presented to the client) and the ''controller'' (instance that passes information between view and model). Struts provides the controller (a servlet known as <code>ActionServlet</code>) and facilitates the writing of templates for the view or presentation layer (typically in JSP, but [[XML]]/[[Extensible Stylesheet Language Transformations|XSLT]] and [[Jakarta Velocity|Velocity]] are also supported). The web application programmer is responsible for writing the model code, and for creating a central configuration file <code>struts-config.xml</code> that binds together model, view, and controller.
 
Requests from the client are sent to the controller in the form of "Actions" defined in the configuration file; if the controller receives such a request it calls the corresponding Action class that interacts with the application-specific model code. The model code returns an "ActionForward", a string telling the controller what output page to send to the client. Information is passed between model and view in the form of special [[JavaBeans]]. A powerful custom tag library allows it from the presentation layer to read and write the content of these beans from the presentation layer without the need for any embedded Java code.
 
Struts is categorized as a [[Model 2]] request-based web application framework.<ref>{{cite web|first = Tony|last = Shan|year = 2006|accessdate = 2010-10-10|url = http://portal.acm.org/citation.cfm?id=1190953|title = Taxonomy of Java Web Application Frameworks|publisher = Proceedings of 2006 IEEE International Conference on e-Business Engineering (ICEBE 2006)}}</ref>