Difference Between Struts1 and Struts2


--> In struts 1 it is mandatory to extend action class , Http request and response parameter is passed through execute method and execute method always returns action forward

--> Where as in struts 2 ,any java class with execute method can become an action class,and execute method can return string

-->Struts 1 is tightly coupled with servlet hence not easy to test

-->Struts 2 is loosely coupled with servlet hence easy to test

-->Font end is action servlet and filter in struts 1 and 2 respectively

-->Filters are FilterDispatcher and struts.PrepareandExecuteFilter in   struts 1 and 2 respectively

-->Another enhancement in struts 2 is interceptor which allows to do lot of stuff much easily e.g. file upload using Struts2's builtin FileUploadInterceptor class.

No comments:

Post a Comment