1) Struts 1.2 is class driven but the framework should be an interface driven(according to the proper design) so that we can extend some other classes
Struts 2.0 is interface driven we can write without using interface or with interface or with a class
2) In Struts 1.2 checkboxes are required to control it using reset() method
In Struts 2.0 check boxes does not require any kind of special appl for false values
3) In struts 1.2 all the action classes must extend action.
In struts 2.0 any class can be used as an action class and it can input properties by using any Java Bean directly to the action class.
4)Struts 2.0 actions are spring friendly and so easy to integrate with spring.
5)Struts 1.2 we have to use DWR if we require the Ajax feature.
In struts 2.0 we will be getting the Ajax features directly.
6)In struts 1.2 Request Processor is applicable for all the flows and it is a drawback.
In Struts 2.0 we can implement Request Processing logic for specific flows using Interceptor concept.
Struts + WebWork = Struts 2.0
7) In struts 1.2 for all the requests one action object will be created and used for all the requests.
In Struts 2.0 for each request one action object will be created because it contains the form data also.
8)In Struts 1.2 we should not declare instance variables in the action class because multiple threads will be using the same action object and instance variables.
In Struts 2.0 we can declare instance variables.
In Struts 1.2 if we want to use instance variables then use synchronized blocks
9) Struts 2.0 is a simplified design because it is interface driven and those are just like POJO’s.
10)Struts 2.0 is not http dependent, It is loosely coupled.
11)In Struts 2.0 action classes are simplify it’s like POJO’s and using inversion of control If we require we can get request and response objects.
12)No more action forms in Struts 2.0
13)Struts 2.0 testing is more easy because it’s not API dependent.
14)In Struts 2.0 all the basic default configuration we can get it automatically.
15)In Struts 1.2 it is difficult to switch from one presentation to another presentation layer.
In Struts 2.0 it is very simple to switch from one presentation to another.
16) In Struts 2.0 we get improved Results it’s like Action Forwards.
Struts 2.0 Results provides flexibility to create multiple types of outputs and in actual it helps to prepare the response.
17) In struts 2.0 we can get better Tag features like we can get the tags for freemarker also.
18)In struts 2.0 Annotations are introduced Applications in 2.0 can use the java 5 annotations as an alternative to xml and java properties configuration. Annotations minimize the use of XML.
Struts 1.2 and Struts 2.0 both supports the manual validation via a validate method.
Struts 1.2 uses validate method on the ActionForm, or validates through an extension to the commons validator.
Struts 2.0 supports manual validation via the validate method and the xwork validation framework, The xwork validation framework supports chaining validation into sub-properties using the validations defined for the properties class type and the validation context.
20) Threading Modal
In struts 1.2 action resources must be thread safe or synchronized, so actions are singleton and thread safe.
There should only be one instance of a class to handle all requests for that action. The singleton strategy places restrictions on what we can be done with struts 1.2. Actions and require extra care to develop.
In Struts 2.0, Actions objects are instantiated each request, so there are no thread-safety issues. In practice, servlet containers generate many throw away objects per request, and one more objet doesn’t impose a performance penalty or impact garbage collection.
21) Type Conversion
Usually Struts 1.2 ActionForm properties are all strings, Struts 1.2 uses “common-BeanUtils” for type conversion. These type convertors are per-class and not configurable per instance.
Struts 2.0 uses OGNL for type conversion, The Framework includes converters for basic and common object types and primitives.
22) Binding Values into views in the view Section.
Struts 1.2 uses the standard jsp mechanism to bind objects (processed from the model section) into the page context to access.
Struts 2.0 uses a “ValueStack” technology so that the taglibs can access the values without coupling your view to the object type it is rendering. The ValueStack strategy allows the reuse of views across the range of types which may have the same property name b different property types.
Struts 1.2 integrates with JSTL, so it uses the JSTL-EL. The struts EL has logic object graph traversal, but relatively weak collection and indexed property support.
Struts 2.0 can also use JSTL, however it supports more powerful and flexible expression language called “Object Graph Notation Language”(OGNL)
Struts 1.2 uses and ActionForm object to capture input, and all ActionForms needs to extend a framework dependent base class. Java Beans cannot be used as ActionForms, so the developers have to create redundant classes to capture input.
Struts 2 uses Action Properties (as input properties independent of underlying Framework) that eliminates the need for a second input object, hence reduce redundancy.
Additionally Struts2, Action properties can be accesses from the web page via the tag libs.
Struts 2.0 also supports the Action form properties as well as POJO from objects and POJO Actions. Even rich object types, including business or domain objects, can be used as input/output objects.
Interceptors that can be preprocess and/or postprocess a request.
Action classes that can call business logic and data access code.
Results that can prepare views using JavaServerPages, Velocity and FreeMarker templates.