Java
What is the directory structure of Struts application?
Nov 26th
The directory structure of Struts application :
What is the ActionForm?
Nov 26th
ActionForm is javabean which represents the form inputs containing the request parameters from the View referencing the Action bean.
What are the important methods of ActionForm? What are the important methods of ActionForm?
Nov 26th
The important methods of ActionForm are : validate() & reset().
What is ActionMapping?
Nov 26th
Action mapping contains all the deployment information for a particular Action bean. This class is to determine where the results of the Action will be sent once its processing is complete.
.How is the Action Mapping specified ?
Nov 26th
We can specify the action mapping in the configuration file called struts-config.xml. Struts framework creates ActionMapping object from <ActionMapping> configuration element of struts-config.xml file
<action-mappings> <action path=”/submit” type=”submit.SubmitAction” name=”submitForm” input=”/submit.jsp” scope=”request” validate=”true”> <forward name=”success” path=”/success.jsp”/> <forward name=”failure” path=”/error.jsp”/> </action> </action-mappings>
What is role of Action Class?
Nov 26th
An Action Class performs a role of an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request.
What is ActionServlet?
Nov 26th
ActionServlet is a simple servlet which is the backbone of all Struts applications. It is the main Controller component that handles client requests and determines which Action will process each received request. It serves as an Action factory – creating specific Action classes based on user’s request.
What is role of ActionServlet?
Nov 26th
ActionServlet performs the role of Controller:
- Process user requests
- Determine what the user is trying to achieve according to the request
- Pull data from the model (if necessary) to be given to the appropriate view,
- Select the proper view to respond to the user
- Delegates most of this grunt work to Action classes
- Is responsible for initialization and clean-up of resources
What is Struts framework?
Nov 26th
Struts framework is an open-source framework for developing the web applications in Java EE, based on MVC-2 architecture. It uses and extends the Java Servlet API. Struts is robust architecture and can be used for the development of application of any size. Struts framework makes it much easier to design scalable, reliable Web applications with Java.
What are the components of Struts?
Nov 26th
Struts components can be categorize into Model, View and Controller:
- Model: Components like business logic /business processes and data are the part of model.
- View: HTML, JSP are the view components.
Controller: Action Servlet of Struts is part of Controller components which works as front controller to handle all the requests.
