Java/Struts interview questions: - Distinguish between Struts 1.x and Struts 2.x

Published on by javainterviewseries

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
acompulsion. 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

Comment on this post