Struts

Advantages of Struts2.0 Frameworks
adplus-dvertising
Previous Home Next

Introduction:

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

Class/Library File Descriptions:-

  • 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.
  • Threading Model: Struts 2 framework instantiated Action object for each request, so there are no thread-safety issues. 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.
  • Testability: Struts 2 Actions can be tested by instantiating the Action, setting properties, and invoking methods. Dependency Injection support also makes testing simpler.
  • Expression Language: Struts 2 can use "Object Graph Navigation Language" (OGNL).
  • 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.
  • Type Conversion: Struts 2 uses OGNL for type conversion. The framework includes converters for basic and common object types and primitives.
  • Validation: Struts 2 supports manual validation via the validate method and also contain the Sub Framework validation . Control of Action Execution:- Struts 2 supports creating different lifecycles on a per Action basis via Interceptor Stacks. Custom stacks can be created and used with different Actions, as needed.
Previous Home Next