| Struts 1.x | Struts 2.x |
| Configuration of ActionServlet via servlet | Configuration of FilterDispatcher is via filters |
| Struts1 extends the abstract base class by its action class | Implements Action interface but not a compulsion. Any POJO class can behave like Action |
| Follows FrontController pattern | Follows FilterDispacther pattern |
| Extra care has to be taken to make resources thread safe because Actions are singletons | Action objects are instantiated for each request and hence are inherently thread safe |
| Testing is a problem since execute() method exposes Servlet API | Testing is easier |
| ActionForms serves are input | Any POJO can serve as input |
| Binds objects in page using standard mechanism | Binds objects using valuestack |
| Type conversions are using common-beanutils.jar | Type conversions are using OGNL |
| General notation for config file is Struts-config.xml is used | General notation for config file is struts.xml |
| No concept of namespace | Namespace are readily available for modularity |
Also see the following interesting video on Struts: -
Know more on Java/Struts interview questions
Regards,
Get more on Java/Struts interview questions from author’s blog
Struts Interview Questions and Answers
ReplyDeletehttp://allinterviewquestionsandanswerspdf.blogspot.in/2016/06/40-top-struts-interview-questions-and.html