• 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?
  • ActionForm,  Learn Struts,  Struts 1,  Struts Components

    Need for ActionForm not to be an interface?

    We have ActionForm in aour Struts application which is a class file and not an interface, what will happen in case if we implement it through Interface, There are few reasons why an Action Form should not an interface. Adding a new method in interface (in case new version of struts is released) will break earlier application’s form bean. While in case of base class one can add new method as default implementation which doesn’t break earlier applications to use new version, its a simple extensiblity issue while making ActionForm as Interface. In case Action Form is being an interface, struts developers would be required to use their business objects…

    Comments Off on Need for ActionForm not to be an interface?
  • 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?