A framework, or software framework, is a platform for developing software applications. It provides a foundation on which software developers can build programs for a specific platform. For example, a framework may include predefined classes and functions that can be used to process input, manage hardware devices, and interact with system software. This streamlines the development process since programmers don’t need to reinvent the wheel each time they develop a new application. A framework is similar to an application programming interface (API), though technically a framework includes an API. As the name suggests, a framework serves as a foundation for programming, while an API provides access to the elements supported by the framework. A framework may also include code libraries, a compiler, and other programs used in the software development process.
User fullness of frameworks-
A framework will often dictate the structure of your application. Some frameworks even supply so much code that you have to do very little to write your application.
This can be good or bad, depending on how easy it is to use. Frameworks are the substance of programming.
You build on top of a good one, your program is solid and fast and comes together beautifully.
You build on top of a bad one, your life is miserable, brutish, and short.
Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time. Apache Struts 2 was originally known as WebWork 2.
- Apache Struts 2 is an Apache Struts 2 that employs a filter dispatcher as the controller. When writing a Model 2 application, it is your responsibility to provide a controller as well as write action classes. Your controller must be able to do these:
- The first benefit of using Struts is that you don’t have to write a controller and can concentrate on writing business logic in action classes. Here is the list of features that Struts is equipped with to make development more rapid:
- Struts provides a filter dispatcher, saving you writing one.
- Struts employs an Apache Struts 2 file to match URIs with actions. Since XML documents are text files, many changes can be made to the application without recompilation.
- Struts instantiates the action class and populates action properties with user inputs. If you don’t specify an action class, a default action class will be instantiated.
- Struts validates user input and redirects user back to the input form if validation failed. Input validation is optional and can be done programmatically or declaratively. On top of that, Struts provides built-in validators for most of the tasks you may encounter when building a web application.
- Struts invokes the action method and you can change the method for an action through the configuration file.
- Struts examines the action result and executes the result. The most common result type, Dispatcher, forwards control to a JSP. However, Struts comes with various result types that allow you to do things differently, such as generate a PDF, redirect to an external resource, send an error message, etc.