Javatpoint Logo

About struts1.1 and struts2.0

By: abc@gm*** On: Thu Aug 23 18:56:38 IST 2012     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank User
what is the difference between struts1.1 and struts2.0 ?Up0Down

 
There are many differences between struts 1.x and struts 2.x.
The main differences are as follows:
  • Struts 1.x action class has servlet dependency because it accepts ServletRequest, ServletReponse etc. objects whereas in struts 2.x. action class is POJO. It has no dependency.
  • In struts1 only JSP can be used as the view compoenent whereas in struts2 JSP, Freemarker, Velocity etc. can be the view compoenents.
  • In struts1, front controller is ActionServlet whereas in struts2, front controller is FilterDispatcher or StrutsPrepareAndExecuteFilter class.
  • In struts1, declarative validation can be done by validation framework whereas in struts2, it is done by the xwork framework. It support annotation feature also.
  • Action class object is not thread-safe in struts1, whereas it is thread-safe in struts2 as it is created per request.
  • In struts1, we use bean class and action class separately but in struts2, bean class is used in action class. Though, we can separate it.
Image Created0Down

By: [email protected] On: Fri Aug 24 20:11:40 IST 2012 Question Reputation0 Answer Reputation20 Belt Series Points0 20User Image
Are You Satisfied :1Yes0No