• Action,  ActionForm,  Interview Questions,  Learn Struts,  Struts 2

    Struts2, First “Hello World Application”

    In this tutorial we will see how to create a simpe Struts 2 Hello World Application. The following files are needed to create a Hello World Application. web.xml struts.xml HelloWorld.java index.jsp success.jsp web.xml is used to configure the servlet container properties of the hello world appliation. The filter and the filter-mapping elements are used to setup the Struts 2 FilterDispatcher. The filter is mapped to the URL pattern “/*“. This means all the incoming request that targets to the Struts 2 action will be handled by FilterDispatcher class. <filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.FilterDispatcher </filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping><welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list> The gateway for our hello world application is index.jsp file. The index.jsp file should be mentioned in web.xml as shown…

  • Action,  ActionForm,  Interview Questions,  Learn Struts,  Struts 2

    Struts DynaActionForm

    DynaActionForm is specialized subclass of ActionForm that allows the creation of form beans with dynamic sets of properties, without requiring the developer to create a Java class for each type of form bean. DynaActionForm eliminates the need of FormBean class and now the form bean definition can be written into the struts-config.xml file. So, it makes the FormBean declarative and this helps the programmer to reduce the development time.

    Comments Off on Struts DynaActionForm
  • 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?
  • 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?