Struts Interviw Qns Java

download Struts Interviw Qns Java

of 5

Transcript of Struts Interviw Qns Java

  • 8/11/2019 Struts Interviw Qns Java

    1/5

    1.What is MVC?

    Model-View-Controller (MVC) is a design pattern put together to help control

    change. MVC decouples interface from business logic and data.

    Model : he model contains the core of the application!s functionalit". he

    model encapsulates the state of the application. #ometimes the onl"

    functionalit" it contains is state. $t %nows nothing about the &iew or controller.

    View: he &iew pro&ides the presentation of the model. $t is the loo% of the

    application. he &iew can access the model getters' but it has no %nowledge

    of the setters. $n addition' it %nows nothing about the controller. he &iew

    should be notied when changes to the model occur.

    Controller:he controller reacts to the user input. $t creates and sets the

    model.

    More about Model-View-Controller rchitecture **

    +.What is a framewor%?

    framewor% is made up of the set of classes which allow us to use a librar"

    in a best possible wa" for a specic re,uirement.

    .What is #truts framewor%?

    #truts framewor% is an open-source framewor% for de&eloping the web

    applications in a&a //' based on MVC-+ architecture. $t uses and e0tends the

    a&a #er&let $. #truts is robust architecture and can be used for the

    de&elopment of application of an" si2e. #truts framewor% ma%es it much

    easier to design scalable' reliable Web applications with a&a.

    3.What are the components of #truts?

    #truts components can be categori2e into Model' View and Controller:

    Model: Components li%e business logic 4business processes and data are the

    part of model.

    View: 5M6' # are the &iew components.

    Controller: ction #er&let of #truts is part of Controller components which

    wor%s as front controller to handle all the re,uests.

  • 8/11/2019 Struts Interviw Qns Java

    2/5

    7.What are the core classes of the #truts 8ramewor%?

    #truts is a set of cooperating classes' ser&lets' and # tags that ma%e up a

    reusable MVC + design.

    a&a9eans components for managing application state and beha&ior.

    /&ent-dri&en de&elopment (&ia listeners as in traditional ;$ de&elopment).

    ages that represent MVC-st"le &iews< pages reference &iew roots &ia the #8

    component tree.

    =.What is ction#er&let?

    ction#er&let is a simple ser&let which is the bac%bone of all #truts

    applications. $t is the main Controller component that handles client re,uests

    and determines which ction will process each recei&ed re,uest. $t ser&es as

    an ction factor" > creating specic ction classes based on users re,uest.

    @.What is role of ction#er&let?

    ction#er&let performs the role of Controller:

    rocess user re,uests

    Aetermine what the user is tr"ing to achie&e according to the re,uest

    ull data from the model (if necessar") to be gi&en to the appropriate &iew'

    #elect the proper &iew to respond to the user

    Aelegates most of this grunt wor% to ction classes

    $s responsible for initiali2ation and clean-up of resources

    B.What is the ction8orm?

    ction8orm is a&abean which represents the form inputs containing the

    re,uest parameters from the View referencing the ction bean.

    D.What are the important methods of ction8orm?

    he important methods of ction8orm are : &alidate() E reset().

  • 8/11/2019 Struts Interviw Qns Java

    3/5

    1F.Aescribe &alidate() and reset() methods ?

    &alidate() : ;sed to &alidate properties after the" ha&e been populated