java 1 Answer(s) 6 years and 10 months ago
Posted in : Struts
What is Java as a programming language? and why should i learn java over any other oop's?
March 1, 2008 at 6:30 PM
ActionServlet provides the "controller" in the Model-View-Controller (MVC) design pattern for web applications that is commonly known as "Model 2". This nomenclature originated with a description in the JavaServerPages Specification, version 0.92, and has persisted ever since (in the absence of a better name).
Generally, a "Model 2" application is architected as follows:
* The user interface will generally be created with server pages, which will not themselves contain any business logic. These pages represent the "view" component of an MVC architecture. * Forms and hyperlinks in the user interface that require business logic to be executed will be submitted to a request URI that is mapped to this servlet. * There can be one instance of this servlet class, which receives and processes all requests that change the state of a user's interaction with the application. The servlet delegates the handling of a request to a RequestProcessor object. This component represents the "controller" component of an MVC architecture. * The RequestProcessor selects and invokes an Action class to perform the requested business logic, or delegates the response to another resource. * The Action classes can manipulate the state of the application's interaction with the user, typically by creating or modifying JavaBeans that are stored as request or session attributes (depending on how long they need to be available). Such JavaBeans represent the "model" component of an MVC architecture. * Instead of producing the next page of the user interface directly, Action classes generally return an ActionForward to indicate which resource should handle the response. If the Action does not return null, the RequestProcessor forwards or redirects to the specified resource (by utilizing RequestDispatcher.forward or Response.sendRedirect) so as to produce the next page of the user interface.