• Action,  Controler,  Interview Questions,  Learn Struts

    What are different types of Actions we have in Struts?

    There are seven type of Action in struts and each have their own relevance and importance, Here we will discuss each and everyone, Please find below all of them: Action Include Forward Switch Dispatch LookupDispatch MappingDispatch Action Class:Action is a simple action which extend Action Class and overri3de an execute method which is called by default when request calls the specific action. Below is the Code to create a class with xml(struts-config.xml) entery: public final class SimpleActionExample extends Action { public ActionForward execute(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws Exception {return dispatcher.execute(mapping form request response);} DispatchAction: DispatchAction is a action class, which extent the DispatchAction Class as stated below: public…

    Comments Off on What are different types of Actions we have in Struts?
  • Action,  Controler,  Interview Questions,  Learn Struts

    What are different types of Actions we have in Struts?

    There are seven type of Action in struts and each have their own relevance and importance, Here we will discuss each and everyone, Please find below all of them: Action Include Forward Switch Dispatch LookupDispatch MappingDispatch Action Class:Action is a simple action which extend Action Class and overri3de an execute method which is called by default when request calls the specific action. Below is the Code to create a class with xml(struts-config.xml) entery: public final class SimpleActionExample extends Action { public ActionForward execute(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws Exception {return dispatcher.execute(mapping form request response);} DispatchAction: DispatchAction is a action class, which extent the DispatchAction Class as stated below: public…

    Comments Off on What are different types of Actions we have in Struts?
  • Action,  ActionForm,  Controler,  Learn Struts,  Model,  Struts 1.x,  Struts 2,  Struts Components,  Tiles Plug-in,  Validator Plug-in,  View

    What are the different components for struts application?

    Struts 1.x Framework have following components in its application: struts-config.xml ActionForm Bean View(JSP or ftl) Action Class Model (DAO,DTO classes) And may have following extensible component for Application: Validator.xml Validator class tiles-defs.xml Your comments give us opportunity to improve my blogs, so please comment.

    Comments Off on What are the different components for struts application?
  • Controler,  Learn Struts,  RequestProcessor,  Struts Components

    What is RequestProcessor, how to extend it?

    RequestProcessor is a class which is used by ActionServlet to maintain the state and process the activities in different level of request lifecycle. RequestProcessor have following method into it:1.) processPreprocess – Used to execute line of code before the action servlet start working on any request.2.) processPostprocess – Used to run snippet after the process method finish its work. Below is the flow of work for struts with requestprocessor: Can we create our own RequestProcessor?Yes, We can create your own RequestProcessor class and can override any of above methods to fulfill the Business requirement. Add below snippet into Struts-Config.xml <controllercontentType=”text/html;charset=UTF-8″debug=”0″nocache=”true”processorClass=”com.testComp.MyOwnRequestProcess”/> Create a class with below declaration: public class MyOwnRequestProcess extends RequestProcessor…

    Comments Off on What is RequestProcessor, how to extend it?
  • Controler,  Learn Struts,  RequestProcessor,  Struts Components

    What is RequestProcessor, how to extend it?

    RequestProcessor is a class which is used by ActionServlet to maintain the state and process the activities in different level of request lifecycle. RequestProcessor have following method into it:1.) processPreprocess – Used to execute line of code before the action servlet start working on any request.2.) processPostprocess – Used to run snippet after the process method finish its work. Below is the flow of work for struts with requestprocessor: Can we create our own RequestProcessor?Yes, We can create your own RequestProcessor class and can override any of above methods to fulfill the Business requirement. Add below snippet into Struts-Config.xml <controllercontentType=”text/html;charset=UTF-8″debug=”0″nocache=”true”processorClass=”com.testComp.MyOwnRequestProcess”/> Create a class with below declaration: public class MyOwnRequestProcess extends RequestProcessor…

    Comments Off on What is RequestProcessor, how to extend it?
  • Controler,  Interview Questions,  Learn Struts,  Struts 1

    What is ActionServlet?

    ActionServlet class act as the “controller” component in the Model-View-Controller (MVC) design pattern for an applications which is commonly called as “Model 2” architecture. Application may have one instance of this servlet class which is used to receive and processes all requests that change the state of a client’s interaction with the application. The servlet delegates the handling of a request to a RequestProcessor class object. The RequestProcessor is used to process request and it selects and invokes an Action class to perform the requested business logic. Action classes can change the state of the application’s interaction with the client by updating or creating JavaBeans that are stored as request…

    Comments Off on What is ActionServlet?
  • Action,  Controler,  Interview Questions,  Learn Struts,  Struts 1,  Struts 2,  Struts Components

    What is Action Class?

    An Action class in the struts application extends Struts ‘org.apache.struts.action.Action” Class. Action class acts as wrapper around the business logic and provides an inteface to the application’s Model layer. It acts as glue between the View and Model layer. It also transfers the data from the view layer to the specific business process layer and finally returns the procssed data from business layer to the view layer. An Action works as an adapter between the contents of an incoming HTTP request and the business logic that corresponds to it. Then the struts controller (ActionServlet) slects an appropriate Action and creates an instance if necessary, and finally calls execute method. To…

    Comments Off on What is Action Class?