Java/Struts interview questions: – Differentiate between Struts 1.x and Struts 2.x?

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


Get more on Java/Struts interview questions from author’s blog


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s