Struts 2 framework best features details
Apache Struts 2 is open source web application MVC framework for creating elegant modern Java EE web applications. It favors convention over configuration is also extensible using plugin architecture in development which ships with plugins to support REST, AJAX and JSON etc… below are some of the best feature of Struts 2 framework:
- Simple POJO based actions – Struts 2 action classes work as controller. It also work as model and the action classes give response to user action (execute business logic during request processing) finally return the results so that it can be render by the framework to view.
- Pluggable framework architecture – It allows request life cycles to be customized for each action.
Flexible validation framework – It allows validation rules to be decoupled from action code.
Hierarchical approach to internationalization – It simplifies localizing applications.
- Automatic type conversion – It transparently maps values from HTTP to native Java data objects solving one of most tedious efforts when creating web applications.
- Integrated dependency injection engine – It manages component life-cycle and dependencies.
Modular configuration files – It uses packages and name-spaces to simplify managing large projects with thousands of actions.
- Annotation – Annotations reduces configuration overhead.
- Simplified testability – Perform test with Struts 2 is comparably easy because here you don’t HttpServletRequest and HttpServletResponse objects.
- Thread safe – Struts 2 objects instantiated for each request so there is no thread safety issues. (In general practice servlet containers creates many throw-away objects for every request and one more object does not impose a performance penalty or impact garbage collection)
- AJAX support – It has AJAX support for jQuery plugin, Dojo Toolkit plugin, Ajax client-side validation
Template support – Struts 2 support FreeMarker, Apache velocity etc..