Advantages of Struts2.0 Frameworks
Previous | Home | Next |
Struts2.0 is a Frameworks which is an implementation of MVC-2 at server side. Struts2.0 have many advantages over the standard servlet and JSP API alone.But struts2.0 is complex so Struts2 have many disadvantages. Which we will discus next.
The Advantages of Struts 2 Framework which are following:-1. Action Classes:-Struts 2 framework Action class implements Action interface and other interfaces are optional .Struts 2 provides a base ActionSupport class to implements Validatable ,ValidationAware ,TextProvider and Action interface. Any POJO object with a execute signature can be used as an Struts 2 Action object.
2. Threading Model:- Struts 2 framework instantiated Action object for each request, so there are no thread-safety issues.
3. Servlet Dependency:- The Struts 2 framework servlet contexts are represented as simple Maps because it is not coupled to a container allowing Actions to be tested in isolation. Struts 2 Actions can still access the original request and response, if required. However, other architectural elements reduce or eliminate the need to access the HttpServetRequest or HttpServletResponse directly.
4. Testability:- Struts 2 Actions can be tested by instantiating the Action, setting properties, and invoking methods. Dependency Injection support also makes testing simpler.
5. Expression Lenguage:- Struts 2 can use "Object Graph Navigation Language" (OGNL).
6. Binding values into views:- Struts 2 uses a "ValueStack" concept so that the taglibs can access values without coupling your view to the object type it is rendering.
7. Type Conversion:- Struts 2 uses OGNL for type conversion. The framework includes converters for basic and common object types and primitives.
8. Validation:- Struts 2 supports manual validation via the validate method and also contain the Sub Framework validation .
9. Control of Action Execution:- Struts 2 supports creating different life cycle on a per Action basis via Interceptor Stacks. Custom stacks can be created and used with different Actions, as needed.
Previous | Home | Next |