Loading
Struts Page LifeCycle

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  Struts Page LifeCycle


  • Struts Page LifeCycle
    Sample Img 12

Ans)

Apache Struts is an open-source framework for developing Java EE web applications.
It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller
(MVC) architecture.

Divides the overall functionality of an application into three layers:

Model Layer – Contains the functional business logic of the application, as well as a representation
of the persistently stored data backing the application

View Layer – Contains the user interface, including mechanisms to accept user input and render results

Controller Layer – Contains the logic that manages the flow of individual requests, dispatching to the
appropriate business logic component

ActionServlet provides the "controller" in the Model-View-Controller (MVC) design pattern for web
applications that is commonly known as "Model 2"

The RequestProcessor selects and invokes an Action class to perform the requested business
logic, or delegates the response to another resource.

Standard Request Processing Lifecycle 1:
processLocale() -- Record user's locale preference (if not already present)
processPreprocess() -- general purpose pre-processing hook
processMapping() -- select Action to be utilized
processRoles() -- perform security role-based restrictions on action execution
processActionForm() -- Create or acquire an appropriate ActionForm instance

Sample Action Class :

public class UserAction extends DispatchAction  {
        public ActionForward add(ActionMapping mapping, ActionForm form,
         HttpServletRequest request, HttpServletResponse response) {
    }
        public ActionForward update(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {
        UserForm userForm = (UserForm) form;
        userForm.setMessage("Inside update user method.");
        return mapping.findForward(SUCCESS);
  }



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Struts Page LifeCycle


Struts Page LifeCycle

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free