Sunteți pe pagina 1din 6

.

SpringFramework 3 Test
Duration: 60 Min. Max Marks: 30
1). Whch eement n the sprng conguraton e s used to te the Sprng
contanerabout a cass and how t shoud be congured?
<a>.<bean>
<b>.<id>
<c>.<class>
<d>.<beans>
2) Spring ofers services for use throughout an application, not merely in a single
architectural tier
<a> True
<b> False
3). Which among the following is not a type of autowiring?
<a>byName
<b>byType
<c>byID
<d>autodetect
4). he act of creating associations !etween application components
"!eans) within the Spring container is referre# to as$$$$$$$$$$.
<a>Bean assocaton
<b>Bean wrng
<c>Bean coupng
<d>Bean ookup
%). he &pplication'onte(t interface is a su!class of the )ean*actory
interface.
<a> TRUE
<b> FALSE
+). Which implementation of ,&pplication 'onte(t, loa#s conte(t
#e-nition from an ./0 -le containe# within a we! application
classpath .
<a>CassPathXmAppcatonContext
<b>FeSystemXmAppcatonContext
<c>XmWebAppcatonContext
<d>None of the above
1 of 6
.
1). o set properties that reference other !eans $$$$$$$$$$$$$$
su!element of
2property3 is use#
<a> <bean-ref>
<b> <reference>
<c> 2ref>
<d><ref-bean>
4). When a !ean is instantiate#, some initiali5ation can !e performe#.
his can !e #one using the $$$$$$$$$$$ attri!ute of the 2!ean3 to
invo6e a setup operation.
<a>nt-method
<b>ntaze-method
<c>setup
<d>setup-method
9). Whih o! the !o""owing statements are true !or a sing"eton #ean in a #ean ontainer$
<a>Ony one shared nstance of the bean w be managed
<b>A new bean nstance s created every tme a request for that specc bean
s done <C>A requests for beans wth an d or ds matchng that bean
denton w resut n that one
<d>In the bean contaner, by defaut a Sprng beans are non-sngetons
17). 0oo6 at the !ean !elow.
pu!lic class 8(ample)ean 9
private int years:
private String ultimate&nswer:
pu!lic 8(ample)ean"int years, String ultimate&nswer) 9
this.years ; years:
this.ultimate&nswer ; ultimate&nswer:
<
<
What woul# !e the value of in#e(, to instantiate the !ean using
constructor in=ection?
2!ean i#;>e(ample)ean> class;>e(amples.8(ample)ean>3
2constructor?arg
in#e(;>$$$$$>32value31%777772@value32@constructor?arg3
2constructor?arg in#e(;>$$$$$>32value3422@value32@constructor?arg3
2 of 6
.
2@!ean3
Optons:
<a>0 and 1
<b>1 and 2
<c>Start-ndex vaue does not matter
<d>There s no attrbute caed ndex wth the <constructor-arg> eement
%%). The &eanFator' app"ies the (((((((((((((((pattern to separate an app"iation)s on!iguration
an* *epen*en' spei!iation !rom the atua" app"iation o*e.
<a>AOP
<b> IoC
<c> Command
<d> Seperator
12). In Sprng AOP, a _________ aways represents a method executon.
<a>|on pont
<b> Aspect
<c> Pont cut
<d> Advce
%3 A HanderMappng s responsbe for mappng URL patterns to Controer ob|ects.
<a>true
<b> fase
14). The ______________ cass aows you to specfy a response to the cent, resutng from
the actons you have performed by the controer.
<a>ResponseVew
<b> Vewer
<c> ControerResponse
<d> ModeAndVew
1%. VewResovers are congured n
<a>servet-name.xm
<b> servetname-servet.xm
<c> controer-servet.xm
<d> sprngmvc-cong.xm
3 of 6
.
1+. Sprngs ______________sends out requests to controers.
<a>ActonServet
<b> ControerServet
<c>DspatcherServet
<d> None of the above
11. "prex" and "sumx" are propertes of the
<a>InternaResourceVewResover cass
<b> |stVew cass
<c>XMLVewResover cass
<d> VewResover cass
14. Whch statements about DspatcherServet are true?
<a>It's a Mode part of the MVC pattern mpemented n Sprng MVC.
<b> It's a Vew part of the MVC pattern mpemented n Sprng MVC.
<c>It's a Controer part of the MVC pattern mpemented n Sprng MVC.
<d>It's an exampe of the Interceptng Fter pattern mpementaton.
1A. Look at a snppet from web.xm of a Sprng MVC appcaton:
<web-app>
<servet>
<servet-name>tradngapp</servet-name>
<servet-cass> org.sprngframework.web.servet.DspatcherServet </servet-cass>
</servet>
<servet-mappng>
<servet-name>tradngapp</servet-name>
<ur-pattern>*.htm</ur-pattern>
</servet-mappng>
What shoud be the name of the Sprng conguraton e for ths appcaton?
<a> tradngapp.xm
<b> sprng-cong.xm
<c> tradngapp-servet.xm
<d> Any name s ok
27) What coul# not return a Spring /B' controller? Select a single answer.
1. An absoute path to the vew
2. A ogca vew name
3. A new |stVew
4. vod
4 of 6
.
5. nu vaue
21).Where #o you cannot #eclare Spring /B' controller? Select one or more
answers.
1. In a Sprng appcaton context XML conguraton e
2. Into the web.xm e of the web appcaton
3. Into the |ava code by usng annotatons
4. Into the |SP pages
22). 'onsi#ering 2 classes &ccountServiceCmpl an# 'lientServiceCmpl. &ny of these 2
classes inherits from
each other. What is the result of the pointcut e(pressions?
e(ecution"D D..&ccountServiceCmpl.up#ate"..))
EE e(ecution"D D..'lientServiceCmpl.up#ate"..))
1. Matches pubc update methods of the 2 casses, whatever the arguments
2. Matches any update methods of the 2 casses , whatever the arguments and method
vsbty
3. Matches any update methods of the 2 casses , wth one more arguments and whatever
method vsbty
4. No |ont pont s dened
23). Fsing the Spring &GH framewor6, what is the visi!ility of the metho# matches
!y the following =oin
point?
@Pontcut("executon(* *(..))")
private voi# anyOperaton() {};
1. A methods, whereas there vsbty
2. A methods, except prvate method
3. Protected and pubc methods
4. Pubc methods
24). What is an after throwing a#vice? Select a uniIue answer.
1. Advce that coud throw an excepton
2. Advce to be executed f a method exts by throwng an excepton
3. Advce that executes before a |on pont
4. Sprng does not provde ths type of advce
2%). What is an after returning a#vice? Select a uniIue answer.
1. Advce to be executed regardess of the means by whch a |on pont exts
2. Advce that surrounds a method nvocaton and can perform custom behavor before and
after the method nvocaton
3. Advce to be executed before method nvocaton
4. Advce to be executed after a |on pont competes wthout throwng an excepton
5 of 6
.
2+). What is an a#vice? Select a uniIue answer.
1. An acton taken by an aspect at a partcuar |on pont
2. A pont durng the executon of a program
3. An aspect and a pontcut
4. A predcate that matches |on ponts
21). What statements are not correct? Select an uniIue answer.
1. Constuctor and propertes autowrng n the same bean are not compatbe
2. A bean shoud have a defaut or a no-args constructor
3. The <constructor-arg> tag coud take type, name and ndex to reduce ambguty
4. None of the above
5. A of the above
24). Seect the rght statement about referrng a Sprng conguraton e nsde the package
com.exampe.myapp n the beow exampe?
AppcatonContext context =
new CassPathXmAppcatonContext("casspath:/com.exampe.myapp.cong.xm");
1. The casspath: prex coud be omt
2. Package name wth dot s not we formatted usng the dot character
3. The sash character precedng com.exampe coud be omt
4. A of the above
5. None of the above
2A). Seect one or many correct answers about sprng bean fe cyce.
1. The method annoted wth @PostConstruct s caed after bean nstantaton and before
propertes settng of the bean
2. The method @PreDestroy of a prototype bean s caed when the bean s garbage coected
3. The nt() method decared n the nt-method attrbute of a bean s caed before the
afterPropertesSet caback method of the IntazngBean nterface
4. The method annoted wth @PostConstruct s caed before before the afterPropertesSet
caback method of the IntazngBean nterface
37). What is@are typically case"s) where you usually nee# to manually instanciate#
an &pplication'onte(t?
1. In a web appcaton
2. In an ntegraton test runnng wth the Sprng|Unt4CassRunner
3. In a standaone appcaton started wth a man method
4. None of the above
6 of 6

S-ar putea să vă placă și