What is Struts framework?
Struts framework is an open-source framework for developing 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 applications of any size. Struts framework makes it much easier to design scalable, reliable Web applications with Java.
What are the components of Struts?
Struts components can be categorized into Model, View, and Controller:
Model: Components like business logic /business processes and data are part of the 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.
What is ActionServlet?
ActionServlet is a simple servlet that 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 the user’s request.
What is the ActionForm?
ActionForm is JavaBean which represents the form inputs containing the request parameters from the View referencing the Action bean.
What is ActionMapping?
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.
What is role of Action Class?
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 LookupDispatchAction?
An abstract Action that dispatches to the subclass mapped execute method. This is useful in cases where an HTML form has multiple submit buttons with the same name.
What are the core classes of the Struts Framework?
Core classes of Struts Framework are ActionForm, Action, ActionMapping, ActionForward, ActionServlet etc.
How to get data from the velocity page in a action class?
We can get the values in the action classes by using data.getParameter(”variable name defined in the velocity page”);