STRUTS

1.What is struts?

ans:

Struts is a framework to implement MVC i.e. Model View Controller pattern in Java. This framework takes care of multiple requests, have dispatcher to forward these requests to controller. Controller have business logic and render requested webpage with the help from View and Model or data.

2.What is MVC?

ans:

MVC is an application architecture pattern where you separate your code based on its usage in different packages so that code is easier to maintain.

Model layer holds your POJO definitions

View layer has all the views (JSPs etc) and related components

Controller layer is responsible for receiving the request and processing it (or sending it to the service layer for business logic processing)

3.What is the diff between MVC1 and MVC2?

ans:

MVC-1 Architecture
1) In MVC-1 Architecture, single web component(Servlet/JSP) is used as Controller and view but for other layers separate web components are taken.
2) Since, single component is taken as Controller and view, logics are mixed up.

MVC-2 Architecture
1) In MVC-2 Architecture separate components should be taken for separate layers.
2) Logics are not mixed, there is clean separation between the logic.

Note:Struts follows MVC-2 Architecture.

4.What are the classes used in Struts?

ans:

Struts Framework consists of following classes:

Action Servlets: Used to control the response for each incoming request.

Action Class: Used to handle the request.

Action Form: It is java bean, used to referred to forms and associated with action mapping.

Action Mapping: Used for mapping between object and action.

Action Forward: Used to forward the result from controller to destination.

Comments

Popular posts from this blog