CodesJava

Easy learning with example program codes

What is the difference between struts1 and struts2?


Struts 1 Struts 2
  1. Struts 1 Action classes must extends an abstract base class.
  2. Struts 1 Actions are thread safe because they are singletons.
  3. Struts 1 Actions are depends on the servlet API because the HttpServletRequest and HttpServletResponse have to be passed in the execute method.
  4. Struts 1 use the ActionForm’s object to receive the form input.
  5. Struts 1 use the JSTL expression language.
  6. Struts 1 uses the standard JSP mechanism for binding objects into the page context.
  7. Struts 1 provides less flexible type conversion.
  8. Struts 1 uses manual validation by validate method on the ActionForm.
  1. Struts 2 Action classes not have to extends any abstract class. They may implement an Action interface.
  2. Struts 2 Actions are not thread safe.
  3. Struts 2 Actions are not depend on the servlet API.
  4. Struts 2 eliminate the need of ActionForm.
  5. Struts 2 use the “Object Graph Notation Language” (OGNL) expression language.
  6. Struts 2 uses the ValueStack technology for binding values into views.
  7. Struts 2 provides more flexible type conversion.
  8. Struts 2 allows manual validation by using the validate method. It also the XWork Validation framework.

Related topics



Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap