You are on page 1of 5

1.What s MVC?

Mode-Vew-Controer (MVC) s a desgn pattern put together to hep contro


change. MVC decoupes nterface from busness ogc and data.
Mode : The mode contans the core of the appcaton's functonaty. The
mode encapsuates the state of the appcaton. Sometmes the ony
functonaty t contans s state. It knows nothng about the vew or controer.
Vew: The vew provdes the presentaton of the mode. It s the ook of the
appcaton. The vew can access the mode getters, but t has no knowedge
of the setters. In addton, t knows nothng about the controer. The vew
shoud be noted when changes to the mode occur.
Controer:The controer reacts to the user nput. It creates and sets the
mode.
More about Mode-Vew-Controer Archtecture >>
2.What s a framework?
A framework s made up of the set of casses whch aow us to use a brary
n a best possbe way for a specc requrement.
3.What s Struts framework?
Struts framework s an open-source framework for deveopng the web
appcatons n |ava EE, based on MVC-2 archtecture. It uses and extends the
|ava Servet API. Struts s robust archtecture and can be used for the
deveopment of appcaton of any sze. Struts framework makes t much
easer to desgn scaabe, reabe Web appcatons wth |ava.
4.What are the components of Struts?
Struts components can be categorze nto Mode, Vew and Controer:
Mode: Components ke busness ogc /busness processes and data are the
part of mode.
Vew: HTML, |SP are the vew components.
Controer: Acton Servet of Struts s part of Controer components whch
works as front controer to hande a the requests.
5.What are the core casses of the Struts Framework?
Struts s a set of cooperatng casses, servets, and |SP tags that make up a
reusabe MVC 2 desgn.
|avaBeans components for managng appcaton state and behavor.
Event-drven deveopment (va steners as n tradtona GUI deveopment).
Pages that represent MVC-stye vews; pages reference vew roots va the |SF
component tree.
6.What s ActonServet?
ActonServet s a smpe servet whch s the backbone of a Struts
appcatons. It s the man Controer component that handes cent requests
and determnes whch Acton w process each receved request. It serves as
an Acton factory - creatng specc Acton casses based on users request.
7.What s roe of ActonServet?
ActonServet performs the roe of Controer:
Process user requests
Determne what the user s tryng to acheve accordng to the request
Pu data from the mode (f necessary) to be gven to the approprate vew,
Seect the proper vew to respond to the user
Deegates most of ths grunt work to Acton casses
Is responsbe for ntazaton and cean-up of resources
8.What s the ActonForm?
ActonForm s |avabean whch represents the form nputs contanng the
request parameters from the Vew referencng the Acton bean.
9.What are the mportant methods of ActonForm?
The mportant methods of ActonForm are : vadate() & reset().
10.Descrbe vadate() and reset() methods ?
vadate() : Used to vadate propertes after they have been popuated;
Caed before FormBean s handed to Acton. Returns a coecton of
ActonError as ActonErrors. Foowng s the method sgnature for the
vadate() method.
pubc ActonErrors vadate(ActonMappng mappng,HttpServetRequest
request)
reset(): reset() method s caed by Struts Framework wth each request that
uses the dened ActonForm. The purpose of ths method s to reset a of the
ActonForm's data members pror to the new request vaues beng set.
pubc vod reset() {}
11.What s ActonMappng?
Acton mappng contans a the depoyment nformaton for a partcuar
Acton bean. Ths cass s to determne where the resuts of the Acton w be
sent once ts processng s compete.
12.How s the Acton Mappng speced ?
We can specfy the acton mappng n the conguraton e caed struts-
cong.xm. Struts framework creates ActonMappng ob|ect from
<ActonMappng> conguraton eement of struts-cong.xm e
<acton-mappngs>
<acton path="/submt"
type="submt.SubmtActon"
name="submtForm"
nput="/submt.|sp"
scope="request"
vadate="true">
<forward name="success" path="/success.|sp"/>
<forward name="faure" path="/error.|sp"/>
</acton>
</acton-mappngs>
13.What s roe of Acton Cass?
An Acton Cass performs a roe of an adapter between the contents of an
ncomng HTTP request and the correspondng busness ogc that shoud be
executed to process ths request.
14.In whch method of Acton cass the busness ogc s executed ?
In the execute() method of Acton cass the busness ogc s executed.
pubc ActonForward execute(
ActonMappng mappng,
ActonForm form,
HttpServetRequest request,
HttpServetResponse response)
throws Excepton ;
execute() method of Acton cass:
Perform the processng requred to dea wth ths request
Update the server-sde ob|ects (Scope varabes) that w be used to create
the next page of the user nterface
Return an approprate ActonForward ob|ect
15.What desgn patterns are used n Struts?
Peope who read ths, aso read:-
E|B Intervew Ouestons
Tbco Ouestons
Struts Tutora
Integratng Hbernate wth Sprng
Struts Intervew Ouestons
Struts s based on mode 2 MVC (Mode-Vew-Controer) archtecture. Struts
controer uses the command desgn pattern and the acton casses use the
adapter desgn pattern. The process() method of the RequestProcessor uses
the tempate method desgn pattern. Struts aso mpement the foowng |2EE
desgn patterns.
Servce to Worker
Dspatcher Vew
Composte Vew (Struts Tes)
Front Controer
Vew Heper
Synchronzer Token

You might also like