Spring ALL Hand Written Notes
Spring ALL Hand Written Notes
05ir€ tebFrarne (l)dlKs ore can jusr develc'pg hjeb ofpllco$ctos '
t.lO;og 6frin3 toe CaD derclop Otl hrtaS oP lo$ic3 like Buaioeos l-ogic) Per5i5trffe l$t
sprDS
cafioD FrarritooiK
rgpe I jc,vcr-j EE Frarre tr:orr' I APP)i
Vcndtn: XntaP<.Ce Bt
G'tatc'r : hr. Qad Jhoo6c'o
OpeoSource Slrrl
5gt'ogftatrfrd E'65
'Io Dd.)r,lood elul I gdjpbad as zppire Roro '11^11^1'
6Frng 5.x Cootcd oO P,o rr6duleS hrt $cr3 ore grd4ed iofo 6 roqicrr Cofr{-Acrries
6p'jry Aop @
5Pilog e'l Ov€( vlei! Dtagraro :- '-/
tt cot"
ff_l F.] -
E@
(nvcl-&rocnl )
@@ t-]
lPc'ftletl
rrtl
---1
lsttA"6 I
flr""-*""t-I
Aop
Tesl
Ob c,xro fra-. eoorl.. slul a,"ilca}loo6. lire shru-ts c4pD / JsF cfto6 e,< '
+ 5prrng is o' &uabase d O1:eD 6oc-ry.€, l;€h, -trx{hi-i loo6elg carple d, C.(5p€ el orierLk d
-+ O[PD€cxrr ce 5l(' rrEao S Tt ]5 mi or,lg Pree elto b'r-l- it6 Slrlrce cmte cpitl be
OPcsed to pY{IarDrrrls alorg c.pirb io6t-cdlal"loD'
slca '
z.s1.lrirg bome>\rrc "{?.;rd".t Gpr€sen-r5 Sugce cvre,4 6pnng
a+PD6'
epting AWI)taHon5 ore
li€h-f-craflhJ
-+ fo,ql i,g lighr-DejBhf slco crnd
TeaSooS)
rtrl cc'obe 6'aivalzd
O Spti.g CantarrrrS aYe tlthj-&cJghr erlr,yrArfrf|, Berorrse
crn be elcc,,j€d
toi$'ocj- tt'€ hr"\td *i5hJ-
o rqctr oe the 3Pin3 a*lo
C{plico$cIn se-ruc-'r and ebwuen 3ltos'
3Pn'6APr
trirbcr.,-t crsing
conkP &rrbPd
@ resO(-trces
o? sPnr5 oLpplicc!$crq
rneroor3 4d C?u fda'{c€S cct€
€{,'ti"3 c4prirafionS rrrrckr
colrre exauht^$
f6rt reollured
€163 1o leaxn
ood use
*@epr'ng Terlno\63 \5 *rn uoe 66;rq e3 rk
de{€nden% io less blluo tcoo comPonen'fs
-> A? the Degree oP ,,J
ccso-{grtonj/s
tFffi tht &trnPon€nj's
6ltrr' r€ozoos'
Sprro$ 15 looselS ccrgltleJ
o'rb ffing Coe Cao ule Cj,rbett \rtd;v\d-PP! rltd4rlc-\
Q qxtq 4p ot'te- wnwas
cJr r& rnetdple roodules tu garheJr'
\ enc&iliog roiddfecor
-+ Jt 15 oturcr5S -oc*'rer7.d t'o &elop$S$l"amr'lccitlano
\-'7 &xvrceS \ire 6ecrrtirS,-IrcrnScrclicro ff€ror ctod erc'"'
BPr'n8AoP to ofplb fut'
\J q **'htd"q; u'ued
sp,,ng Fovi&s neLo
roiddlebrrYe fervicgs on 6Pttog applicarxoDe'
\t-z Aat€{} or;ented
-Th)s
rrnve6 rhe 4nn3 as '
Irsec-rlc'cr
9'
kpendcn$ lmVtp o
ktxn, JNDJtfttsr'U
\lccil-te,
oh'trcj rePerence
E$@:- 1e ccag coe co\lect utagjlo\rc
\'./
Degmdent-3 tooLu-{'
\..,
.r-, Mvknrc(ge:- can gorbe'l oorg ql'ored glq'ode-,nrv*!'!/es'
ressr'6ce
time loguhc,r it dqryt'*ttva-br8
\-'? qsecrt(r shctild 3fr-nd Some
D,5crdvuoK,-te:-
\"/ ttewr
V&rt( ctitizing
-.-+ Cct)P'tntlm(
kfrndeouJ frrtrctlcml- ffre urclc-tloging ee.rv&r OrtC*ttTAnU( Cw) PfLo
'ltsffr!€ &ssign5 vrrlrre5 to tbc rrsccrrce au-toroarlczk and
\-.., Ccir) aPec^at
v. $nornicoila.
crrrnorcl)*e ""a"tovnX
Jrrrr'ticm forsoauea c6
focLinver5roof
in Da..drrj
-) etc" pushes the vcrtrtcs
to rt-e
- &nrtarrcr to{ ) Se'.\€x [d) Qunrrrne [tl) F[(r] and
Teid.{te'
a----1
r$::P ccrrlse nz<ric,{ i;; ossigrrd fo Sradenr *re ra-nroerr-h 6i<-l&rlt tr-$iore'ro R'r --
c
The dnin OF he olpricc.rtcrrr ii Ccll€ d Business l-Oc;l
-+ lcfJlc
elcos
on Dc'J.Bc6e
-,,> pe.cisl-cnce loglc )5 u-gfut rrnfu- corzo opt"jrtc'ns
C--rc'rcore g--> trfe R-+Pead D --trytJt
- t4'd
'- (,sclctt) G&u{)^
l
frw,.)
*--r precrr-krHoo lc6tz i6q1ug5 ute'riorcafa.cc {* errd&scr, to &-{,pPi3 to lnprs to apt}cat{,au
(rcrnrrcrtler) (rroaer;
cvieul)
st'*sArp -r
Eresersu[-Bfoncamp DAoctos6(Jruc) -------------*Ot
LV) tc)
-_--> (6rs;sttnce logic)
[a'togi.1
----) . nrodel
-@ ng4) I
@
- [b'toglt;
# pnofHibcYrerc) rDosltr]
rnrdbJs-,vic€S Cornp
'vap?p Ig,locJic) -_---> CRrsishcnce loBJc)
Cv)Cc) *fflel t
- (,r) gr NP + 3pr;og oRrl J m'o &4 "---- -4 DR s/to
-ipt'og wcbtlvc ---=) S1r".{
($ tog'c ( Pr'rsi sKnce l€lc )
cv) ct) 7
Lcrnguoge trt'rt(t*'r'noo)
f;|ltt1- xro\ 8ig\6bcE
Savref ,
SerrPrHt rer
6nurs
J5F
\,.tclruotX
Cocoon
Tc,+shq
Netf4vC ard erc' - -'
P:*rru r.onoloat.* tt t-
hltrYmlt'
OUB
io c (rnsr*ffc( Ae)
"ouo
#*"ryg*" comPoo<rr6
-loPtio\'
C'DO
igor-le
Stnog 9Ao
Oer\ 6nd etc"'
Qnng
,rJ
tf
HiSb Lernl Praf$ Arab) trctur e Srltrrs - 9flno g - i-ii brr ocl€ Tnrt€retrlc,r)
t
oinnt, s5P, joaer rcp"rrs.,. ,,
Sovtd( Ailan&rrra )
oracle pg sl,
rco6) ore
-> Att loreor Technologi€.s oF iova aod *eir larcst versicrob (rrefc,vd a6t.lt
Sapo*ng trJo/ f"rr rrnctel pvogrqmlng To rrrake *e beohrbQ'e-g qft{ a4licollon5
ai lighr-c*i'gk.
FldrnPks:-
{-
3
fr] Er.b\ic tlcrso Tesr atods kroo '0.*u iu nor ex rcnd;T Sro- ortB.r clc'rt -
t_ ^t
Iest is p656 116t5
a------r
7,
,'Test,, *
Dern o " ore not Pio CUsteS
5
L
.)
e
{_
3 mr clas6 '
' so"Test" io P0J0
"Joua.r.yr.r--*o' [r; is p..,tt oljdut ta-brn1og1
-IbreaA
@ pu,blic cldss Tes+ e.r6Dd6
u=
t
\l
ilTest'i5 java'laq'l6t"oa is pcrr 4 bs;'java opls
patb class bc-z
@ pubrtc r]ass Test
J
L
V..btit uoid ror()
t_I uses sFioS APt
3
7
r{
J
ElcroolPq ' -
1.
cms
/i rtrrhod dectc'rarl
\---l
1sg1,, i$ poJJ
t&.rr c{
" LoJi'
&va+prb )
7 Feorures op 6fx,og:- 'v.
d+etoprrrnr.
--) toe Con qse lhi6 modcrle to eodoaiand 5orrr,6&oo tiFeqcle rmroSe\rteaf c'\nd
depnfenq Jf\pLhlon.
Ltite 6sb
3[r;rgconk1ioet6areguenpctft'rrn$trng&onLigecXtterrrarriScrrrnto"dtoFnFo-
-,
To cctirictK ,h.pqnrwOr,r.xr ccrnt3ioc,{ M6 C",eote ohj tn j^o clcls rhJ- irnpktoux
in o&1
0rg' SpringtrrmeoJoyt . CcoKxt. Apptrcarr.,oGrrur (r)
a-
EY- Fr. &rr..X- 1,$priciax*Qltre* r('<sp,'q,fu B,iy
Apnrr(d$co Ccrrt€"i Ctx = nelo
folre""X., -t-
I
+
ilppt tcanonGnfe" t
Co.toi.rrr
Apdicattco C6dri+ inttr €c(c€
bi C'rea-ring OQreom P"l
Lrle CC,o't &!!lcf CotLl6-rDe'{ , JsPCc'n}c'rne/(
i\cDv@K
conlz')ner6 P{2 ur-oeed Fo 6l-o'rt-
so, -Tirt ore bectuti tltigM
&train ctCrCSeS.
4 BeconFacro'i ccrnldne^/'
fupffA.rtfooG*uk Cbnfcarf'r i5 errlpncernenr
Spring lr*ofo1e
-) ib can be a POJI
--4 ibi6 oPHdnol \t&LtxG 'B't rtcorrrnJed lo
taFe
_J canrcdn6 dectc'ranoo oP B'r'uboctt/u*;li$ method's -
!r\+"meet-
^
-) ocrb os
cr Gmmon <rnder,stund,ng doarrn * kJu€(tl Ll\cnt d}[email protected]"
"'/
it tiFc 6!.,sg ho.oalxr h*,ng dedotcr-Han a? topics[tr""r'' t^tt a.s a5fferr€rzr
-) .J
du.,-re"rr Ulco facufft o9d Sf<,,&'r*). _.,
Spnog Bean
-.-, irnplerneru6 Spring I"*etftue OnJ prov;deS iaplerrrnfrdoo to Qp,lng inrcrfoa .\-,,
mbocts.
meftods, cmtruckod
s"{f-ttq t+*&*f &j".-n*s '
Ccnk(dnS
-"
--) CdnrcdnS artt$ rrcrtods
---) CdDlainb lipeL5cle roethocl5 '
s-tppricd ccrnc"^o'f,c
-t rb can be prrcb$ned / c''sc"&Pmed/*'tno'-oj trH
----) Conta;n6 &rsrqe5 rqerhods ioptemcr,raicrn hot'ing B'r*rnets Logic'
- sRciPging *re
drrors op resurvce thmugb xm) enhAeN tr'O Annot<li.orrs
to rrPlxs undevlcqltng conknnc'
Cr) serw Ccl)Fm'rocrrt-: lecqlniz;ng tho.r rr:arvct
ls c&t-ted resrrftc coo prgt roficm
t+lozlwts
.1,"q,*fu"'"*_15 :-
-xrn) coo be 1a\4D a5 6Pfio9 ch ftle'
-t oog 4ft1gt.prog7
dPPS
'''> 6l mor€ 5grrog cq P-'res in cld SPYiol
t/rle con one
o-+ SErnng kons rnet Ae cfu in Sporng cfi tsre '
.- + loc reLrred irErua$(rns
&nlc.ro5 ft{xctogltilecrcrn/
Cli(nj APPi;cc*ic/o : -
":-
' -' 0>''.,g Sq&ff5 brgp.e o? Dpendeng
rqieodcrn
t) gttel lnierncrrr
(b1 uai,rg etXxx (-) o? @n &o.o closs)
?) Gnsn""o.n }qiectton
(b .rsT pcrawreldzed Corrstuator.g oP sp.lofl &ao closs )
3) Inrcrft^ce JojecHcm
(b5 impternenllog Speqal inrcrftrce,s oq 6f'rloSBean class )
*S5ertclrelecHc,n: outoroorico\
and dSna-allfl
.v-.f_.)."r*,o.ls
t-) t'
aP Sfniog cc'u'taloer csoS 3rrXrx
"
tocosi6nvad.u.estort,.i,ornnt,co(rronrbr'vaniabtcs)oP6r'rnSkanc[!ss.rkn
b
lloloir. 0 mqbods
p-ibllc y614 bnnrt )
{.
" "'' lluse rorg herl
9
3
Wy,rru
coo6garc+lao 4^ ll.m^ Irlicdon'
Deroo " xm I [sr.ng cPg frre ) @.rg
<bean6 z
zbedn ia="lb closs=Tesi8eon'>
I
L" ia f
o6rt,-. --IEE6.r,,.s nU $sc,6 Coo [i3kr afi o')
4PmI,c.q '
()rt\
narrr =''toff' Vrrlue = hello" /^>
--T--- f "O'
4lkan>" f-s.*p*n*g L> Vattre to '/"
I
, ni...ra
1) beans>
fhto,r3h SefftrfnJ€crtcm.
d Colrlshf&o}(If6
uq'b Perarncrevize
'it is Calted Gtnstr&otrd r
*t)
\rl1ocs io
8€on t"06"*3t
o$a ond tb Qs6i8n
(t'cnhon.
Example Ste my i0 i-
3 \..'/
3 \J
3lt'ro's ,_)
zbmrs \,
tb" C las6 =.
Teslb€do >
zb€oo id =' \J
(
L/:ylrtj-tvclr - t-'
- lg'o Prooa anrg l''r otre ti
rne rbe.
4lbeooz
Lts€s oDe Pc($a'n 66o5irgtct-z^/ to av€(d€ t
-',
Spno$ tbn{-arrEr{ l,i
t;:: lo crssi6o votrre bdr to rnsg
Spnng Beao clr*s ohjech anJ U
ProP'ng '
sptng6ntcrnar ci-€cLr-es
-I?srBa.n .t"rr'w*bao)og r.rroe*15'bg <rslo3 :
rbe
L-pccccrrn &ns\aitlrt (Terra.o" tb=neul ?stBeao ("nt");
) \--,
Uetou:
Srcp-r:- [tswlop fte €crr-rce cde
as shc(Dn
E\APP5
ilD*o&,,.,'java ( Pofo
cioss ) (srx;ogBean )
\)
€lse if [he=lc)
w}cdn rr€+ --> Cnmd APr<^ooon: lnarneJ
-> db:netrr
DrooBrsn );
i
Abecrn Z DrrroB€qr,(
db ' seli'153 1"berto"); 'J
/l&aoa>
'.j
l/ Deto'o{i icnr' jttuc'
l
' n-r" )
-- Fr"Sr$.-Pest"te f"Dtt"Cfu
F;teSg.t -R.ao*.. res neo,
Srn"g {#$ =
"""'t'r'$' re'*1fr;
oo oi-"-t t"tus.,;
I
s
t+ s|)ring,jc,{
6Kp-s:r CoroPile ol\ the jcvaf(socrrcis 6n{ g^ecu.rc the ct;cnt a-pplico*lra
> jqvo.c X. javo
> jaVa Drrno(li{n/
eotoeS oF 6pt)D€ Ccmet€urafic'n
EeooFa$otg cor-rr'dncl
i5 cuivarcd tbe
Nhrn
3M trrnr Porser
Gre co,rt be verr Pued 4 usi"g
L S;tPte APr P..,r xr^t
@P"r.5'ge8ec'"'l'au');rne$odreturnoftrnof&c'ri"ctc,.ss6qjatondtoe
afer<f.nrngtl-o'tObJe*usin$'lctvct"rcm3'Ol'it'iclcrrsree"obi"
in pred;fined Clcrss"&.e'"'
!gl_E:- ger&c,nt) merhocl is rhe prrtde*ioed rnrrhoct
frttng aPPng.
oaj€tts
De&ndeoaJTniecttc'n cmll crm those SpntEBton
$pvioq Grta;nc1 parorrng
bJ rhe Sfrnng 0emJalne6 ib$elg '
*bn* ove clffoJd on Sp"n90"""
'Ilzt mraos 3p'rngConrruot'" co" t
'n Depo^'de"9Iruecrlc'n
pa&T
monucrl'l$'
doss oqpas ttnr art c,t..led bu P*St'-'*,d
he'Ael Staterrerrs la SpdngCfu [tte
Dm reratcd 61 c}ema rdotd
ke.Ptog
oork ie 6pHonol
in wb'xml '
is mand;t6'! ' Bur *rtl
t()
s'1aio eoAs toiib rnrrn tcmd€ Socs
-1i,nog cr{,nlicci}1o0 Pf':.o Sfrrxt toitb
156 i"otu'l'r{ f
I ="*:ffi"-:-:':: ;il r\ast re''""r"ri3arftprenr*'
Qn-X
@e ib clsesn't clcc']cs
-> Nhto BeooetrcT y &rntc'incr is acJivoled
closs onlerra anJ
gp.,gBeot,
Sring Barn clo'rs o$a*a, Tt LatdrcS
&rncBeon java->
'
&tw OA WL\riaQB oppn. Bll" Odd rhe forra.:itr$ 7-- Patar]';, @r6lrccfzr
->
Pq.blic hto&o"., ( St.S -uS )
{
tbis. rns6 : ro53 l
"
- Sgsrc. . ord'
t'
l-riorlD ( ft 1-llaram 1o'l5ratu<n ))
"^&o.,
DernoCfu. xcor
ZDftiYPE
LLxo.oS >
zbeao db'' 61d..s ="ffi*n'' 2
id --"
as c?Pr''
DemoCticr,t.j,av a ------) €arrE, Previdt''$
tags croder zbec'n> Ffl
o.n)g llxwYn]>
t^lbne ccrnhgrrtng fririo6Bcaq fo Plc'ce
tbeq6p,rlogCoola;neiuse6O-PaYarncon6tr(rol-(dP".6PY;ngB€&nct't:'Sin'lar'fiat
&t €ettc'rjnieofion'oo kan prro;r"tt<:
ond olso uie.g SefietXxxk) or-*'oas
crnlS Lcansftuld<lt - a{8> k'Xo und<"1
lalb,te 6*6ru1ng Slt.gBean iP got' plorce
--/
Ccmsnucrar & tu
/can> tag fteo Sq,ogbtt&lwt u$e5 lx.{ame}crized
J-41e$ton crrt
Geok SpngBeao clc{ss ohfrr 4 to Frfi:rrrn Gnsrrucr<rl
clow
--+ To omBfaye Orr Spriog Beao class Ohj a6 d€rlrdcrrt \*:lllre O*:r't Synt$Beao
pofr*ies ctsc. 4a-B-z 0'r YeP afr;**e,
;P aoe SPdog &an ctcss ;s lord,ng qncltr{ $:rrrgBean ctcc.s dei tbcn ft aued
Ll
Bcr.nCollabrort on.
p :\ Apns
!---------+ SPrlog
|+ $sa .)
F-------" Demo"iavc..
DerooB@r>'ia\'a
legBeao " iavc
DernocPg 'rrol
DmoCiicr* 'iavc^,
/ormo ..nva (ttat)
Poblic inrcrR ee &roO
{
lxrdic $rr"g 5agHeiloC);/e,,sioe.oflerb,ra
$
{
//bon Ptrt,r*o
,8w6 wo"7,
u 5erdeA ntd 11cj5
't inb age', lls;mprepropnj
<-TestBero tb;
lUpc profl,r.,es fu bold ohjerh
Prfolegr(d cl05! t!-- DaJ( d;J Jr.fu.,.rr.,
//tntnin s.rXrxt-) rrr-r$o.ls s{prrio5 g*krrlieu w't
f iroPterrrnt Busirrrsllerboc\
Frbtl c Sr,tng 6ag
llel o( ) t
{ '+age *"tb="+tb+
'l="+d i
*'n " Guodtl-nin6 " u " o3"'
&
bc cc',e2 o.^r
ro6vntg( )oritr
1o ( l src'tcr"erti'
5'O'P
obs., i5 lx.ssed tolt\ be cveoaAen
^rr,-'lt; closses
pSr'rngtl
r' mooro? rhe
thcf ohiect auror'nHecdrd'
Lelt'85t0 ;ara'rang'Qbi"o*c')
Jo dibptc* obre* durr'' toSr';ogc)
"*a';
ll tesbloio'3ava ( hrrrlerrlfkan ru ftndto')
-kttkoq
pc6\ic cla>6
t ll*on ttrDr,rru
Sx,ng mbS)
//nrrt Serttr rncrhoct ofl 6errcrs'tieo-rtcryr
wiL TwM,>pfu
Frbtic void cftNsg( 6"ng -E )
f .rrng
fhia = 116g I
g 'o p
( " T.rro.o.,, gsrllsg C-) .rr*oa" ) i
1
J
*
becerrse fbe tb" prrrpttg of DrnoBear, clas6 crn l^ptd ?st B e.,n {lccq.._-,
Ohpt.
<l__ h.oC%.*rrrt __) .r
z-&oir6>
t'dt" > J
;lwoto i6= clcob:"iova'cr-rit'Dore
J
Axqr'r.Y yg6€="5cor' Vatue="ll6J>,.TcrF.s ir 6cs lqootng
zgotttt\ rFrrrf, ='rrrrril-r" \41-oe:t' b" l>
' - i---, "Idvcgil as oioi\
J
L(W,fty harne=" dare ' \q.lue =">q" />
J
4beon> (flt't "'-'a
Z; &v aor evt
\v,
\-/
rclo>lni13
Jdbc ConoeatDRrol ;-
Jd'bc a:nnedoa
&bC Gnned'tcrnPool is ft'crctrg tb.rf ccrnlaios SeroF readglg availcr-bte
&tflr6. Arrtcrnnec-et.l.o o\)et6 in fbe Crn rt'rga:icno {-oo I repwsen-16 Ccrt're d'" virS
fuiasa,rceoQjccrnprraerrrsJabco^r,ecrrorr@looc|rLiccank[r:edtooccels
Corrnec$ao (-<r*ol '
ildbc Cg.,nectlo'n OhjecfS &o-
**
J.tbc Corn(Lrion lnot Qn cno<'le
@ 6n\
CD
@ @"
@@7
Jauc &lrt r
Jdb. Dw3;x,urce o[l is rorhiog bc.r lt is thc o&t oF an&,rtgtog
le $e5€ proqnhel. a^f- f;',.a up u\rh Nade tt'n &ivt'v da";ts r1leo idtx-ca;rrn:to"
f--------: 39rog
F-----r 6e6e
t---- OOoetatioo' iavq (Sp';ngf'ucr&ce )
DB0penanoo &ao java.
(6^= t.c.",
6fnogcfn.xtol [spring Gnfig&ra],on e'le )
D8Qrrotloo Clienf 'iav a f cUcnl- cppo )
// ugOpcrooo ' ;au a (lo,rr )
Jdwce
ft'btic DBo;x'"rro'n
(
ftm$,ro1(inr errpto );
pu^bric w
& Prot'. 3o% Rr.r,Na-e ( inr emenoy)
o
J
IWO?"ono"V""'ict'o
c,-rri'too l'ftrrfta*t"+
lrorrrrr Jaw'4r' &', -'
impon .laval . 81r' 1', -Yo*osn,""
a"u
\r
(/T'
ioplcrrr€rLr6 WQturau
plblic clcrsg Dfy7ptan,"o}edn
J
t
ilB*n prDou/ru
Drr"&ot" d6,
this, ds --ds;
7 )
d
else
{ ,,Q
Yhof = tealtc ool *cr'nd i
fetr^tl n Ddrne;
lt
d
Ccrlch CE (cpH 04 e )
tc
Terurrl " DB prpCrr-i';
I
$ll,**a
pLLbtiL ior ft**to"3 (tor evnoo)
s
' t# sLt-' o&
"
t"g - 6n Pol
J Po- idt'Jc
' ilgu *"a ,nreL*6n ohi
I
{
a"ynrSz*lrare()i
I
d
tsfrqn tuL)
\ltw*,oa
la^
zt ftjcrtpE
/-Mo6> >
-Lhf.:cro id= "d-rdb " cl.r35 : org " 5P' iduc ' &tasQrtc ' Wufir'oo.saha"fuu..e
ronr.--"d;*Clr,saName' - *:Xffi,;##f:
@o1,J
Vr.){re--" 0r&dc"id,u '16*'flparul}trr'" bbo"''" connetnan
log;og'jav @ omuct+'.nt
Q Sp,ing.jar @ Cb'rnrroo5-
TkJafo'rrc dia"t
lo
Seir5ccrra'ncr
\5 injeohog
) Fre,9trsi..
--'. $e SpnSCanhg..ralon Bre P'*^'fi' ?oh{ t't:";,
fuei}ed
locares
o? Sgnng crg
rr'\
v'j+t
-'4 Ht,e uecen srtdfu Atsoli-rrc prh (ot; r€l&Hre
l-trc,rcs rle Sp,;ng cfu B,e ftorn tbe d;*utrg locarrons 'jt'r f;'re's
-; t0 cLAssP^rtt
Odd€d envicrnrruirud V"*c.,Ot< -
on lp;rgcfu
il['r,
{d%ce3 B.re ia rhe"ain
Ercrrple EreSgatcrnResar.rce to lcc6tre $te "_
' f ,\,+rpu\ta-e loAeo ond cpben c,ti<rrrcpp
is rto.z in E '- \ APPs\ sping \Sesa €ot.i<,v
l-
|,1-
atienl A0P'.-
} i
.
F,efor*Res*rce rea =r.,,, Fre5tr*"-Qcc.'" (' ..\\ :\\ k-r\\ spogcfo .rm r')i
.: r l_+rrcdi vE Fftl
6frta5 40f,5
tuft'*' t**
S\d-)
E^o"'pte on UdtiaDg cLAS6PAf H r€coc.fcc:-
in cu.rLrApP
in Clicnroppl^,
( "5r"tngCfu ' tt r" ) ;
ChSsPa*,QeSCx.r ee re5 =rELn ChssPar6&sarr..
d;PPltp
ft afu Dtpendeni !6tr1e.sY0 dltP tuptso? kr'optugrlel uroted touse
Ond gjtri&,tt,s
Prcffr/tl fgpe
S;.rfrte dcrrrtrsPe Z'{q)ut>o' ''rf'l'e" er-Fhhils
"Volcre " dtulryJt(
jwa'rang.5rnng /value > ol
q-rTtr$ Lli6r>
zlist 7
.tc.va'utt'Lisr
java.ur,'t . $et c[tst",*es+ .ct. ) z'e*>
L6'oLP ?
io.m. urir' llc't
"refi' dfhd 5c4(
Beon tgne 1rc| > or
LlnoPS >
JoVa,util " PnCr'nre'S
E:- Tb asign nu\l votlle t0 Seun p"og"ty u.)e /ndtl> r4
,'rrr4 r)4rc'r(i:.io
ok,
&*x
g9:Ii lounch tlgEcliFe IDE 6Ptt;?Uin1 hkxYslnce
-Tltr A*" oehrr,r rlx lnaBds (oil) be sorrd
t o'T*r-.
cntrr+shi9t +o
lle,.on DrorralHes f'jaclede
iot a|e)
hre dt
* Lisr ft*-tc;
\ Stting Cotor6ll )
t1a.p &c"trua:
P*g*.t cePituJS:
gene@re &rKj6an'l
See* qu {}:pnftofs*el --.---j tlsttl_cliclr+ Surrc€r
gelior , Effi-.;_l ---------> \ost'fttonPciot F[e{or alpit<rJ3-__l
@ovor;de
'r*',. Sr'i"g sc'Stletto( )
-t'd= i:*
r'nam€ "
+name 1 "ctJ. ='1ct9e
{ ",oocl r'o'ruo$'
* =
-'-' '^
4
*'.,
="+ colorS &J+ "'"+colcrrSlrl+
''colrrs
" g*"'="*-6t15a .--
* P.,c,lln:.t
+ +" ph<rne's =
(
lpbane5 i' &'ru'l HcS "
*#::'
col 0{'5 Laf
3l).o'x+pa
3 ttrt*s
CunR6urct$orn Pttt
,gg- odd trr\u!\n$ omlcnl in S!m\
(!-- De'rnCfu.x nn) --) ?a -0e- rc!5
{bons gpnDg-bean-z'6.^bd 7
L"4 hPno=-At"f>
/lttsr >
LIPYDVntXT
..,
t9ngry ncrme=' calot6" >
zllsr >
4valut > Yed 4vcduez
zwlue > )ei I oo) u, \htut 2
blue Avatutz
AtisfYl"'>
tl?voSttrtt4z
Ll&Lo6>
/D,tnoCrt"* ,JavG
{
&arr".r'* knknDel
lllnnuon ")
('Sp'4eX'x*' );
Y-'B*nftttg d@ W=oeN Yrr&onfuoo'X (n.* crc,,ssParh Re;oar..
4prpr 2 \\
--) 'J
4lw1xnry z -'
6-ar,rQ \
.gt*ttrw-
Sr c
J
zfoot> \J
-)
.J
_)
Gna.t.rctol Lritrrot
Deon&ao.jctva
FdCic class Dro$*n inplcrnerurS Dcmo
t I lthrrrapslt\ fxDfr4.{eJ
inr aXe;
$tnog namc;
Prmr saloYu:
0K.
{6pr)DScf€,xrol ,- >
Alrr.arl>
zlbcrns:
:> Sirre Ltrt\stLefur - crr8 > toX is ptctc< d {r'r a tl"e$ rhe SF{n3 Grnfalnq utrq\
thae P:r-ctm Ccnshlacfai fu
i S,A&"n lnaranHc"tton and f"t Gnsr',...f,ot f'X eaff on,
/iDoro Crt,"r",ic.uo-
Stoc os Fevidas c40"1
Nore..-
to &m6gure &I''',et'l valt-t<l
Nbire li{o!"n6 r'uith cdnshra/'rdl iru"rrloq toe rped
E3'- ;n $Pn1&nnr
DroB=n fror agcr Sl"r5 *'nt, -Pt* &tt'5)
{uo.oge =qe;
ltrls. narnt --Dorrre i
{us's.la"6 = salqry ;
in SrrnS&%uroicn la.-
Z.I,tan,82
1bf0n i6 =''db"
class*-'Dk,-'o&.^8 >
-- 'ior " Yafute = 30 l>
/Czrt*auxx - ct:rt1 tqfL
!J:----- -
@X larr-- " Flot 3t56'171" f 2
\t.el/ae=
l1oosrtu4ttx -
" !o!ttt'--
" YqoJ l,
LLantt'ttst$ - 63 tgF - &.ravo'tc.ntl'SmnS"
LIVan>
A*ans>
*ren sraan roorrrer/
oP Onrfrcr*rt GnlarnS 6orrr fure
-> Il rn lFiPle f:tramelcrs
E$-"- in SpnrgBcan
ittt O.Lbic )
F+. D{rl}r6€on (i.rt a,int b, int c)
1 tt5'o =o;
- *rre .b =b;
, t ttr,5.C :
=C
in 6P'ogCcnfigrr.*,- f;r.
Zbctn ="dU" clc.5s?
16 ftrno&ao' j>
LU{\6lR'!ktt -d'r X in&x= " !h" Ya1u1="lo" f 7 €6eS ho'ct"
LllrrlnT
ltrc.osz name fo
Jhere la no sn lb b Bcao fiop.ttg rntn e
5P4t tor) Clmsrn rr<'r Parrafit'-rtf'{
-> froviSl
6nsrfltal:.i WaFfJ<r'3
<CsndnttlEut'a.:t6> U'5. +*rhO reason ue rpcd *' ,t""tg
j
i-2 -lhere io
a provi 6;crn io crclivcrtq kc.oFrcfrg Clmlcr/nei bcrsed cro *a q|t"od1 cd;urrrd _
Exampk, appl'totton: -
impon jaltr.urir.Drc;
Grrllic ctcrss Dn'o&dr1 imderrrors Demo
s
t l-br" d:
Zb€ons
('
LWan id -'d t ' clcrsS .b,va'uli I 'lnJ:-' I >
"
zl*ptns>
lDernoCPgg'xrnr Cchird B'rc ;
1lag65
"Pr668can'>
L51ea1 ="db" Cl05S =
'4
t@ltu\ mrne -'d" ) <v<? lacc'=i'dt' 12 z]PwYxrrr1 7
t)ban>
zll,xaos>
/nn.o Clicnr.iavq
r(f)Fr(6
/ chrU facrna"rug
Cot\ta)N,l
h^g (r,"- Ch,.ft,* R"*,'"t (' O.''.Cg a' I'i
Xmr&anFaomy -f=*,u, t.
=.1._,- X*,BaorE
fto"gl );
ll$ 56n6kan ck*s ohi
Droo 1165;
= (}',n)&d-ga. ger8frt C"db')},
g- ZPofl'tr$ name
_-"d " > zwPbac.o =..d t.,/' e|prog,rtg
: (.ite
: 'rl.'ol" o'thisr]t Sectvches f*,t''" dtpe-dtrubeon igl dtdv€ffspln6cf1
.b0,, >
elc($D = krr6ear," sr!{€='3ioBlefo,."
tr 6.-
{brectn id =
z-ltr.anz p .. _/
o.* 4- 6gl6pletcrcrzrl'-
[9 mrntup.i- crnrs,nu crec,lrs rrulhple obetrs f(n $-n6&on
'id
'
hcl-rlng SorreBean
P.u-a. $,r&* t ) r,ffh.d csrlll
.\J
Egi zuetufi id--"db' glcrtg =-prtoBean' ScoPe= PDhfSf'c
zlvan>
cr-rtn'bule voLue rn
ouje* os r€lAest
[f rq,.estt- GilJc]rx,r kfrf's 61-nlBeon clor
u$co4oo
closs = Dt"'okan' gSPa='re4uest":
Egh /HAr' id = dD
==
zllxc'o>
rPlue ;o
L)l*sn>
arc $ onlJ i'"l Ucb €nvirdnmf'ru
NorE :- rcauost, Jtjsl0n &ops opptcalle
-]be JaVa clcrgs lo oq)ecr lgf ovrr is co-r-tcd
tnl- creale on\$ 6ne oc'\E(
attUco6 rrs
Singleton Javo c\oss' Evto thutgh gcrvct tlos ctLlotos mctttip\( odads c'rtdHcrrr
iF tlle cr.€ $<oltylg o.'ty 66a oUf* {.xtt rhtn itis net coile{ Si\glek'n rJa.rtq cb-|{,
-_ Nhen Sp'intqa,'n Scope is 3:n61eron Crr Springl3eoh ct4ss &esnor bec"re
Srr6nrur, jqva ctc6s.
tDber' ctr{
.-'fteanbe plcrred o",r! pc.yamet(yized anarn cr<fts in 5Rr'ngBean
PrDp{tties oF sprqBeo., are coo€;gure"l f- &r{'cr4ernvnl
6ga-Fe
at i5 ol:o ligh'-ueiSht 0snfcrlrrtr to Aoivole rhis Crnrctrrtr
(r)'
ouer* {r, o c\crss tho.l- irnplemerr} 6rX'5P'ftrnKxt'$ppticorrtm[c^rc"r
thus Inrcr?ace i5 SLI inrc ft.rq o? OIt.SP. Le.ns- ft..r.r'l' Be"tF^m"j [r)'
thtw cr.e 3 impcrrcnr clcsses implernenlrrS Af?u*HcrnGrr,rex-r (r).oc Cc"n
,rlrj]*g
-' b"PP_5 C.o be t(lken ob skrric o rpn-st<rri c br the ettt,t rt erbo d
in sinsre insrancco*
,l TilT'J,:i: Tft fi; *u*'o'.,n f;reg
'
Ccnntdrte/ aLnvcdrcrn
LDecon oLiva'tr
91r)h.r')Eov\ro0rfenlfr)(J,\tsrrlc6f'nn$E@nsdeue!"ed4ffrrl$Plerra8lclrrprs
gr"'n3 J"*'**o" j::'
.,li\r be 1cnfi5uted in d;Fk"c.r - t-ft8"*
q''b'; dux *unpresr.,"3
r\pric.rro" Grurext dsnlcrlnc' 4
fi't' /lnsuar. r\pprrcorroGrx^r
G'nrainarl
"hta"r'ol"']:
S*q Arr, = f "De"tcql'*'tl
[n,Appt't'n-G-"^; ct^=nso OnoPo*X*'Apf,icadon G"r*'. ("Ps );
Ooo&t
r[ rrslt-iple CcrngStr"ctl-lon f,r'e (o( Deed
NoJE'.- in &anft.txrg env"' 'lo coo'P cai
-> IP sp"og &an oQjec.rS ct.r.( Crro,.€ d bJ drota;rrea io ttrc rr:crrrnl $rAng G"nloi oer 'is
Ocli\olcd then ;y ;5 c@l0e{.1 Fre-inak n})cltloq oV q:rloXBec.n'
qs
- q" Hhot l"rc+p".re iP "proroqrd&.pe e6 sftrlr,9B€4n \6 fatseo Pqxo'derLtvcr-l'uet6
*$l.gt.tr,"
&"rc SynrgBeao elars P-ftf \
El Cor*clrrv c.6'€o.tf5 pYDlotgPe ' &^',. SpiqBec.n ctcrls cbjd at'd Sngk-tt'o
l-he
SC"pe SpnjBean clasS ohjeLt tltmc'5\ Pr€
ostc{nh\aficrn
-in6tctn h\ofic.rr Po(ess ip
oP
l ib does not ct'an9J"&"rt"
Confaioerr iS -4pe[ccmc'nG'rttxr Ccrildnel' k
onx Bean' n p,^.,-o.N.*., firu.hp.,roo ue
are ccnP',6u"ed in Sgnn$ccnftgcrrc'tl*
g dttpving E€ano
obetfS v'jhen ;"ey
ir ftrtvatl
Cre'atlng
enoble Pre-.icotarr*tcrfttrn (qW-
only on &tr sptingBea0t' \ scr4e ana tctLe othea
6-6eana
^.. *.5t-r-.'
*ffir3.;"l|':^::***
^,
** r'rDtuqpe
s'"rf, $d,".*'e@
'
E,\*pps
F-----+ SFng
BeSS
t--------------
DbO p",arron'jav< J' clcru
an C5on-f .;am|'clau
Jdbcc{pllcatkh c-U bc&lefT€S{ . j c,-V a
Corrta.;n, JZ bc&i"vn,
,*r;; e';; L,r l, u"^"1*.,*
rtr;:#:',#TDekr".ir' P'bP/4trq
aolor I rora
cetkrrnvcrt,e:
g*;fiF;grc
rrake 5p'icgcnPiS*rcrrl* Bre eP'rFA g"ihns
-r
->T0
ptr.'cebodc's sgec't5ln3
the keXs 4 rl"e P'Dtrr/ttc5 [ire (tire
cr)e pkr(e ffi*)
pr'rctnl&r
T0 recrxrrze l,ltse placthol.lers ond to nnke corrlc'i'rr''r gar{*''ioi r'vr-trtes '''2
SPrring o4)Pt;catton
C{lty'r',
as tg I olleale
Dgorxrdfidn "iavc'. ------+ Sorne
D0OErano'n &co'irava ------+ Savne
cra t4
raFeS &r(lrsr- OC'r tO YtCo? tu ?C
/ Pgor,,or,- eli'nJ''iava
iropo/t "sf' conxxt' gqrpart' Xi
org
S'o' P( " Ernp aalarg i,r " tbohi' ft"r'$a^g (r'{qq ))''
S'o'p t" Lrnp Netnneis" tbohi' fu.5frlame [14q1))''
Gllrt';')
3 i/*t, />iavac x'Ja'q
i> *lava DBoPcrc4rsrcllu\f,
b JDbc apPlrafioo :
/Jug.g"t *lcrt 'Javc'
orr'ax*'
iro;xrn .ic.Va' Sqt ' * ) -= +r"r
irrrP"lt.lava'utit' *)
imfslt jata, io' l( i --r'!r{'c'lo
{
//lotote Irrue*ics 8Le
pre.Inyrr6rreom [""D@c;ts'
pre'Inyrr6rreom fno1,u,rn-eb^ )t
f"D@";6' [t/Dfc/h€-b J'
Fr.I"g"@* Bs.nem
Ss.nem
cla''s Obi
frte to iova'uttt'ftope"rtt<6
/lma the Conrql og pYDf/hYl
ProPtrrric's =nera Ptofrrfl'J t ))
P
p"road(fts);
try
Eq:.
- Cn , hi -IN etL '' "
en-Us , pr -FR , PI
cANADA '-)
A-g'.nan cts it6 sPeak ;o
is m*dog k* err'b'iling .J
d;Pfu'""* lcco'lee
moring oa'f o{pliceHoo cocxh}ng &'
(ot o€ed }o -tctke oatre og-
th" Pfs(ftfio"t '-''
iltn on rbe opptrcc.l.{on, Fo( *,i5
and e'Fc" " J
Lwev'rprr',bc,tfznrmm, ftrcP-wpts, Cu'rrerrX'{mbol5
l6be)5,
"^t' 'locoles 5ve,;hc P-Pis8 'J
cr rreeA mctnlr\-
--r To enabte ittn
on drl o?Pllco}lcnts
n ,,Pno l"bf-c) $re is &-J v
gre*n*rrHsn
gdittl togef : taDlA
hB can use ffitc hon6loftn^ff .rn;cole
ttE nTY*,"re v'J
in d;Fft"ent o"udH ,*
d; F€.n<,.t Enguclo' @ *
tb Zq "-l t-r":r'de
-
urvl
.*,,,^_6Je rurrrtrrs
rurrrtfrs
tbdt
$ef \-/
rP hb.r con't be tgQed using Ergrtsb cttphobers
'pntt" ct*"*o* J
10 gei Uwc'de rutbers
ard elpPued 'to fte ctpplicotlcna'
'lau6u'thndi c'nd elx"' trr- 666 use Unicodeedro/ J
YeBIonoI lar6ua-ner livg
K\t
t)
Fle ' v
5r?-6'.- cofx aHm +bindi twtdsrb Norcpad
. \-./
P1 -txb yt6 trdcode'
T- - ..^-,.-
llolE:- Nh;te stdn$ thrs &,o nh*.efr..nodl.€
f;rc chd \_-/
l??t'z't
11t,
:'1
,l,ttt1
",| ..-l
ilg
St p+'; USe r$i\Eeosdi 16-0 I f0 get Uritde nr.mkz&
iBrr,r'r*'try1)3-OveRc6cii _er€Odio$ o,. Lx t Pa-t tx
T-*nt 11i< gtrrr c"rcd unlcole rrrrnb
hr;rt to r6e1 {13 p
9Ur cao rrnre ftpUcorto.oCorurcxt Conkdney oodg f* rrpLe iten bg Crn Ftguri nX
E:\Af?6
l---_SPtlQg
f---"--'- tT:-----.&p.progn;q
[br"se Bte )
AfP- Pr- cA' ;ruPnes
Af,p- Ae-oe' Prryxda
[PP.- hl -IN ' WDfrsYn'lc{
ftmoCft,rml
kmdtient'iotVc'
/ APp. p'op"te s [&:en re )
Srrr = del€-tC
SFTa : Scrve
th3=669
tlr4 -- 6ai641
ll NP - h-ce " Tolotnu ( F""cr"')
SHl- = EFFACER
Sftt = SAUF
St13 = ARBET
Sh+ = ANNULER
+ crl\ pro1arfiea Sre must ccrnt-cno Sorne |.<gs horriry d;Pftrftnr Vo'l-ere6
<1.-- ErooCPg'rrDl-->
(beaob>
3t{?o6t-' l2es*.."&*t" -
",r**ogSrrce "
/.Wo;r' \d= .'U
cl&sg ='or3'5P' Ccillext' f*rort&.*";
L' Pi xed kantd
LPtqtu{t1J rnrDe --'b'semrre6" >
J
.Lli6l>
\J
z\aloe? APP elrn\ue z
hPP- de- DE
r-lvdcre> \-i
Avqlue>
/\a!re> *PP- Pt - CA zlVoluez ,,J
4lisr' \-/'
u) P^oF'rfg' .J
-rlbectn t
\)
zltaors>
- \---l
/lDernocllcnJ'iovq
su{9cxT " *i ,J
iccrprvr ort' 5P ' c6nlt
^b' .J
irqpffi Jova' uli l' X;
irnfr3nt javax - Sjiog' *i
irnfurr "lava
- aot' x;
Publlc clcrss $-rn6Crrru [
P sv rn f3nngll a$s)thrDLos Eranrrrn {
(0(fts .
t
Ulql(BJr
//Loc"le ouje*
langtrctr f
f ---J-:- -
rtlo lo,ote [orgs[o], or3sli J'
J
Lo"t. {=
Apuc"ri"o oonrert c$lr-.Jy/,i r^ J
/i Annn"r"
elx = her'r) ClatsPorhX'"rAppticcttrooGnre-tqW**"7
Cussh*X'nrA6'Uortt"rG*tx+
//g+ lltgs h..,r r-r{*ias Brtca'*'cu'"r[raro"k \',
S*"3 116g1
not w'
-
- ^x-gallersale("sttc, t{'n,4pu-rr$1'',*^4i.
**-l?:*
S*"j msgz = *r'gerflrscrgelsrna', t*r,*ffi:rftuti :].' -
gaMessagq(Sta", null, "dek$
F"g
st"tq
mS03 =Cn.
msg+ - c*t"
^35'fl1*".ou*
xoMerr.5't+3*i.f,k^rdtF" ms6rr') r))
// D*.top Srctng Farrre
z) ;
JBulkrn 62 = rgro fBurknn [rosg
[Bu-rfun b6 : n€r, JBuilo''' Crnsg6);
(rtsg+) ;
JBu"ttuo
[4 = Dcto Jl]if(I.,
jf,- Pl* C );
iF'shococ:j
$ //mc"n
3)lu"''r
...>Ctx"qct&ar)t.)givessPrx^€Beac,Cr&ssohje0tSirniue{xctr"getflctsc€e(-'-,-,)31.,€
4 lhe Wwa rtc3 Bre besed c't
rhe gruan ket'
Vdxre
r d,r,
Can gOcl ComFc.re &aoFaUzry Ccoiaine"{ crnd Appticr*t ctn Cc'r*e Ccrr*cct .
' "
spnog
pre-iosnrn$&tton g+ $eana ,\o )es
\llt,"aUg
.,. N0 )(s
*WtiotronEwru
No ) eS
4,ro*r1". 8ean fun P"ra,o.'{ re6+ht..Hc,"r
redst'oxan N0 1 e8
4rrmnaiic EoonF.cn',jPxtPrucersc'l
Corrt<t'oor \5 t+r'ttea
0r
\qic,gtpYre-,r,EY&trlspise-discc.$ea*!o**..oA.unt*.T0FrP.,,.Dttuspw.tth"dr5
Conrc"t
' vlhen tte $pU*f-*
tuX q1ed E\tflrlistcr'Cx6 rhis APr,\icartoEr,t'*'
\-l be raig,. .Je
@nhr.nale
*wpucarrox]b'ent
cdi
crncc'nhoP -
Stcpwd the tDe 64$ rohce tl^r
fnrtu: Prot'*
4WUatrlc'nj-'*rer' mccle'
Crre Cc."\ c,-se is *rre in 'f..on)n*
fne AfplfcoffcroCo*e"tGnrco-'ne'v
trrC ftc'r
Exarople A0PlicaHoD"-
lsr alpn w"dt' ('sesl) on$' se' coYrrxi' ht'Y*!
sia-f,".- Keep imelcrrnxlnj
c\c'rs
L\$eoo
*,.f;t- Wi"€10? sPrrct'ffi
/ llgl;srrnet"'lav a
imfr't org . SP " &tdext ' '(
i
irnfrnt iav& uh I l
'X
R.Lb\i c ctls6 llgLisrcd{ irop]errr.*s r!,p l; corr o.,Lisrcne,f
'- 0
1
tl: nt o')
[1' . ;'' #*r..:l' - t"t'* ('h'errcr*r"r'Ert
hrc'
sp"n{€cfu
the ot$re Lisrartr clc!45 io
' 6,.pg- cooggu'e
4'-' f)etrnCtA'nml--7
z'trrttPi "-'z
LU:ao|7 " r1$Ll'rcre{",l Z
Cortdrx
- 6k?fl; A4,l..le *pprlcc'ncmGnXxf
' -+ gprrogBan cot, l^lau. trm crrv-de6rrd merbals qo Ukcgde rrerbode.
O inrt liftcXcre nt-rtrct
i Gotcrrrxrr execure fid5 rre$ocl r;5hr oPxl Eecn lnotrtnJn'aHctn aod kgrdeng inie
-+ ThiS mertnd is urefur lo c\ecr ororbe{ ryeorn D?gtthea cfll_ asalgned ton*> J
voll€d vatue$ o. not. Tb i5 ols0 qjeRx to checl coeorhe'{ wnrd'tarl
J
bean ptopo'rrre6 ar< Asai6oed Dlrb VoJues ct6 not ,J
@ a.sr.og?il liPeqcte rra't^)od
6pdo38ea"o*oy
-z Qqlciofa execuns *L}s rrerbod otco it i5 a-bdl} to desr'og ocrr
+ prop'*tes c'od tel ease Dnn -Jo'a
Th,is merbd is a:cfur to r,allih beon
<;dbc caat elal )
Ye,lcurce6 cjlsbs61&tad u:irb Spngbeans (urte cltxin'tr
rnr.r,st be sPecified io Spr;rX&an d"do$ conR6o''cin
-These cgde nerho€l
too )i9e
de*rro5-rrerhod arh;buru
u( zbeon> la1. .J
Sf i"$ cPt $ re crsin g ioit - rrettro d , Dr.ftttF--
'
vi^rrd(--)
'/!l{t$dljf4
'qAtutd.\ y )
S'll'"r' *arY
Exorople nPPqg*tg-:-
Pr.,---+
v a4:"(a'J* J
/ *rrro'Java'
c
pudl inrrkce Dero0
/DeqroDeao'java Derno
mPleornrs
RrDi c ctoas DermBean
i
t 1trt.o" trD?'{to..
r.l33
povole Sr"ng
ir* oge
P"uot"
Sertt^a ( gefeae
]
.irnPler-oenJcrH c^n
/lB r.r$oA
sag l-let to t )
St'rina
Pf,U.
rcr{/{ n
,,rrr5g"= "+msg t'o'ge =t+aBe;
<l-r spnogch'xml-- 7
, --']*psr'g;
.',
s
s
II.DACIIPL " dgwa5 -rro-rnt(r
Lknn
^;;" -
clcrss= FrooBean
" init -rnef{iod ="mgJnlt
ifl="db"
fvtYne
$lue="&'lz
4/'J'Jtrl ='aW
{o[ue fello" / z
!, /-Wp4tttl nome ='msg-
="
.* tlrran
Abeaos>
),'
lzrlb;re Cooftguriog pre-deFned, ftrrrd po*S 8.rpp)ied iata clc.sseS &s sft"r€E€2n5
__
ax
tho oo[ f?rink o-ba* Can$gurin6 Ce]talDvts%ocIs
"*.rft.ces ft Contcnn6 oDlg &YJng fcqptied ilc'v4qa-Jt€J
Crrstuyn-liPeqcle "yr$ocLs'
,) &*tcl Inig*tcrn
U) Grrsrnrittl Jqjeotcn
3) lnrctk ce Jrueucr"
Jorcr&ce Sojeuicm '
Xx*A,mre ;6,P1ftccs tlr can 8o &rr
PYDqrrneS
n*"** -ta'&sx A
e#xibt&'w
xOIEl- 1y6rg1-, Zr*uft.re Qec-tloo uie ccm
irlfc-t Undertagiog carilftJir*ta t-D
uge @old'.^o* *o ktrot'l ab<* d+fr Vatr\L
ftnoggean ond coe can rheee
d,.gtt*-u7fue4 a
-- useftrr forrbdjftJ EaoT P'pr'xdq opv'
(O*t-Lff'*"'*
(1) por;. obdr.i ;rrurP**rA?otrdrroliz"orc'D
'r"--- ' d-o{'
ffJLtl..'loafr('
';ov n/:t'lvd'
^A(&RS a?w
---t ccrstorn
E,rElornpleolPllca$anan&anPcgtRocos<,/,.*"-.*-nka*ts'|Plrrnl-vuk<rrU
h.acr,t $v€n
on oi"loalrota
acdoroolicao3'"t%-tt^t. "l--*'t*tt
-:7 AppticcrlicrrrConrext'oolcdrE F;a
ctnfig*'L^ i'r giag&fi8urcrtton '
to 6^k!lYtc,t'
SprogBeanLlPecgcle DiaSrctrcr N'r' BconFecto'U
b{
Hx
<-- -t-
trF
3
,-----..--{ \
q
F
o
a
;F
g
d
c./
l.\
ig=l lE
lAEl le *l
Fl E-
I glt
r-;----1 lETl L, .! tF Xt
5
lF ?1 l.l rO I /11
gl ih$\ I F -ai
l?fl lA ^Fl
s--'
rb
IE
I C Jl I tr dl Izsl ree-61
EdE
vd9 R
l?B\
'---+ ;
I r-'l
lsEj .(
a^. F
C c-c
j
d '.--,
ts
F
g\
IIl-. t^lFl El
I
t l^ h' 16
,{3 L_l <.v
A
?l 9-'F .tr- Fj
5
a
a r
i..-.
3l2DO13 9:21 AM
'l Spring App on Interface lnjection and Bean posl proccessor lmpl
2
3 _Demo.java_*___
4 public interface Demo {
5 public String sayHelloo;
6 ]
7 ------.-------DemoBean.java--.----
8 import org.springframework.beans.BeansException;
import org.springframework.beans,factory.BeanFactory;
10 import org.springframework.beans.faclory.BeanFactoryAware.
11 impon org.springframework.beans.factory.BeanNameAware;
12 import org.springframework.contextApplicationContext;
13 import org.spdngframework.context.ApplicationContextAware;
14
15 public class DemoBean implements Demo,BeanNameAware.BeanFactoryAware,ApplicatjonContextAware
16
17
t //sp."iat Bean properties tn*rat,* fu ffi-"', e";'l'ffi
'18 private String bname;
private BeanFactory factory;
19
20 private ApplicationContext ctx; -
2'l
22 String msg;
-23
24 //setxI(c) for setter lnjection
z5 public void setMsg(String msg) {
26 Systern.out.println(!!D€FroBean:setMsg(-)"):
27 this.msg = 659
28 )
29
30 //method of ApplicationContextAware(t)
3'1 public void setAlirjlioefctriqdffFtr(Apptieationconten dx)
32 throws BeansException { roerlodS SrlPc'rnoi
System.out.println("DemoBean:setApplicationContext(_),,): oo
34 this.ctx=ctx; \n\d +4Le lic*t
35 ]
36 //method of BeanFactoryAware(l)
public void setBeanFactory(BeanFactory factory) lhrows BeansException {
System.out. println("DemoBean:setBeanFrctoryC),') :
39 this.factory=faclory;
40 ]
41
42 //method of BeanNameAware(l)
43 pub[c void setBeanName(String name) [
44 System.out.println{"Demodean,setgeanName(-),)
this.bname=name;
46 )
47
48 public String sayHetlo0 {
49
50 System.out.println("current bean id,,+bname);
51 System.out.println("current bean is singleton?,'+ctx.issingleton(bname));
System.out.println("current beab is prototype?"+ctx.isproiotypeibnamei);
System.out.println("all beans are',);
54 String idn=st(.gglgeanDefi nitionNames0;
for(int i=0;i<id.length;++i)
56 {
System.out.println(idfrl+"....1.
58 )
59 relurn "Good morning:msg="+rn59;
60 )/method
ol
62 i//class
bJ *----DemoCfg.xml----------------. --------------"
64 <?xml version="1.0" encoding="UTF-8"?>
65 <beans
66 xmlns="http://www.sorinoframework.org/schema/beans',
67 xmlns:xsi="http:/ wvw.w3.oro/200 ,,
68 xmlns:p="http://www. sprinqframework.oro/schema/p,'
Page 1 of 2
31212013 9:27 AM
69 xsi:schemaLocation="httg://www.sDrinqframework.orq/schema/beans hfto;//www.sorinoframework.oro/schema/beans/sorino-bear
70
t'raH cm
71
'Ee!jq:ll4 {q$='My?r999!!g{/> ,'.J Beo Post ?roccssrrr ConPiS
72
73 <bean id="db" class="DemoBean" >
74
' <property name="msg" value="hello"/>
75 </bean>
76
77 <bean id="df' class='lava.util.Date"/>
78 </beans>
79 ----DemoClient.java------------------------------
80 import org.springframework.context-suppoIt.FileSystemxmlApplicationcontextj
81
82 public class Democlient {
Page 2 of 2
a- Fcrcrorg Becm : - oalor/rora
-> fP Norrrar 6ec(n i6 ConP;6ured as De?eodepfBean fo Beon pop e'rCTen
.Notmar 96..r-, class ohjed uirl be initucd d;rec*lg h ka,o P1.?)Pcdtg
"---- l".rtog tsec.n \s a bcan lbo-t 6enerarcs rescrr}crli ohieci otLro46' aP FactvgBeat
is Dor A(
con86u'rd a3 ftpn&ntBeon tkn FectogBaao c|oss obect @il)
bt
iai€Lted ro gc^'r'6c/.f€d bg Facr<q8ectt' r.r:itt
prufrr61g lx't lhe rgutkniBecrr)
idet-rtd.
Eg:-
class ='Testgeor'' /
z
/*qfi id ="4b"
cla35 : PcnoBerto"Pz
L**cto id;''db' ' I
7
zFrB^tts rp'me ="t1" r€P--'rb"i
zl&t'n> clrrss
El pro*'ag o? kmoBeon
+htn lbe "61" lrrutu"d
iP "Iest8eap" nrrrd fi^mng!ec'n
'TestB€on" cusS Ohj'
(oirl be lqjetrtd u'ifi 61619 toilt b€
"L'' P^ru"s oP
ip "Testgean" b s Facfo!$ "*'::."
Bron rben the
b: TestBean
c\oss
lnr4Hi coirh rhe wsulhnJ obe{r $t''tn o - - ( rl
.latrr"iLia'n
' ' '
trnplerrrnr' O-'S''F ' bean6'fc'ct<l't
SprrngBao brroroes F.oorg Bcar,
ohn ib
I r€rurns *. ,*'*1"1,trr".- *t
0 g"rOhir.tc
4 rs
rerulr),5 rhe
tgPa
----- i5 si.rglercn ot rnf
@ ouObtJTvt'L') hiet*
YLsa lKrLf
o
tl earbe-r
L) reJLc6n'9
@ isSi"gtto" -t Qocxrrces oF rbe
aPPt'cafirm
t
a
Obrrf ohi;
g]l-KK
{a$h}clid{-_-+ lnso,tcod € ----+ok
-)
ttMse*c.i nff6od &L1rpcrrttaS Sert"r-x irarerflan
t
rl-UbleltuC) [-,,^,,
Fr.blc Sh"nO
.' lef,u\o "orcrrd rrrnlq --f*i
.6ni'h$rogLl"
? I S.o.p{"Obj (rou naftf '+o$,gcrClat5() /:
ekpr: p"..ot${5pac"raf ( ---------tNCro _-____r J.amjtcdj -___-r c\&ssNme: @ ]
,/-/resr Beas .3oyo
Frbic c-lars lestBcon inrplarfrr,is kchoqB€a.rx
{
puUit, O hjett gerobie$ t)
thvdas Llceavtc,rr I
"rt*@Yn neo jc.va .utir , f)rre ( )- ----l rerc.vp5 Dafrclcrrs obr c'J the tIaqlicnr
'bi
pDrfc Cta:s get0bjcr*'13pe i1 i
refarn Dr.l^c-cloJs " , sp€cigica ttr tgp. of rbe Qesclra* Obocc
3- f1
p)ci c booler, n isbirg lctc1",i l l
is Slnglcfoo
o @.n tnre )--.gpecifi<5 rtre rrstrtrcru obje.t
eope
3-
1
f/ftrnro6rmr-;ava
fllldic C\&sb DemoCUent
{
' P. u ,o Csrnngt I &*€ s )
t
l/A*'vor" sl'ioS conttinet .ffiffiy,
Cffiffi"X-rAqrlicrrhrm 1ffiu,t',ca*lor(oruq.*;
Cavrlexr crx=neu)
3r:dtotodtl f -O&.r
,uo ("pj,"u n id o? TesrBear)
= crr.6e*8n .,
-
ftFffi
the Qesc'lt rtr
g@q
t0,ro-.
u oul - pnn*ln ("o4, aoll;s\ou; ); 2.c dn iYLdat J
,
S o. -,. -,...,
n (' obi
^,- nam€ i!'
(tc!l'J ^,.*" , obj ./,
'. " + -Lr
ta l< C) ) i:
gcl rCl6$c)) f"fr9l"J -1 Pun
/i6ou B'rnerhoas -rn.,;^af^@,
*r6trnwr-
fll-i6J-- ot+
Sr,;ng resrtt = bohl" 4gtlerro OJ &/*eA* o' 5'eP5
8.0'P (" tesuti i5: '+rcvrlt);
aLEcLn >
injuled I)ak l:Xl"'i5T3:tr,
""1'r-ti:: os oba*. 9, cx^is o\,red Qc{rtthr t$"e
llkt'ns> ohi r,:itt ,rrt$ Dc*. crc.,rA5 oh-rtrr
i; $(PvEt;- Tun +€ clicni o{'Pttcdt{dh
AilhlcfrdA io DernocuenJ
f)'nFte
";cNQ -:
4
O OrB.sP .irtti . @D CrdiohjeltEctogBe c,n .
firuFruoryBeo.n
PrDr r€$5rrg kcltrvutJean arl exz" '
4 rerBeon LDE
loset cornrmnd line oS(.rocftrs rc$e cq'Plico$an
: O*nocj tcru-
---=tBurl- ffYioclcss rr'rne
Bg\*cticr cn frraierl ' irrofr/fitza orqu-rneffs : laU tt 1
-ilrda---rft]-l.-\a^ ,.
'
^t"r,r
&.in 1*, dr,r-
\)
/Ltro t-tlirin$:- u
is coged clir)Dd '
'| '? '1^-11"r'\ €eo.P'aer'kr
+ prfltnnnio$ fti,ccritndecr{ ArUe{-Foq "r'
^ .**'-,^^
\-'/
Faample oppt;ccrllto j -
k.-ce)
oug clpp o Ca*"Sl"tc
Deroo . jav cr. S&me a5 Ptati
---?
kmokon. javc. fsv.ng 0e.,n )
Test8ean . java (Pae.de'.t 8eoo)
DernoCPg' xvor (st,'iogcfu Bre)
DernoCticr,t ';ava (ctrenr o{'nt)
// Deroo "xva
6aroe crs {"nevioq'4
/ftmo&c.n' .lrrvt^
flro6
fl$\ic class Dr'ogtorr rmp'lemenr6
t
s
/i*., PrDWnl
JqtBec'rr tb;
l/o-toto* @nsnotrcr
Dean8eanC )
c
*, o,P (' D".6q"*n : e - lr.ftrn gnsw'ot<n") ;
zLJ
i // l- Potaro C$nfiuj.rrl/ Si&i + rab$0e({
arrtrshfet i
EemoBeao ( Ta,B*", rb)
{ 65.o=o:
''S o. P [ frnogs6e" 4- PararD ccsnsrnrohol ' ))
o
J
\
{rrblrc SU"g *.gHa-ro 61
t -
irgra\n tgtodan*r,]tt3 Tqhf&on'nzs $ = "+Bb;;
\5 \-/
// IeltBtr.n ic.rra
t
/&"o f"fg'nr
3i'rn5 r'ts3;
/ltrts .rsrroa &r se-tttnJ+jcrfirn
l' L
/10e.qoCPd-.\*t
2b4o.9s> /
/Uf,o$ id = fb *:,L*-="
Clcr!S-- Je\fl,sc6rt
.;;lt .til l"lto' Iz
a- zlbeqo >
the kc'oid ;cr sPdogCcnr8gurc*krn Bre roel be Utt$re ict. otho<':lse q"{qt*),gy
t.H9"
nrJjJ Ic,i\4 cumbi5urry
Oaro o:ire = "4TuPe Codeing ssnngcPg krc".-
//in ktrncfu.xrnt
Zl0ocrype - -. -. z
/.beoe5>
zbecn id-'tr " c1c65 -"-lestBEoo' 2
zfrotl,.tg ,'11ens:"msS votueJha'l-o' I 2
lll.dln=
z-btsrt clcas :' DerroBean " aitrbo@irr =''4'TUPe" / z
id =-db"
L[r'e rhe &a@oo-,a- Lb'fune TastBeaD
zllaos2 ana rfre nn"UegrUh* "br" tgpe(rcstc<oo'
.{ l0ocrgpe
*t^.-*?:l*{ \ $'ov -r'n'4r.
Zbcrra >
lWo6'2
zb€on 'ld 1'tt' et&16 =''TestBeaD" >
Zl^D[s% rrirn€ --n55" 1t''tote:*bellb" /z
4beao>
id=tb' J ut*te"+ "
z
Ltreun c1435,=- DemoBean
-_-_-@-
arr-lotoire I
zlVcoos>
grrfirtmO
^
$!rrJ to.fe setu4%<rr16n Cfhc",<-olre S1-.6Got<,fnr'r y"tunS
- Qotnllrntilrn J4rurq
:
hle ccrn Onggrre C*ftoi. l$ofrnrf.g Pzn enpbcr't Urtnng crnd Centcrln Otbr'v prrqv'n]<g"',
one F me exer'l-Lbl crn bloc.k ccri,l e d ccfn SYtucf&i tcrt) 6t Lri c b [ocr<
tben trne Sp6r€ Apr relarcd rrD; n iaY gle sboatd be cdde d l-o CLAIII;aI H oDd
6pnn{Ap1 retrfid rc4tn and dePeDdent iot Ftes sFnrrd !e crc{ded irr r,]EB-J^1F/ltb lot*',,,
jar fD H to)rl be used bg iovcr ComPt)e"r dtrr;og the (orfD'] idfi atl 0'f" .J
eie e ddded C LAsnpAr
kem"Hct ).or1t^l .
urtdeteranding probtero ro coPg #)e records o? l2e sar r3+ o$ of ,{rraXlls t 0rra Srn^ct<r6
V
7\-
<jb I ', Qfnq u,^Jl
ALa
aclcL\s
in USer Deened Jav
prob\ero KeeP ec'cb f,ecurc{ vctlLr€s
----> To &lv€ 1hr aboYe
bolur't
oG orro4Li6i cts $roon
eocb elerncot
obreLh on& add IfBr ohjeif tD
...
I be
Drftt6n&cr''Ye 61q6t
to '*re elemenrS oF Col\eu{6nFrarr€c:s6k
!9!E:- ohieLrs erdded
Ohlerrs inatder to &nd Gratricrrframerl:O&
trrY€n c.5 Senncr\iznjcle
D:rro5wuGuYe Ovfi ltre nerrl:o.tk '
Logicto coeg rte recor.lo o? Re"urt& obu tu Att$!6I
6tzrterreruC);
6tt*ctfr rr.r 6t : coo' t"r.ke
,
fiesurr Se-r J = ur' ero."r"6'utol ('e'* * Ro,. St<'ae'rr"i'
. fftrqList o'l- = n€ro ftrrc.gList(;;
-*n€r' $i2d36-Qeoot) i
5rt,a.nrBeoo 6i
C") ) I
6t . sersrr,rne [ts'gu6]ong
6r. sersoaa (rs'get6!'t"g Ca))l
ol-add c8r) j
l llroi'tte
Scrdd:hUd
,,---. Stnce, lgg' Oq;€c ot ve4wserrtlng Single big Valtre bg Corobinlng rntlilp le
/-" frrrilliplt SitoPle Vqlurs 4 YrT l$plf oUrs )
indivrduat lolueg" so, it 15 (cille d \olse Objer and its cl&ss 16 ftrjel
V 0, clcrsg
Eochr recot d cF
----"..R",iiid ftra is mcrnsPevrrg ku'n Pesert,flt t-o Arro4Lisr in
ulrclhs rce,.a
it lslue oh.ltlJ
srrtrrnS 6oe sing\t biS Thjs 6UJsf- is hcrlnsPta rbe oai"'tnxa
ftrroiJU6t Th;{s " Sb' objert iS co.t'ted Dcrra Tr<.rrsttr cUlrr* orqd \ts da*E s coUzd
DT o L\c.v\'
use co]l€c]i6nFlo Dcda SlTQctQYr 3 in 9(I'.f 1>m;eu'1.
!1[ere clicl qou
perLocn lc c{s discul secl d.bc|\r
Arr:- o To Seo - Qesurt 5et objed yeccr( d s ove'r tbe
propetries P'om PrDberries file roe need
@ rLfirre garheriog JDBc
iqva'uti i ' &oper ti es
uoe need !1"+ Dor€.SYtrt'cfilr€S
@ ro rrnrnroro JNDI profr'1ieg closs
uril ' fiop^ties
.i.o rrleiDf'uo nai \ progrties ic'vct "
@ c''"o'nr oP Dcfa
@ rr, sesstorilroct'io$ rc rnc'ok,,o ht^ge *frff'ff::.
q'-'61"1 Og tT::"t
c(Ppn5 io raratnt(err' buge
@ f,lh,t. d'eveloping S'{rniDg 6c[f 96 5ltos
-fu hrrge ctrrccfoi oP cl..c'rc' tolrb
@ mdu-Dt.dn
€) To &snstrcccf 6u&u c-tod ccdoe'
gou use Javo0ectn in gcxl1 ?tDieuS !
Nh€re did (&sctt ftr io
copgiog 116aFctS o?
c\cts6 | D'r'o trt'"s
c0blle
Aos'"- O A5 v'o
Gllecflcfn Frarnet'ct{k fLjasrrucfuYr tecf<rre
tl'uca drcld
lvc r {
Qesoc'rce tDhi le l)elelDPing bcrr ed Pnrieus
A5 t1c!cF\ \ore1
grx\og ftPPf)s
G) A5 sf$o$Bcctn in c.Pfm s
in \+be"ndle
lcfr rrcr 515.tr nJ c\t'tsS
A5 \h Pe'{
bc.ge orroanf oP
re rrn^n{cr;ning
Helpelc\oi6 in &ssicirJrc'c-t<n9' (rfUl
G)
^. cd$rib(Ire rrotue ).
DoJtt ct6 Sinqle &Saioo
lnliniProietr irrPo ".-
CrmrrDuC/dsnltq!)
Broro f<" t riodrxl qqr)
Enu;'tunwft(t"',et)
(rrxgtaton @
(yierrrq{ er ) tqt. )
s€kaDesg:
|ff,o*TJ
@
._4r.,_lrl!I_6.,l
:{rnng _ Errplogf e
^
uT<.qC DBs)@
pfogram tD jsp J
----+ Senl€r PctsSes dolz( Qesutt ' using (t+rc$t otfYla!+ts.
--- "tb€ Sptr.rgBeun cgss (modelB€qn) copt{s fhe recarrdg Resurr3eJ obial lo
NEB-INF
closse.s
llr,n8eovtcr fu /.rlr,u
f--+ *.jotLz)
/,a,.*s j
no.lq -;ouq
> l'l o&t Eeon .& \ta
Neb. x rf) l"ctax _,
)
o ErnpBcon .kvq
Pr '/,r)u^ '-J
i* f;qq l! clAss pArH / l--' EmpBcan . clr.r
,r:- l---t ho*r O16.3. -
rr rrr J
hrp: //iqarhtst tto>olPntetlwJ
morn' rtrtl v
rur lrib &rdc,r
\-/
Spnhg' js'l / commdns - logsrnq 'ic,\/ oJdbcl+'ia{
-to ese cless i., rrpwrtt*,-stbe pbrcd io rhe pocra.Se creard
Jqva lerdescrrt
-> '*r#:
S'a'r' Thar mecrns sP cao t ure rc,vc^.#"#1.#ff, nr'"'
. R" ^*-:?;il:/;:::'"
*te Sarre cocle of ohj€ &agy&rn ep<rr crlfrn @ 4 *e pc.feuo, *@
€g
tlnder6taodiog AnretalioDs :-
P^ the Xm) ftte bc"se d
AnnoruHonS Orc ic(va 6+arernea/- and *q clre ott(rnc're
;:*;il{ nffi:l::'
s'erkrr'ance
-
" *1,": glos to P$cesg Xmt
dr-tr'rnerurs'
\v
O Besoarce loef ( on c\ass/InrcrP-re
)
: nubod kr'et (^ j*c,*ahoct)
I
- EJ Ferd )euel ( oo llember vo rade
)
-
o+loaluz
Tg GnBgr-xc Sp.;ngBean crteccr) c^e the St'o-i.,3 anr,okrfionE:-
a) @Compooent
rrc.keg iovcl ctcrss os efrtng
Eaon aod 616 &btc'ale fot 21ag6(bi\
->
Pa tha*auocA inPctlon
b) @ govi"
recoroeod ed io use Rt, &o." Ia<^ 81''"'Xt*n\/
(conra'rtiog !as;6<r.s l-ogit)
c)@ Rqrsi'ttxg
fo use fiii DAo s Bne S;mng
Ecme os @lornpcoe.* bL.t vearnco/'ea Be{i-h$
F<n sprrng ?.b tased Ac.rot'.tiring *Pu alpn 0 oP rhe Saprirncnl<.ng h^&* .-
-7
g\,eo cln Or/oa/>ore
r"-r.: </beans>
' //---------___TestClient.iava_____________
Testclient.java
Testclient.iava Jo,r Bt6 :-
, Jo" ln cllssp*ft+ spiog
spnog lcr/ coynmrrt,s
coyr -,o56ln8.Jol
r.l import org.springframework.context.support.*;
importorg.springframework.context.support.*; (sPi"g z's )
: public class Testclient
i;,' t 1
public static void main(Sking[ args)
t
'u FileSystemxmlApplicationContext
FilesystemXmrAppricationcontext ch=new FilesystemxmlApplicationContexl(,DemoCfg.xml,,);
FiresystemxmrAppricationcontextc,oemocfg.xmr,,);
. Test
I esr beanobj=(f
oeanobl=(l est)cU. getBean(,'tb,');
est)cu.getBean(,'tb,');
System.out.prinfln('tesultis',+beanobj.sayHe
System.out.println('tesult
.:
1".
is',+beanobj.sayHe o0);
tjt. Illmain
y/class
Page 1 of 3
--,{rruglq.ra..)
#{''}-, sp",l"g Eair.e-*ionla,-1,urryc
3rl2013 9:46 AM
package P l:
i0
public interface Testlnter
72 { public String sayHelloQ;
73
?4
75 TestBean.iava-----
76 package pl:
import iava.util.Date;
t'8 import java.util.List;
;9 import javax.annotation.Resource;
30 imDort iavax.annotation.Resources;
imbort brg.springlramework.beans.factory.annotation.Value;
32 import org.springframework.stereotype.Componenti
import org.springiframework.stereotype.Service;
&on id
{J ai racomoonentc'tb") l-o
8$ iirttic itass rdsTB.-ean implements Testlnter
{
//Bean Prooertv
arg i;;A;;;i;--, rcRhence TUp€ $er'n pnr[€r*5
:. i import org.springframework.stereotype.*;
pi,rL5[iE-Essn-serBean
-- PaseT-i3-
3rl2013 9:46 AM
13? {
1 liB String msg="Hello World"'
.139
140 public Stdng tostringo
i41' t
.,42 return "DemoBean.msg"+msg;
143 ]
'i44 |
.l
45 ----DateFactoryBean java--------
i40 package pl;
447
i 43 import org.springftamework.beans.factory.FacloryBean;
1 4g import org.springframework.stereotype.Component; 0lfrDeH r€d Fecnlg Beon ct., \q Y€Jc{tnio t
'!5-1 @Component('dfb")
public class DateFac{oryBean implements FactoryBean *.!a.cr-ti t ' &rtE ctt6s ohjeat '
t
public Object gelobjecto throws Exception {
.I retumjgllqye4!!.qqlq} lcecrttn-t og€_rf
->
157 public Class getobjectType0 {
i i;l retum java.util.Date.class;
j$9 )
i ait public boolean issingleton0 {
131 return false:
1e:
;-- i
'tta;, I
i 65
ie6 ------------Testclientjava---------
package p'l;
1l1rhs$ usiot ong xrnr &tes Yee<,r 6{?n @ o( rrnrch ors Lnd,"cq
NOIE:-
iF Dq."'Aenca
NoEioS tolth AnnorcrrlcrrBosed D#'odecq&jer-rlon'
^n,'. .
**" tb*:
,l .--,1
.Iqle*tooS'
6tIoalzorl
r,'ie4lcro
: @r.,iu.r
------+ h ctrnBgc're exPlicib depet'dtnca
! lrc,nd{Xrl- $iucrn
c'f' otf oalrs
6?-et Paoe 1 of 4
:Inicr-rs Vatoe Gtl4cltJ kc-- db-,-,s.. ' k 1 off. popotr.'.* h't ro " Lul4me pYDP"5.
3/8/2013 9:4&A
privale @ValueC'${db.pwdl')
70 String pwd; f,re6tlnano s r I
71 @Ovenide
72 public void readDBDetails0 { ?
73 System.out.println("userName="+uname); b B
74 System.out.println("t"""*o16="+pwd); I "rrhodi-pt"t'rtu *
,
75\J
76)
77
78 <?xml version=" 1 .0 ' encoding="UTF-8"?>
79
80
81
82 xsi:schemaLocationrillBJ&d€pgShg.ofg/colg
--springcfg.xml-- http://cxf.aoache.orq/schemas/core.xsd
83
84
85
86
87
88
89
90
91 </beans>
92
93 ---_--------Setectctientjava------_
package p1:
94 import org.springframework.context.support.ClassPathxmlApplicationConlext:
95 public class Selectclient
e6{
97 public static void main(Saing0 args)
e8{
99 System.out.println('main0:Selectclient);
100 ClassPathxmlApplicationcontext ctx=new ClassPathxmlApplicationcontext("Spdngcfg.xml"):
101 Selectbobj=(Select)ctx.getBean('sb");
102 bobi.readDBDetailso;
103 i
104 ]
105 ------------
106 App3 (custom init-meihod and custom-destroy methods cfg)
107 --------------Demo.java-----------
'108 package p'l;
109 public interface Demo
11o {
11 1 public String sayHello0;
112 ]
1.13 __________DemoBean.iava__________
114 package p1;
1 1 5 import javax.annotation.Postconstruct;
116 import javax.annotation.PreDestroy;
1 17 import org.springframework.beans.factory.annotation.Value:
1 18 import org.springframework.stereotype.Component;
119
ii6 Pcornpon"n("C$;- B*dd
121 public class DenibBean implements Demo {
122 @Value('satya")
123 String msg;
124
125 @Value("1o")
126 int age;
127 DemoBean0
128 {
*t.orintln("DemoBean0:constructoc');
,\oit t)
cntJho<.\
133 ,tto". cct'sto'n
131 peo"rcon"t,ro -' **J**gfnrtl) n(d as
133 public void mylnitO
134 {
135 System.out-println("lnit-Method")i
136 if(age<ox
Page 2 oI 4
137 age=18;
138 System.out.println(Age cannot be -ve,it is set to 18");
r39 )
merhod os cssitn
-dert'Db()
lli
'42 '""."*r*,
--> rr"aKe fte'SDestost)
public void myDestroy0
43 t
44 System.out.println("Destroy-method");
45 age=0;
46
47
l
48 public String sayHello0 {
49 retum "Hello :" + msg+"\n Your Age :"+age;
50 )
51
52 )
53
54
----------Democfg.xml---------
<beans xmlns="http://www.sprinqframework.orq/schema/beans"
155 hF 61n avoid ttu6, xrnl Ble
t56 tt'HcT rG*t"t
t57 bl *ln t Aroo<,uon Gnfrt; Apli
t58
t59 co{r.,n<,God 8l'€tr$lj)''"*'o
160
161
("tu *,,o r\{ /"dilf l*"ar")
162 </beans>
163 --------DemoClient.java---------
't64 package p'l;
165 import org.springframework.context.support.ClassPathxmlApplicationContext;
166 public class Democlient {
public static void main(String s[) throws Exception t
168 ClassPathxmlApplicationContext ctx=new ClassPathxmlApplicationContext('Democfg.xml");
'169 // ask spring container to give springbean class ob.iect
170 Demo dl = (Demo) ctx.getBean("db");
171 // calls B.method of SpringBean class
172 String result = dl.sayHello0;
173 System.out.println(result);
174
175 clx.close0;
176 l
177
17_8
)
*t htv&4
n3 Drc ctals ohj 6t"*
't79 AoD4 {on Faclorv Bean ) / Ys{'rtsocHo5
180 -:-:---' &an 6<rrercr,ti
181 ---te$qeeljeyeqFir<ll
package p1;
182 impori iava.text.SimpleDateFormat;
183 import java.util.Date;
184 import org.spdngframework.beans.factory.FactoryBean;
185 import org.springframework.beans.faclory.annotation.Value;
186 import org.springframework.context.annotation.Scope;
187 import org.springframework.stereotype-Component;
188 (reoF a
qFa", obi rdir bt
189
190 ff:H?q?:l[l*f,?** * -'q*d
191 p-ubtic bislTesiBFan
mplemqnts Factory
i Bea n
192 {
11U2O12") nn.d;R'Y'J
L,
193 @Value("z1
194 private String dt:
Page 4 ol 4
Modu\e -a ,l
oq/03/20'c
DAO nodu\e -
T!!L-
rl'err ces coe kee+ drero
€Pzrco
To Provide Sloba\ viSibilirg lo iova ohrer*6 ctrrl
-, &N\F{ $ives orr rtg;or5 a)o'
in Yegi6tY$ SltD' f.ver3 crr-b 8e'6ve'{ / aeorlc'eulon
Soqal obj ,4
&gq2.
-->
-----+ objl
obi1
-----:
--", lloint&io5 in{b as - vatue p^irs crod Val(les Cah enytq prcVn,'s
keX
f
&iHbcrl€
---+ &r€ Coo u,se eirher kaf 5 31 P.xha Prop,i'; eJ to g+ tbe Valueg
Neblogl c
&nnmefelcd slLo
ro'b (corryzrfiole oirh jcrr r'et)
lersicrn r , ^ aryucel*lct
dcnnaln octs ds oDe ^^^7:?.. Sexuen
Orocle\nlcblogl
c- t 6oicSbfic''rl-
6rcP-a".- 5kx\ ----------'t ffitrem5---------->
llgDorodna
prqtrorn6 ---------+ orooeNcbloStc----------+ useaPT4iefS -*-+
qdroin Senrc-'r &tr r^r-btoglc
USern6rne : 6rvab6 S
t\5t $arbennS
611 [lndrogs fu* ,tlshl (nicr'nc'mes' oO;s )
Telcrnd
-l
.!)
slt^l
> Namin q ,Rgirt?
Itanc,gci
1
Namtng llc,rn.ge 'iS
rhe b*dge Olo Jcl,a apno ctn d (9tnu slru .
Toitic^f Grnfe*t Ohj rePr€serfs c{ronetrvit(i b[tl, jova olpn ond r<6tstry riLr:
(o--ouir) (urta;'g;
Ccu'rrut )
(u--"*iz; i
(c---,our)J
Ccunte*)
9--*o
Yliclc&rrr cor) s)dl oalne
// JndiConnlesi.javc.
etse
is ");
S'o'? C Cotn.rr*-, est-zoushed
!lt"*"
ffr"- rnradeoare \I "-'-
r,tty,ruE^r-to,r\se'ruor\tiu\nrlto3''t-'
liaao tleblogic . jar ( er^r.,utooir -home I io qcds Par(
&,rcrx . rn-i og . ln;ric,rCoruenr ctas6 qives rbe 4lro.rirrg rrEiio4 ft: e,r{<nn .ind,' Oparo.tto5
btna (-, -;
unlind (-;
asbind (-r-)
list t- ) ulaalwt3 jnotf€r r3
looP''d-) yelaltd tD dS Et-d&4-|,C
iqr.
f'ftP Dofa6lt'adcrtY€
,_-/
biod;ogr
bodioga
Lindiot3
/t's"
3
3 iiu*
oP {hteno's @r@
$6s6fisb
-t *, lotoaHoo &'vor slLa
erre++demaan
rn#€roelo-e
Jndtbvacoin3 .#
Odmin Coosote ---1 AgonraflonSttLrur --------i-
c\&ss n&roo :
lincUConfc"t[crUu'X LWrtt oo>
prurtdcx ur) i iioP://zbcst>:
e$:- iioP;fJ tocotnosr ' +6+6
dePaurt (dePc,-rt )
hJeb
6l-ardar d
0.ll
minimGl
aPPServ - ert'ja"t
imq,jms'va'jav
,lrr Bret re+rired in cl&i,6pcrL ttl in*cracf c'oith UB0s6 r€ftshu:
jnp-cticr*, jc.r
itoss - logging - EPi'ia1
S;r"pDPe rbe
plolr, ,Todi ao
d
Ttrr6 Jndilkmplorc closs
inf'rrrctl{ USes
--- elto'
6n I23"t'X
f,ndi opr'rofion6
pyDcrJs
"? P"ft"-t%
Pkrin inai ryo6tommio$
PrePore Jndl PtoPrtlcl
-) oQj
-t C{€ol€ Jni nor Gmtcr"t
jndi oPuroHon S
--o p.nRnrn
[xcqHoo lbnd\ing
-> tttvecotto?
u q* JndtTernpbre class oU
b3 .Tr,d;E
nPtre ''La
6'
&feacare
orp'ra*ons .,r.
L€
CalrBc'ct< lnutcrPoces
t0 irnplaroent lhc'l
Gn use &r'ng &4Plied
-Teabnolql APa'
OProtlon b5 usiog plcun
_ in irnplerne-rrrorldn
cla!5
---) fte inErPace t*rose rreAods irnplemearei
is cal-led Glgs-o2
adred bt un&victroX c6'nidrr^ o*nvnttc."t\
inrer P'ce'
Fxcrmp le SCenOrlO : -
doas pmvide 'nerbode 'r0
Tbe Spog[ndl su4ptie d J''arlemp\orc cl3ss
as)n$ JtaiGltb"'L
Thi's caobe ochdurd {
l]e,Rnrn tist opcrcrtlon cm veEi'I'A ' co-n
n{'ftod ' ln *us ,rrir'atnx
intcrk.ce. JndiGrrhrl. (r) gives dolnconrext t-)
t{rrit€ pfurrrr jndi Code 1-6 frr?.otn lbt
ofrro]lcm'
trd,CoLtbacr' J:rtcr8c'ce
to'ok*t
O Excrmple A1p1ica'Bcn 6n ioF"eax-rn
\)
the \tat olxrc"tlo'n 4-rncnt.no-l;rg '
r;\nws
*-, spno?
? Af,Pr
Oemocfu . r.n t
{ *r'Kmplarre = ttsn]'re)
&
oI' \
aro.g tlr"*a, Etccp{ort
'--
lernp)ofe. er(e&rr€ (ne@ JoarG,rboo<L) {
eLP'f dor,,Gnre FCG+er-a! *3t .*:] 1Ez'c+
rt
"n
ve6 Tni tial Gn+e" t
oUj
P!b\'ic
lq;' 6',
= cirliBt-C' );
''
Mmir5 Erwnr:wnc,t rE.
3 //ul'ite -
TeKr{ D gu\l ]
3 /l dor"O*c.r(-)
' exeau'rt t ) rrrtt'ocf is Coue
J /llntet
ctoss @ rcroplare
ihD€/i
) bg Lee-pin3 Ohfri o? &nonourtfus
) ;l exec"ie C- r'''{<"e'
CIct69 irnple-rncn$n X CnarOub"u
$ /lt"r.;n ct6ss is deP+ni''1
-lbiS Arono&rooki innet
3 fl.rots
dolnC-onrext (- ) merbo.l fer)i"3 ltt b
P"P-q Lut oP'tc'tt on '
ll> ,1avac * 'ieva
r lava krocCticn-l- *rte io ruooirg rnole '
/l ger.ud \s
llrrrire gr't thcr't
hlz-btogic
ro''crhod
dcsor csnrcnD croS
fn St iog trnvi{crqrocnJ- iP eae a sr.rqg
T to acterve
coe use Spnng Jndr Cou bcdi|- Inrcrf<'ce
"rnrurdit tlt-n
thtrt .nethocl
1e fti% Appt;ronon Loe CaD use' 5 rgpee oP Jdbc coo XloIS
w$app-n'
pol cLtiuz4dlc/n vePr'r Fe'u
0 fo1 acrmp)e lppsf'atqb Baitt-in Q'n
cnrnrrsos'dbcp '
hgc}tra.fu'nce
closs oafr€: orB' O{aahe '
clctK
imfortcnt PtDfdtl{} clfl. Bosrcht''Scrtnce
dwaC\r'ssNc'*e
initiatSize
d
P.ssdor
Ltt \
use{rEm€
framgle o{P\icaHon
r:\ App5
h----_') sP"Dg
''t*L
Apo*eDBCPAfe
iava -*" ? -
DBffr,ranon '
- |--- Deor^orpnBeon'ia'ra I.*1r''|;.*"
'Jtua J
_
\ - DBoraaarznckufl*
I r SPnngcP6 'xrn \
6prio6C&6 . xrnt
zl DocTlPL:
zvxt)6> >
^*")*; d{ncf€.
o,r,,arnrlc. (brnrrdns. dwp, fus;.fut.$ttott4
;6=.,dbcp,, cl&ss =-',org.
atire,r,O,ouaD,i_,
zpljffr\
"
rrtrne = dri verCl&!9 Mrr€' \blue ="Orcde'idbc'
zprrlrxrnrrtrrf=''url'Value=&bc:ora"le:rho;@taorho51:l$>ir{rrcl
zpmYfrb ftrrnd = t{sornerrE" \hlcre ="&ott'/z
)>
4nf tU mroe = WssouA" vrlrre='l;gw"
injticr-rSze- \lalttz.'^ lz
L{rtory]5 6"
F)G.ro€ ='
zllrcn>
ziao id ="dob' O4ab = DBgperaltcrn Bcctt' z
zIJnpW rsnne = 'd$ " re P='dkP' / z
z_lt3,.aoz
/-l&c'oE>
iroPorent FDFrrtlq
{xsstDord
[J,5e1
[nioPo16;ze
ffux?mt6ize
iduc Ur t
&iver C\oss
Pxarnple cfplic&lloD : -
.
"Cot'rochange ' Ve' c6PO' Comuoblezlhradrcrce
\2
'J
L@o6, ,, Gmboftnrea fuaofat''<te" 2
\lE:' r-or-(r
-^-r..,nap.13,
"ctrn'rncFon€e' c6?o. -
Ad3.l\ id ='db(P' cl&s6: c\. - 'r, '-)
\frlue Out'cJe'idbc' drivcr' O<rrel]'\'ev /> J
zp.Dqtr1;5 Doroe='6;q6Class" ="
{"': )5>):ool>
@ lDccrlbo6}--
z,xqvrrb rxlrnc=''.1auctkr" \alugz" 6dbc', orooe;
zlwoo>
Eratt\ >
zlxan iC--" &b" clasS =" DBopzTctHc'n
\J
ttrrrd t-*t lvlcrnoned Oolne;rrlon?oo'l ' ftpocle Bcf \."?, anA alt- -
thcn
tr Sfyrrnt prrberi is lep\o6eecble ucbatpticallon
LLsE
hteb 6e{u<J.{
Jo8.Dara8o(]rte Ohu
!@ @'
99o
€ofigo futa $rlrtc O$
->
(on'a io,re (
aizl+l s orivw
4wf
U6in9 JDoc ConrEcfid''o lli)l Ne Can rrrru.€ rnlre Ctjef* c,pplicc*tcn- in tcrc.artog coi*r
Dfi 6\rt b9 usiog minirnkrn no.4 JDBc ccm ohj)6.
ocIeflfcrppliccL"Ho.ncajls6a5r1'c\oseL)rreilnocltorelec'seUD8cc6onesil.J.n
Chf* bc.dc ro Conne*tcrn Pool '
rogdornc,'nl terw
$ol ?L,{ O'iGc-le
Cteorc JDBC GenneaFcrr)
@ Ptocedt.'" to
cf hkutq ic"
'rr5 le '
erdrnioCctt'so
and OFn
A:L Statt ro6dr"'c"nr tsr\'o(
$Kp4r"-
kua6atv<es )
Qdroir' Ctnso\e &'(eo ----> Sefldces JDEc----------+
Dc,rufo..'ce oqf!'t
.fft" Q"6''rl slto aod to inp* rhor objer ro out
hancic,ss prqx,.Ird,
Serr'tx rrrLnc'Xe<l
to (ase the above i"r-tlogic
Excrmple sP.q$ o?Pllca$oo
- Pool
- JD0c Gnnernon rnocle'
oP hybl%\t in;nn)ng
Setut'T
yli KeeB rogdorr^crnr
rbe lirrroln? rn'c'i;Bcafi"'s
in
ZlDmtgpe--->
4btsos 7 fu""U8-" $ =
" jo?b" s9' jrrdi'
ors'ot' "':-
furObjett
c\&iS?
61165'o0rg'
Lb/C.ie i6 =
*trndrN^*e' u"t"="!fl9,i:"
/pyooertS r.arne --
Zptry,,q "inoiEnv; ronroert-f " >
n61roe =
Jndi
4tm{>5>
PY1rfsft14 to
p565rish rhe laq 1ee6 - java. nc^rnin3 . fu*"U , inirlcd ) klbhtic.indi.
tnJ Llnrsd Cc'r*e" t[.c.ny 4t*p z "
Connea$ctrr Loi rh
I2eS's\.
ZJ)YDP keg =' ,javrrr{mi'q, DyDuJdonc,rrt > h6://loco.thos,r i zli 1.-
z-LwP6> tlwP, ".'
zlpto[rn1z
lk.o,o>
>
Lvan *& JaoS' 6ns5 ="DB0put..Ft''nBer.n''
uds' yap
Lpwn,o\ eCtnoe = -",jolb' l>
zlVao> T-
Jruetn JDBc a,63crxce OQ.1er.r
l:llrrcc'r>t>
&om Ond;veX;s\ husins .._.,
Q<rrhe..ed
JMtOup*facnrXBean. ihs Ksulknf ohrecr
trill be lrueu-(d
3x?-al- R.rn $e cLicar apPlicotlcm
7 .lava DBOtorafio$f ticntr
.,."..
a6cdnnltl Sictt-dc'r'trln
5ra"4;- Skdr rngdornCunt rn*ir.'.__-r,
Gtade"
JDBC &tnneexoobot
sHP-a;- cfeclte
JDBc
- > jntut:n @16
S6-ctco Qemcrrtrs -=--
Qd'tni9car60\e -=--' TescLM,e rU pe Ijcvctr,sy' Drfasd. Y{e '
{rKrU
ftr 11
---j
Wft\o{e 1 Lryu--J -----------JnekF Iyinaeand rnin[tnl.et:-e [.-+ l.---
poo| rcstzc $urirLHrg I [ .-:
----,-., -_l ._J @{Aae
fDr,rirruYh plSizt l- $-_l
--a V Cf,Lr&Ba!€ r)6(m € Orc I
E Dti<ryruPc *rin
' f&sst'lo'a ti$cr
@
'p f)rltNttrnbct l5>\
B .fenwName to(a-(bosf
l0c4J ho I F
E Se'tuicrNarne
tocorho tt 3 l5>l eorcl
uct- ,.tdbc: oraale ; ft-io', @
@
E** SCcf-t
to u.se
RePu eppe crn mo0fg Sprrogcfu-xo\
lqlozlrorA
cntcrsSEsh $t\Krt mcocJed Caqn&$crn pool in q^r^nt
---rl.!
CyPFn
'.thdt &.e<
ff
spng,ior, comrnons -loggln6.jaY
6 --+ Olcrs6 Fsb oft.\ iar ft te rPw ra'.<btS
SpntgDno (c,,so cc.tr€d c.s Sptrog mAc) t 5 lo ol"o r:
l5r<roc€ logic P"t- O*er lq;cs 4 the alpt;ad{c,',
the. &va ctas 5 fu,r se{r-r(-l'1c| Pe(s
ard rrr res *)af lo€ic5 Ci6 'reusobfe 1ogic5 is caued DAO
t'6q1.!-{-tQ-
--+ 0AO P6igo partcrD is oo tr'rL5 re'tared co:r$ GptloSDAo
abstrc.ortcro lctg
o"l \)
--'> epdngDAo rnodule 6iw,5 oDBcTemplore ct&s6 l-a provlcle
the wrrs & dedoplnSr
dn PUn JDBC frrograrnlry lha.r rnec.a| E;tnpllRu*
--> to Cr(nK JdbcTemplote crosi ohj fih: Dorc,f6c.r ce ohj is &6-,-d.."r o6; '
lueqfulnr (Stn3
m) t Nhen gte*yo-,.g reic,rn r'rn.^Ac vc.t.q
W\WI"o.t (sm"3 ot) JET:- senr cwnt(x) P..", stz,<tcn*.
E:\ APP6
D8OPerdfioo'i4va
D6OpednHcroBrco ' javo
D00peroficrnCfg' xrn\
D8O g,rortcm C ti tn+'Ja'v a
PoP"t us,ng third pc'rg iduc ccm finl tiKe APacfre DecP' \i
DB iab)e inofc.d e
5r&dcoI (+ )
u9to rt^robex
I '_-)Srnrne larclnra (ro)
+__
F saad Va{cho{a C2o)
/l DbOf."an- -ic.vc\-.
iava' (lj'i I ' 'lr /
irnfrott
'p,ff,ia -invtfF \,
D6oftttc'ttc"
"t oaa);
no,8t'tng mme, 6h'lng
fxrb\i c int. ;p6errl#o (int
Yfloc'ddf)
rt'oovfittE'51-d'g
gr-lc\ic iff qPdrrrcDrtrrs (mt rro,sni"g
no)',
prbtic in-t &ereFt<;rs (inr
inl c*rrtstt,.ftnrc( ); V |,t&{ ,
F-'b'i' SaflU 1"c"1 %
1' +uut'R
6t ,aoDetaits (ior no;' k reca^
Pdi. t{o? 6c* 'lnl g<fr4 q!<'J
(Sr"o5 cirq\'
-' J I
g:tSt"Oet-rs -'q,r rn .m e lc
'
Fo\i' Usi -lttfte''ecL'j(
c/ oc ap'ra-r'
)
v
'
joVa
DBofraHon8ro'o
tt $;s.jt = ftrnPlcrtl
a
.9
//;rnpteornr B.n.retbocls JDGcT(mpldlc throc.g b
Ttrr's ts an a1n1l,aJa-< I
{ ekzq\ ll c,n. So, exc<pblo,
,t' ?')': 11ffi.3 in D(o.'o&l<
lor TritrlJ - it. u{dd( ( ins..r into €rcrdenf vc,tues(?,'1, j< 6Pild'1c( '
. fe[0 O*eurt ] [ no"'d''f '
a&t'r63);
CtulfoUt bo"rr8
&r?ptles he 98e""d Pc/xol-Jt*<4 vo-{ug aa.ncc0r
refLrl D ltsqtt ;
3 n$att)
( it" *'3.an6offo-"'
Sr'"3
prillc int uph.reDerr;Ls
{
. o'
frl-
s'r<,delll- Eu 6mrne-- \ P
6mrr Sadd=! mhcx
in Yuult =i b' upAett< L atfA"r" 6rade
\
^
" lt*1"* )f
5.,o-- ? , ned ohr'rll '*tqq{!rn'i
L-, USng Prepar<aSfttt<ml,trl o4iecrs .
\{rurn Tesu\f ;
I
t?
rJ
inr detetcDtrc'''to
(int no )
FlbU c
l'rtr- Cbtt*t ]
t terbe,re g'o=
0
$..&nr
- ir'uf dc'rt (" dtr'rt &q 1",3);
lff Tt.:u\l
rejuvn re3ult)
q
J
$iu'len-ra
()
Qu-ldi
c inf Cdrrr-l c
ohYtllt3)
{ .- - ("rLt .2. (x) ff'orn stc'den* 'ne-
inr rtsoll = jt'guryEnL-* eocrnr
"*
"Yenr\o resolt
"
3
llat I irrr no )
F o\1(,
gersrr,aDer<urs
? "nar:
tPhu.^c sDo= ' /
{ + Prum eruAtrrr
ILa jt.qpa*U F"t1"l (" soe*r It
Yo -* OhF,rL "'3);
Cd{$f'r.f I I ,r.-n
T€TINN m ] no.ts
; )
vdut6
k
J
)t
)L
MO+ fu1tu3f,<Lc^(,
/l agownonoocfu'xrr,t .
U
{bean5>
u clol5 = org. ap,cie- Comrnons' dbtp " Basl.DJc.fuc.'{(f," >
zhean 16 ='ldbcP
.J
fllrnc > " drive'iclabNarne
4Lron >
>
" ilAbcTernplafe
&ao id*-'Krrplare clas5=" 0r6'sP'idUc'o""
"ducP" /'
" dofc,Su-.r cg ' reP -- .-- z
ZPrDIrrYt n&rne =
tJVsn)
>
id='dob' c)drs=^ D%6'co{i,," Bco'"'u
LWao
amsrncttx - uJ
reP=" tetnPlote'/z
Awoo,
4,wns,
// Ogq"*x C I i(rrrf iiav c
^
irnpc.it- Q3. SP'Ccrilffxl- 'eqrrlf' " X )
6o.pCno.orQer'asthorco'eUeda*ea..-1bob.),u$axDo<^;ts[rorjx-'t;|.}""qp)
(l" t ));
' d ete+r Dero-rts
u[ Rtca'd s *t* o'." deten"r" +bobi
S'o r I no
s catnt" +bqhj ' Wful"']sc))
)
So r I rp'of Stz.len+
(or))
bohj' getsrt'aDera'rs ;
6'o,r' (" (tit stuclcn* clcrurs' +
grsyao*D.r.,rs ("b6ad'));
s.o.e[ @ hgd btucrcr* JexitE,, 1bob.r.
3il*'
311.oo
0 5d bc r+, jc.{ a
:
;n p\o-roJcBc s6d
in 6*n35DBc
9' nrh* is rbe digP rjLo exec"log selecrlueYb
is rpt &'rau7.tbte oby-ti ruseod
g:- plc\in JDBc 8iv€5 QebLrlr&i oloJ€ct' aod )u
Ex<4*ion RerLmcotn3
IY
\,,
llaioserv €.{-
CCrrot o,ter ;
brdnsct tiiodq^] e)
ro ' btr"tt (victo
tJ.rogi. )
c;grr*,1--- l voo"rttan (fui4 genn
@cu.togt.l
@
(prevora416t1 fr4;c )
ic NcbPaq e
(Fscnt 4rp., I-b&tDno I DAo cta"s
l-r{ i() )
(F.orrst o.e ro8i.
De slLo
tJlndco rrgyL, --- Pr€fc€rlrt-s \E)r'ese ---) Jcm,er{ ----s 514$lo6lc \--r'
---
-)
[Jcdo5,. lo,x -------+ (fEoaole -----------J
Add 0.Dbcr+ , jar -&'. torbe Buitd lle$4 r{.'e Fqie4 Nlxt't tl-<tlt<&^S
tpl'd^ MdcLLa,Z<n tI,4",
6-,a'r"1 W-rca,.l-H er lafa.
IIC"n P'oJcr* -------+ &rilaRarf: ---------+ M pa Ertcvrre0At..FaleJ
ltd,bcL+. jc.t hrc.
-&ocar<-clrnAS<fu+
\-/
6tcpp:- Add f;1ooin3 €nt-rics ;n $il€cPt hLe .(r"roaercq. x*,
)
-
= or5.sf 'inai' Jodi Ohfcrtr'oto'gBean >/*trc..*
/,,.ao ;6=".,oPb" C\osb
T? apPt;raxo" {,p61 / * tr., ft, &4p!i
gW' b v"Le:gN Ir *#;*;il,|;k
lptogrt l D,irne="
Jndi Nary6
l*rl+
aJ rs n6 oecd .t g,rrn3
..Tt,/;daN
nnl t" ti
zlbgrr> ana, p.f,srrrcG fali ,,*.ir.%.:fl^;-,
o;4
t1
<WYfl 2 v
r^o-, ="r#.* ref.-" ftmflu<' f
J
4Lr(rn >
z.bean )d --"fnO " class=" l*lodet Brc.tu > \r
zlrtyry fnn-r€ " re| -'"t4Aati' 12 ')
='rnda6
<lkon> \r
\_)
\-..''
6"pa, poelop *1s DAoclals as Eho.;,o blooc Iv'dr'.*re tofic
f$^\.c.d,.|o"!
'=--+Fu tI'
Pc cn g, c cla:.s clor3re.5rre:
^4Dde'DAa
-'-r
--J clats nd,aD+ol
ftuwtc
' llLeat Wf"vu
rnrvl+sl":tktb
2' JAVTT^P)aI< ib"' InP!|on
l/ nar strlrrl-; w'ohd krsttt'-
jc
prt2r\c Vold atJt ( JdbcTe'npla+c )
.,0
' i+ut'ib--ir;
--ffii 4t'&'tsc'n
pc oor (rc "------, #"ue.
T:^l<x(arc -----., Na,"<,c'" Fl" &)
pq, --------->
-------+
l/tqodtl, ) att c,
WiL inte^Pacr
fi4Pljsr
llder I
rtas.-ti".'+Swdr'rs (SH,J c tl) ;
3 (t"a yt,,
add nole)
pc cra-r. Noroe '' Mo&I B'arrt "--'--n "
so Src-------) M,t1 ------z -_-
3
Iuse Wst@Q lo5;. og DAO ua's
gngr nljc-
tt*j add lftD?tra-r-1 rt'"ict+
[2
odlsrlkar'{
c---- uan -----= SctV t€-t ------) Name: fl61e,!-rv lc.t ---: B tr.;r {raler*6,
FId6<dloP"nt)
-------+D& F -__--_r .?"r,rel
/oP Yr.PPrn1 ut t : Cmalrlllcd
I -
&e hhi-- Crb&-t) etx' grBeo"'(''u" )
\J
fln*t) J
Prbrrc loid a"Go(tt6P ?eltrcrt/ ltSR *"p"^l')rf.-s SF)'TOE
:
{
dc.ra
r\ //ruaft'r..n -
\rtq Q-- te14e5f51''Srralarn<rw "'J ")J )
[-oT
SYParornetar L
I coq g.rnar(uA
\ .
Lsr{cae *=
Uui" aa,cr,6rcaerut (sr);
//feP ru,rr+ in klrest o-tt,'&.r-<
(/aoGaC-,-)
)"
doGu )
n"
VI**'*^"*r")
-J
* pr-blrc Void desr-6 C) |
\-
'
3
bohj = nutr )
t
It
' o'to"
to
^ 5rcp [i add rsar+ 'isP to Nerrmt
I tS Xejtr\t'Jsl
FLbroot
rnuP '-----r' '-rco
$P-------r f\larne
P'Con
'- Ll'@paBe imPof :^'iava'ufi) ' *" !'>
1tt>
/tb> ino Llth>
ztb> smr'' r t lth >
zth> SdAd /lfl', >
48>
L/' P^ (i"t i=o I izl-si2e( ) ; +ti)
JL
. .'l
cst rtc Pilded
.M^
----- In rbe Clrn9t26.rrortor, Rr" tr c}ange iind; mrnt ta 54rfu"- lo t'1 3 D5 [ha-,
\-/
.--+trhrnePaT4rD€}e{scc'eset?descriprSue,fuoc,rV.Psitlcrrr.lrfufe$&o^u'(neeAt/
dDtscTernpla}eclalsrtocooucoirhr.l"*..,patamefo,let-n^red|*t,,"eAM,'#fu
*ki Jzgc No"5l{ss
kwbc"H'"@
M,"..J f6,1apefr',3
4 Fr aa"rpte apPlicdlldD cn
\,
v
\--,/'
ar( not dltcsl X possiSl€ coirl &e r*thado
of- ra 6tTcrpla
iP Cafain (rrsisK'1i of)e'aLkloos
g''p€rt '
Oab$ then toe Caq ]mp)crnen t ihcse og,ra,rlon6 coirb 66tttbacr iDrctP6L6
l{loe lror}
'^- '--+ lnorder fo maLe oertcrin Bcratnes's Logic as Teuscrbte togrc ond- cenhc"{-jzed
oP D'ruB*es)
103,c ux Cc(q urrk coirb pLl56L fttoaedatre6
c'od R ncrong
collooS oPc
'in
-'. PtlSgL flrDc€dqh€ and tr(ocJrc'ns are rlisiule rnuttiPle oPPl''
cind coe use ex€cr.*ec) to c@ot rh,e PLlsst fmrc<&Ye to) fi'ncnon '
Lo'd;' torl''a^f
flD6t\ffn
(e
---? ro da,elop Ohrts b.sed ft-tq6Qie slto ;n'lepc#e'rt ++&'n'*t*
Lring soll6uedcs then Loe ne€d fo mcnlccoi/,.r orrn sltos lirc '
clars oQJ
futa"fr'cn y obj )e rq.r\rtd lo L$.rle )Ab,&IAe't'PIat<
et t*i'P )
,^-birJ^,*
e^ ht\E oPto$T'-j-J o?t"o,J^
kl --5
k)
urrrU@te
o"rrU$orc-+ trvrl-
-r
^8c'reJ '.iH-r..ryrr-se)elr
fl6,L B$ei
oytd^
e,,err oy@
Eqrrt
---n P^ |$r-
il;r;ff.naxr^tr) P^ Ho' b/t<ed I ,L or"n*.*'
iftratc ('',W
-->
ilOdute -lll
ug!ry rg"r"
tpringcoirbHibetmreApp\;coniraltrDprlog'APPDT€-PYeseofgB'Log;c
L-qlic'
aod Hibcfnrc Afpn 'G{:reSenrb Jrraiereoce
*--> Sp,,ng ood l'fiberrn-re Jnrcgrario'o i5 mrbiog h.r c'cldiog b;utt*"tt lrt6i5j-..rre
logic in 5pr;rg appo.
: buqsiog
_-> Jb trrl re l*beroa]< 64>r> pef6i5ieDce io6ic io fix,og&rn ctoes
fii6ornqprtpp
Byrffserr Ctind oCd
6icP-r:-
ftvelup l-l,bc.rnte class) rooPPiDS €.le
rroa-o
jnPo'- \-/
keeP Spnng aod fhbcroorc y€laJcd .t'av ftfeS in CMss pArq orrd hJE6__r^)r\h.$
jo, 8r.s
6,a.^) _
in c$s6p4ru : 6prin6. jar, bibc'cnre a..ic.y
\i
Srpry'-- deve lop Epnn g Inrcr$.ce, SPnng Eeon
zh-n>
"t*l-- - '
Ll\los; >
Lxr J= br'
awattx ib: 't' ift{clto'() "
wluro iL)
&
,1cL"s>
&/\-1a\ narre =" rutd >
LleWn c lcrts =" Uy.n' I >
rlsql-cyr'ttr 7
4h-n>
skfilh. erco* rhe cLbar€ q/a$!
pAlic Jerarrr getfuta t I
Po'o- f "+"t2 " 're, Sm"6 ! I t" ? ;i ,,"' 54Prl3[t r]
Lrt l- V,r- ft
"
iBU rtto*"' 6*"i Amr Named
-)
L2)
13 public int getuid( X return uid; )
14 public void setuname(String s)t uname=s; )
{5 public String getuname0{ return uname; }
16 public void setRole(St.ing r){ role=r; }
17 public String getRoleo{ return role; }
is)
1q
20 l*
2L create table users
2-2 ( userid number(s) primary key,
23 uname va rchar2( 20 ),
24 role varchar2( 20)
25 );
76 */
zj -__,---_______ -_rrser.hbm.xmr-!hgs_*fr_i:_s_qs_____
28 <?xml version="1-o"?>
29 <!DOCTYPE hibernate-mappins PUELIC
3O t'- / ,/Hibernatel Hibernate Mapping DTD 3.0//EN"
31 "http: / / hibernate.sourceforqe.netlhibernate:mappinq-3.O.dtd.i>
32 < h ibernate-mapping> f'tPotr6 cr6l S
-+
,34 <id name="u]T-column=..userid" />
l5
36
37
;; Jt this.ht=ht: | ;----ful
s7 Lr
58 ,) *1.^rs l_.!l*leL
-59 public Iterator getData( )
60 { r---t H6L g,ret)
t1 List l= ht.find( "froin User',);
62 Iterator it = l. iterator( );
63 -
54 return it;
55
56
67-...--------.--....------'----.sprinqHB'xml.-.--..
68 <?xml version="t.O" encoding= "UTF-8,'?>
69 <!DOCTYPE beans PUBLIC "-//spRING//DTD BEAN//EN.
Page I of 3
/ sDrinq-beans'dtdl' >
70 '!httB: /./ www.sprinqframework'orq/dtd
<beans>
<bean id="myds"
74 iitlJ!:.[]tl"t,"gframework'jdbc'datasource'DriverManagerDatasource">
gNc$ <orooertv name="driverClassName">
-
?"Jr""l o.u.r..jdbc.driver'oracleDriver< /vaiue>
JDg C
77 </propertY>
< propertY name="url">
U,ra9'{rJ'9;
?JJt-ueliaui:oracte:tnin:otocattrost: r szr:satva</value>
ohre* 33 < / ProPerty> -J
<pioP".ty name= "username">
(rur,$en{Tl <value>scott< /value>
L04
ios <bean id="template" class=" lprop€rty>
106 iirii."v > <ref bean="
".le=i'sessionFactorv" rce {io€ no; *q
1-o-1 </bean>
104
Org snrnq i6s C<bean id="d1" class= "demoimpl"> > </propertv>
<propertv "J-t-=l t*"t <ref bean = "template" /
""-]-ll].1t ro { < Ttrean>
lfan(otbfi$fD!. l- y@ tioeno:lob
inf,Ldng lhlilBol. l (q0bt-€ (lc.ss obJ
113 </beans>
114 -------------------------------selectservlet'java
1i5 imPort javax"servlet'*; *;
116 import iavax'servlet'http'
*;
117 imPort java.io.
1fS i-.f-.4-grgirhit'"'rffi
119 imPortjava.util.*;
iro ;;;;;;s.tp.i,,sft"*"*o'k'beans'ractorv'*;
ili i-'p"* ".g.springframework'context'*;
;;; ;;;;; o.i.sp.ln!f'amework'context'support'*;
i;; ;;;ll;.1";s selJctservlet extends Httpservlet
,r"0,,. response)
111 void service(HttpservretRequest request,HttpservretResponse
i;;'throws servletexception'roException };
t , {' Pritltwriter out=response'getwriter(
;;; svstem.out'printlni"tn seivice method of servlet")i
t?Jpti.utior,-co",textctx=newrclassPathxmlApplicationcoht€xt(
13'3 tta''<
i1i
;;3
{:K"*'ffi;tr{ffi;U6t-ttsiveast"^xw4'^
lterator i1=d l'getData( ); red>'l):
;;; out. piintlnl"<ooav- og""toi= *rfffcc text-=
users< / h-1>.<hi> <br><h3>" )i
13s out.prlntln("<n iJit-t'oiuttafr
;; out.println(;<tanlslvicllh=8oo/oborder=2>")i
1zz while( il'hasNext( ))
13a {
16?-rrr,r l68icro disptatd ret*Ls as I'lrhL+'hl. VffiSffi*,in Ur'L"
Ft's'ncts nvd.ccls af h;5 &ct"
4.39 User u1= ( User);1.next( );
r40 €ut.println{"<tr> <td > ".} ul.gettrid{ )-1." <trr>" +u l.getU name( ) + "
141 <td> " +ul.getRole0+ "< /tr>" );
142 )
L43 out:println( "<i/table> " );
t44 )
145 catch(ltffiException e)
146 {
L17 out. println(e);
144 e.printstackT.ta€9();, ,,..,"., ,,:
: ,.
+fe i"l:i-
tF0
151
ls2
153 <?xml version="1-O" encoding="ISO-a859-1"?>
1,54 <web-app xmlns="@"
L55 xmlnsixsi=" "
156 xsi :sch€maLocation= "http: / /iava.sun.com/xml /ns /i2ee
157 http: / / iava.sun.cohr /xml /ns/i2ee/web-apD 2 4.xsd"
158 version="2.4">
1s9 <servlet>
16() <servlet-name>select</servlet-nam€>
161 <servlet-class>selectservlet</servl€t-class>
162 </servlet>
!63 <servlet-mapping>
194 idervlet </q€rvlet-natI|e>
-+6 5 <url-patterh>l!!! /r.rl rl.0qtl6rn >
166 < /servlet-mapping>
L67 </web-app>
164
SFioSt+gAeP
696 -r,NF
clcss(6 .-J
Lt!€{ '.t'(s.5
6Bl€.r6c' {l
(t ' lAl S
(
[8rt+r) tilart'hbm'^rD\
WLb.nml SprirSDB xF)\
d,,,Jf"'Jiy:!:?
JorFret in cga:pAn+ : scrrl€l._Ap;.jcr.,, d"nol",et - iiass
jr,r ftrts
+n"t,r.h*liu.*.la.,i"n
;n ilE8'.rroc\li b htocr .. e _____-,
"p"n,;o6r.s
t--r ilibrrrrrtc lcrr 6r<3
I --* ofD(icw,,ic.r 6t<
''
fu6-nJ'^ -- !' '1Y )'t<xala'C> )
Kram ;t;
fiunnq
(l-t Namtd lr6t-@-
nl4flru (;tc htL:rnX Afi'cA
sry]-;ri r,t{,^'r( t'.w..d H\Ldfltd ;o I
/h-ff.>
Lc.larJ ---7
4ctcrgt>
" fatL' >
and ur'uaz=:b Jl >
,/ rlcOATA
[ &t Uit" ub @heYe ttb'ctid >="' Pi-
. tlapr4z
th,-
^,
sk?4i uro,x tL" o'br( ML+unJ'
===:: pl>Iit fu6"At{ trDd-"
{
o"'r M'^'aP^"' [
]"#; n;smffil
Na'ea An J
L,s+ r-=-h*. ft"r 86
i;':"1 ;,'
f&tzfiri i+ > I . Ifcra,",'- C) )
yelurn it )
execohng llibe.mte Pe$i5ft\r}ce Lo6ic 4 Cri tcrlaApl bU c{5jog l1;&rrnl<Caub<ca Q;4
Spo6OPn rodule.
Gle; * co'nd = PestrtcHcrns ' l;tse ( "lole ", " '/ P'r" )"'
CF'add (C"t'a ;;
/l exer"te lo6;c
l-.t3i "0.=
ct' lisi t )i
tetutn 'L',
Jllncr+A
ctats
Jll;nncr
)'' il"u^"a
I-ttratzn it, = !' itevttu L))
y(farn it',
l
l
rn the o.fuve code ht-ueto.,x().{ne6 k caued h""n5 innuda*J
4$: dLnc'nomQs
I( h'Or,*t - jar
,o't
5.rn 1a- -a,41
€'re and
CanfiXuraHcn
-a ru;rl-r Hibp{rute appli(afic,ns ule cdn tcrY-e l}'ts{nclft
5p,rng w""
rr.t olJrrUJ a.e rnc,st
D,'" V
p !c ht ^,'*-
- , tl,tn
YILn rrr' nalc G-fur''radcrr l-ir brr
Conft5r''ro$cm f'te
s1;arLrtJ'
snparrtS
sr"n3 LUrrtrJ--
Sfdng ' 0l^.^,.--r-.7
uoni n^-at'r"tt l"'rn*on ivigo{t\ w"*x&*v4
l;npea LDlrt, Spng
rnfu ftre
P ' ']'- Coak6r'* Locanon
4
''- avoYa(ry
'4
Trrrlrvs Situc*\on fkr< isno nted 4 grnfiXr'ii$ ke'nttr'l gfru doraSxrce objc'r-
$".5HBAee
l.J EB-INF
J----------------+
ClAsg€B
X ,Jovcr f+)
P )t.jal derrointc,r , c 1,"*<
derrrrimp I . clars
Nc-b. IrDl
SP'tnghS.xrn'l
fi;,Utta,rc. cfu,lmt
(I&'bbrn. 1pa1
U[<lr.ctctrs
I
hiberod.t€' cfu.
> 6ek*&wt*'ctali
rrn) :-
t'iqHg x-r
z-lfucrlPE
\)
ZIXooO > .*t:
of6 '5r'inskroecDc,,(p.6rrrr.}uberra.te3
LLf..a id -.rq56as]coTac.lzm6u cuos.
* ''b't4t'nle' tfo'xm \" I >
rprDe= Arggl-o."n.r,' v4lue="ct?ssP&lfi
4trD\rrn
LIfuo>
Corft3 uwjtoo
eam e ora 'lli bcr ncrrc-Ttnnplc're' krod"-rp\ ctassu
JJ
\,
teaa pre\i&s o?Pn'
zlbeons> \-/
baszd finnq, hibe,nofe ;^Fc6rat&/'
C{p(lcorton crn
onnotctllcios
@po e*o,np," (sw"6 a, bibemorc + )
tPel ibe {t,ndocrl- orl zor:
SL{SlmC ncttz{v3 6*^ oaf
;u
Mo&rle -iV
3pt,.rr.LElPg Plodule
and erc....
g-e orl'er ol$
oo Cerrcrin oara cnd
l4at.',ng &rr clpPttcct'Hcto execrrh'r,3
-'>
is norhnS bt'r €nabillng
1t'o-*
fi" one hme ot) P^ rnutriple hmeS
'iirrerr-,rr-t'o aous ftjs et''cd-ltg'
on $e apptic&.*cm6. dhire &aiJ"3 cottb
r5 Verj rrnprrn-(ni-,
ExampleS i -
e*-monrb'
Sffdin3 r€mainder,g an the lstoP
c)eaning Temporov5 $res ewldru d lt'o'clocL
,^_ F*
r fbese oe-.alio$
Ne can use T'tT vTctsK,
-[ime
r Clas's ctp idk envitor'rnen]
*'u iob oo cohjch'
class def,'nee
--> The Java cnsS thaf exteods Proro TimeTasta
__ The Schredr,ted nfJhor\ cr| In'rr ctocj can erp'ble scbedr'un3 on the iob
!
Igc+
50q0
t
- lqt{
SFd615 in; Hor dalag"
-hvrr-'t &{ui ce
to s*bIe
--1 Yegeir-firslhe
job dn eohich ur uYLoJ
uxn-&hwl datn"l"u''
me-o,d &
---t -tttr-5 Job cat' Le lbe€ in a u*-^'"g''ntd
qpr!!t.!4
312312013 9:22 AN
I SpringHBAppAnno
.2 l-----.-----*-'wEB-lNF
l----->classes
4 l---------'pl
5 I l-.-----'Demolnterjava/.class
6 I F--- ---tDemolmple.java/.class
7 I l----->Selectservlet.javal.class
B
o
rtl-----
I
I F------>User.iava/.class
F->SpringHB.xmt
10 j-----'lib
11
12
I l__-_.C.jar)
" F->web.xml io c,rxssPA Ttl
13 ,pt Bres
14
,_1i-:_':
l: l5-2? coltc$ Prom bg"t.sr< + 'l' j^0x " Persislcrre - jaY
c15 anl|l-2.7 .7 -jat der' aorn
)-e,5 cot\ecr P',,.6 Jc!.rFj'r qrff jcrygrf -5 1 \'aELJ
0ro commons{ogging.jar ai(.'sP ' @$<at
117 dom4j-1.6. 1.iar P7-8b Cbr'eL* ertra spnag6) Ls&s E J
a{
lrs hibemate-commons-annotations4.O. l.Final.iar orl s9 a",rt"t'3'l l tzE
I rg hibernate-core-4.1.8.Fina!.jar o,i sg ' bens -l 't PbE-l\sE
r
' J6'{
[lzo
hibernate-ehcache-4.1.8.Final jar o"l
^- W)l.As e ' ;
\i; hibernate-jpa-2.0-api-1.0.1 _Finat.jar
javassist3. 1 5.0-cA jar
orX *e urt - 31 1'
56 @Component("d1")
public class Demolmpl implements Demolnter
t
59 @Autowired
'60 private SessionFactory sesfact;
61
:62 public void setSesfact(SessionFactory f1)
63 {
64 sesfact=fl;
65 ]
66
public lterator getDataOthrows Exception
68 {
Page 1 of 3
sprint.q! 3D3t2013 9.22 AM
-
69 Session ses=sesfact.openSession0;
70 Query query=ses.createQuery('from Usei');
7'l Iterator i1=query.iterateO;
72 return i1;
73 )
74
75
76
77 -!-:li_i1t"
7a package p l;
79 import javax.persistence.*;
80
81 @Entity
@Table (name= "users")
public class User
84 {
85 @td
86 @Generatedvalue
87 @Column(name = "userid")
88 private int uid;
89
90 @Column(name= "uname")
91 private Slring uname;
92
o'l @Column (name= "role")
94 privale String role;
Page 2 of 3
sprint.lxt 3/23120'13 9:23 AM
<property name="dataSource" ref="myds"/>
<!- use this to avoid configuring mapping file->
139 <property name="packaqesToScan" value="D1,'></orooertv>
140 </- Lrrra*"U cl.r9 s€8 lirk ' Poc
141 *f 6frnn6 Cor*ainey ftL%tu z;o3 sll the F€*.? ctrerl^,e.e in' P,
142 </beans>
143
144
145 ::::l:tl:lj"*
146 package p1;
147
148 import.javax.servlet.*i
'149 import iavax.servlet.http.*;
150 import java.io.';
151 import org.hibernate.*;
152 import java.util.-;
153 import org.springframework.beans.factory.*;
154 import org.springframework.context. *:
155 import org.springframework.conte):t.support.r,
156 publicclass Selectservlet eldends Httpservlet
t
158 public void service(HttpServletRequest request,HttpServletResponse response)
159 throws ServlelException, lOException
160 {
161
162 Printwriler out=response. getwriter0,
163 System.out.println("ln service method of Servlet,,);
164 tryi
.165 ApplicationContext ctx=new ClasspathXmlApplicationContext(',SpringHB.xml");
I Ot) demointer d1 =(demointelctx.getBean("d 1.');
.167 Iterator il=d t.getData0;
t06
'169 out.println("<body bgcolor=#ffffcc text=red>,,);
170 out.prinlln("<h1><cenler>all users</hl ><hr><br><h3>,,).
171 out.println("<table width=80% border=2>',);
172 while(i1_hasNext0)
'173
t
174 User u1=(User)i1.next0;
175 out.println("<tr><td>"+u 1 .getUid0+,, <td>,,+u1 .gstuname0+' <td>',+u1 .getRole0+,,</tr>,,).
176 .i
177 out.println("</table>") :
17A )
'179 catch(Exception e)
'180
{
181 out.println(e);
182 e.printstackTrace0;
.183 )
184
-, 185
186
187 web.xml
188
189 <web-app>
190 <servlet>
191 <serylet-name>select</servlet-name>
192 <servlet-class>p l.Selectservlet</servlet-class>
193 </servlet>
194
-'195 <servlet-mapping>
196 <servlet-name>select</servlel-name>
197 <url-patlern>/selectaction </url-pattern>
'198 </servlet-mappinq>
'199
200 </web-app>
201
202
Page 3 of 3
Io 6frr,.,9 5.! [tibel oatcTemf]afe cl6ss l'tc brcn dqn cct+ea aod vemot rrd so, i D;€LI-
'r€f5hv
6lut rr&ia tctins Ohjeo$
.TcrLi'l &rvCr rre;nfcrio6 erDci l CtccounJ6 O-.rcl '.Xssc.geS '
*) Jovct Opplicolltln
U€e6 idbc 6rP;
ir; (o'raue, 'sujtrse c^oA e+c " -
uses DbSf )
Jrtl c,fi (w@il+e*l- jSpss regrarg c'r'd *c"-)
-----+ Jc(Vct d0Pn Qgtst'g d,o
Jala roai I 6rp;
.tava olpn llcl,lt servert slo [ &mes fta*-ser *t,Ui-"orn1ey'bffi,
a4dr€J
f,l&i, cllcht
'-) CtlSoing b{t)t i5 Y€spr,tlblt to 6end err,cf I rn€Jsc{A'z Pmt'> dne en:rl) 1 'L<abQnt
--'+ PoPa incornlD, $grLtd drlercl lhe err'4il ry11ssare'i {}otn inbox onne fi\
mnitin3 Oporcrrlo'ns .
6+ no.;1 Sevu'ed5'
potoco\ ' gg '---r Cq lan CUetu
A$acFrrrfr$ a
Altad,m enl- a
&mes
l--, fg fe :, llai I &..ve.l
' \e{5icrn : 2'^
vcnd o{ : Afcdo e
dePcu'tt Pc'f no S
644 6drnio Ccrnsote : 45b 5
fi-rn i rrft\zi
6dduS e'i
' lislus€r 6
CarctruQseY 6
deluser 164ri
: com
Boro€ eerver mrne-
gd SnTP ' CnHol I "
.
MJaQ pol"r cur.hr,,r 4 cxrhSoiog ee{vc'f ( +b5
.:
anloa i"o,u
312512013 5:5O PM
3/25/2013 5:50 PM
69
70
71
72
73
74
76 trv {
77 &t irrrx clclls
7A ffirTffifi::ff! new SMrpAuthenricaror0;---? obric <t c*r,gtn
79
80 Session session = Session.getlnstance(props,auth);
81
82 //prepare mail msg
B3 MimeMessage msg = new MimeMessage(session),
84 //set header values
85 msg.setsubject("open lo it know if'), t isizav.{ 6 grd'i r . (oD
86 msg.setFrom(new lnter netAddress("sa+Y#+*+@eBrail-€em")):
87 msg.addRecipient(Message.RecipientType.TO, new lnternetAddress("!A!aEz(@goa!kg$"));
88 //msg text
89 msg.setText("mail from satya");
90
91 Transport.send(msg);
\tftry
93 catch (Exception ex) {
94 ex.printStackTrace0;
]/catch
96 )//constructo r
ioncr crass k"'io 9-
-1
9B private class SMTPAuthentacator extends javax-mail.Authenticator {
public PasswordAuthentication getPisswordAuthentacation0 i
arrrl,r,'.t'calloo
\lcJ; c
L
rDcdl.nrn/(.5
100 return new PasswordAuthenti;tion("satva€ffiil+23@qsaitinm","ra$t2€e"); .-, *,* L.l-^ -,*
't0t
]/method t€st zov.\
tesri."o &4)c )s mqri) l\t"ir.
102 )//inner class ' ,/ '
103 public static void main(String0 argsx
144 SendMail mail=new SendMail0;
105 System.out-println("mail has been delivered"); odd rrra;t"iar in be cL'AssPArH '
106 \llmain >.hvac &rdt\aiit' jarv a
107 )// Mail class \
108
'109 import java.util.';
110 import javax.mail.';
111
public class GetMail {
113
114 String host="pop.gmail.com": g512aya @gw . rom
1 '15 String emarlfrom="satvaemaifi 231m€em" :
Page 2 of 6
3/2512013 5:50 PM
137
io Rg^D-!NLY *"'
138 folder.open(Folder.READ-oNly);----r anbdv o?cn
".,,.^." Eom rbe rnb6x
Messagel msg = folder.getMessages0 - ) *re errr. r n)')Jqd-
139
140
I€adiD8 ol-t
,
141 l4i6 r! C System.out.println((msg.length{)+" message lound,'):
142 d,scYt ) for (int i = 1; i <= msg tength; i++) {
143 ou rt''-,- ) Message mess=folder.getMessage(i);
1,14elf,oJlrnt'i
L
mess.writeTo(System.out);
149 . 1lfo, cv,rpa=r,.<.w,( u.tt m!g! tc, b..f!i r.d )
146 lltty
147 catch(Exception e)
148 {e.printstackTrace0;}
149 )//constructor
150
151 private class SMTPAuthenticator extends javax.mail,Authenticator {
152 publicPasswordAuthenticationgetPasswordAuthentication0{
i53 returnnewPasswordAuthentication(emailfrom,password);
154 ]
155 ) //private class
156
157 public static void main(String argsl)
1s8 t
159 new GetMail0;
160 ]/main
161 ]/class
'162 -*- *-App4-------*-----DeleteMailjava--*-----
163 importjava.util.-;
164 importjavax.mail.';
165 Dd€re
166 public class€€tl4ail {
167
'168
String host="pop.gmail.com";
'169 String emailfrom="sadya
170 String password="ia+ai2ee";
171 Striog port="995"; itsr.i.'va
172 tVftjL
173 '- €etMail0
174 {
175 Properties props = new Properties0;
I /tt
177 props.put("mail-pop3.host", host);
178 props.put("mail.pop3.port", porl);
179 props.put("mail.pop3_auth", "true");
180 props.put("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory.);
t81
182 try i
Authenticator auth = new SMTPAuthenticator0;
i84 Session session = Session.getlnstance(props, auth);
185
186 Store store = session.getstore(,,pop3s");
187
188 store.connect(host,emailfrom,password) ;
Page 3 of 6
3/2512013 5:50 PN
public SendSMS0 {
230 )
231 llc(eate an account on ipipi.com with the given username and password
public void msgsend0 {".,""SoEs
233 Str ing username =' giditfqqw" | /l/our Credentials
234 Strin! password = "sffi" 7"""b'-l-
z5c String smtphost = "ipipi.com"://lp/Name of Server
Slrinq compressre.r\:-':None": //l dont want any compression
237 Strin6 from = "ffiE\/S@ioipi com";//u r [email protected]
238 //This mobile number need not be registered with ipipi.com
239 String to = "[email protected]";//mobile nurnber where u want to send sms
240 String body = "HiThis Msg is sent through Java Code";
241 Transport lr = null;
242
243 try {
244 Prdperties props = System.getPropertiesg, ?. crttr,-n r)eLrr til'lI [nu{r/lP!
?45 props.put("mail.smtp.auth", "true');
246
J ruT* .;*": m(llt fqre{h\:s
Page 4 of 6
3/25120'13 5:51 PM
341 {
342 public static void main(String args0)
343 {
344 Applicationcontext ctx=new FilesystemxmlApplicationcontext("mailcfg.xml");
345 Studentbeanrets(Student)ctx.getBean("sti");
346 beanref.sendEmailMsgo;
347 System.oul.println("mailhasbeendelivered")l
348 1
349 )
350
35'1
Page 6 oi 6
SPting tlail "- Leloer Sewrc<s
io r'Jlndods -7
---+ As oP ncc Spring rlcri I i5 &aPfiJ r{ (ml[ Serrl rrr': t o PeYc(HctD5 '
-----) oyg . 39. hrrnl . javarrrn lttrf"senrs spnng's cdrsr6cr4fton b,4- o" Pb;n java rrr.' t aPi'
t
(crrefu tr.l s€nd an'ail m€sso|<l tol$#
)
.'
'
i
N"1RS.s , IPrPI , \5oh R. Gnd Qlc'. cre rbe Srrr Cnrcaco3S. These &crturrgs
posstrrord ; zc.vabosO I
o? LDrndd!6XPf7
5K?0l- spe--h do.rrrio m-e i.) brrr-1n -"# DNs re6'stt
"*
Urrdersrc,nding rbe reed ofl Dismr,urcd
onou.*1Derolry
liad,ltlonol Ole.rf -&iwd-9{0!
ct* locolto"dq"-*"r
c6*'- PYD8fcrrning e""t )
Trcdiriortdr c)ien'-se.(!e^ o{)p\lcollcr)s
.ttrof meonS o*.,l c\onge in rhe locot*r6 a4 Senror oqelf Cc*lc'n 1pc vrrul;t
trctiE
-Ibs indi'cc*re cllenr arrl ri{tPhi &Yr H$M% -
Gde {n rbe clien} &PPns' 'Sev';e.r
Od I Rea;gttq s).o
.qJ- n'-iJisL"'
ons cD'tl be derlor"J tr'"g rntJdPlr B'ct^Pw^n'
@ [ry,LrHPle $e'Yslr CLPPticafl ol^s (-'t
V tttEli,eJ tDirh Tedlrh0
scfcxcncea coit I
t)l There routHPle B'ct"ng'unrf
vi!;tllii-l.
wlt,"nxt 'k^
dhbd. *7r'r'6 si'
C cl;eni amns fre^ B'rornP"nc"*
a^J hAe{e B"'r'}'olg
(E @, €l crien'r &?Pn taus B'rncr{rodr o( B'tnt*'p^t"t
oF S",rrtX c,-fpl t'itr e^.."*a(Snol .'-.s,rrt LtU<. frb Cllor-t o|pvr'
6ru
i
To dax.toP Dish'ibured oyfx>g 6a oed rt''e 9+w* 4
J;.niu.r"J lahnoloytte
Plain RHr :-
at JDts
----+ ft i5 btrirt - in Disl'lua}td lecbnoto6S
=*"
= trle,hoa' o9 rhe ohre'r Crn be currel on\1
- rP
cl|<rrj
Clded Locgi' objeor' LM4! reer'5ts
be @red hm !ltl^
TP t\t-mentro& & rht ohJerr Orn
o'\ ol'u'' ics
Obtfit krz'ne: Ptrorchlr
t\fl(n lb i5 Clffe-J ftcr.ote O{]tt]'
- class imptc rrrnrs java. rrn I ,[2"'6o* (')
--+ hlhite deuloping &srnhted dppos d/\ he b,rsnegs dUelfS rru.sr be att l"pq
G( krrr ra O$eer ,
6.,'.rla
r S:nvcrApp .i o'v a
-Gie.l*#rc^
Cll.il A?P ",j c,rv a
il. t* f;6Eerz"r<^i
/i|9*.Aw'i"vo'.
' )t )
imfrort J&\Ct'lrni xi
,,-,'ffitf,,*tffi
o'
PJb\.ic E*T'npr t)
tlwot':s Qc"ereEltq"l
{ i sararn Grurn,.cr"r" )
i
S'o I f" €'*rtn r s-
qrso r
ll r'ro's'''" N6'ios'bind C
Na.,i.2 i i ouil
U"'':;i.^l"a"
'v 5'o d ( " st"- *pp rs r"^at - - ' '" )'
3
5
il Ctic'$APP'iavq
irnpolt ' rrni'*r
"iala
.toova.(uinu;,): il*so6i=(ruu)r'n'rni'r*!'{'r'ri}lJtrIl
E.j r"bj= LE"r)f.Ji-,ij
L-, lt ["lqtt to
ll col B't"ruat ''ntorr
3ll-^^
31o*
Coroptte ,.1auo Bres'
1'javQ
E:\Apps\spfing\Server)'i'rvac
c60t Far-t'cras Ptre il Ctpnr 6rderr'
Sntal i, -
Ttrniregiarx Loeawtroo >
E[} >rmirefi6rl 2ooo
da-ta
Data to rrrercpq' q61tt11on
--> t)g proces 6 o? crnve*i n9 3:'rra rntcrllcne
15
is Cdled 0n rrcrahof'l' '
k corred *trh"""'8' and Te$rxse
jnje*i(m Prbcess 6od ol[oco6 to tf* g.obj reP R"r r-; ro8i"h} rbtat-t3l^,
(''l* )--
plain trni Servot Af,pn ( Ploin'(roi clicnJ APPq
(vce)
--- Spncg rrn; ciictf afPn
gpnog rroi servc,r APpn n
(ttt) gPnog rrr)i cl ienf dPp/)
plorn rroi &.rvcx ArPPO n
'
lo Cr;e'* apnn side ]
fSr,to Flre sho(ld
coPred
-, In r(cd {.t!rld 6.Lt Ci€d.it ca{d Gnd Card for4 pon ertF siinJ Cor rt dc't'loPel' ol
Debit frrvc\fe
Drloh,rfS O? Pnl :-
Se{\x/rel!P q rtrt-r*t-
be
(-tr.,* t"to"u totb cuerd- clrld
O RmJ i3 Languaxe &fxnde'-tt
ctelelo1rJ ln Java Lar4aafie ' ) ,
e Rmr o{,Pn6 eorl r use J*e" ner rykrotlL as rb',t G-rnrrurrJ cq}lc'o d':aonel ' \--,
ujcd
scd iq rh€ &r4oprna- rP
&r4oprna-,P
v EJB 6rn1n*^r$or iu'sr u*<|'^L in$e
dad'srnpnJ-cf
grATE'n
gfA1tr"r8
JB dtent
EW ctrut Aep ht6r*n fS.
Aw *rxl^r4,,r,,* fs. Sn"3 htl"v'* xtot'r tknPs "b* )) ' '.-
..J
thie tatrnolq5 is ak6 \*g"%. &{".&t*' btU *"*,r. and oppl''caxons rtr'Jtte
Nvittco in jaua Lrn6,ro6e.
llhis FlorLrarfratl€,('
Spedal €ewwl JsP t,.^grarn, is coued
rdtlongfi,r,,l
qcrg ctars )
F .rnrCcokollc,/
tr}hleb( )
*lbe
^Lnffur
&ttoulvrg tg'tt P-omrhe'
ctienr oppe dcudo;rr o? Hwf.uoFe'v shn'rd 6c,4r,r
&"r" Omn 4 HtP.trnvo\.c,r.
cD q aft of 8ervicel.rrcrf"r
/Ar"l"essJnrt*Rece
b) Teftst urt to ge*Qustrress 6qjar "rekrence
C) DcrcrrnenkrHoo ohlt Bu.s;rrsg rrrr$'o61 ,
--) I9 cl;er't ig b)ocre d 6r oor Ptee ro gcncYzLrc De^r requ€6 t t6t) io fxt f="tO
eiicrLt 6ide oPc,'otlc'o 6 (IY*i \ fiwn vea#eSt wfg'l.ed Yesrffse CoT neg to el;c,ni- fi.-.'-_
Clicnt APP
rErres l Cr)
ne^r v€4,l,l€6t-
-) fD 6unchYu-o(.ls GrnrrfrruCCrrfon Alcx't*
Clicru 5id e
O|I/rc$tCm-l
$rr.ranan ond Senr'l d{fr8 e". kshn\ cv'PE[
aoPrts '
oi(rl+App
reO
P,.t;
Da(f yE&eF
Ste f 1t^f*-
Cl,ciu si e{e bttRMi''
otf{''rs-
--) Jn Clieff ood &)r'r(/ ci{,Png ccre lme! Cc,4ted
ASSrrchYDftrLs Cornmer ru'cortlc'r;
What ls Messaqinq?
Mcssirging is a rrctlrL\.1 r:f conrrrrurrication
b"t*a, j, roiiruaa cornponeo!s
pecr.ro_pccr lircrrrry: A rrressagins or
fror\ any :;i:]^i:_a
;|ffi"r.,:"* olhcr clicni e..l i.i;",,,"]llll: 'r nrc5sagrng u,lettl
send mEQET6]E-if#
ctienr can ca;;;A;;;;;;;;::=_
,"n,r;,tg. .l."iui,,gi'il,..:"}j;i-:1il1,,:olrnects ro a rnessaging agent that pro;id"" fu"lii;;
. N,essasino also
Nlessaging .ri;-r-,,. li.
ar<^ diiTers '' -- 'lv
-" ro
"]rrrLrr.rru'rr
a^pprrcar.)n
knorv
NrvrY ca rcmole
rernore apoltcation's m!d6^45'€r;:"
appricorioni X,!ir
l\4ehod
--
r)qtwcen pcople or i*i.r'' i1-*[S$i*
"'tt'tonj" mail (e:rnail).
n"**"
behvcen ,n,,,,.,."n
p""pt. ,rr""lgieT.*€$a-'i*,| coru.rnunicarion
.",i",*ii,iijl
'l'n'i"'" "ool"",i"',i! li''jl',ii":";t:j;;::H,:"t
W-ts_Us&e_JMSJ8E
The Java fulcssarc Selvicc
is ir javx
Apl thar allorv, oppiijut;on,,iiirr..
pril,rcr receive, and ,erd
;n',T,-.::: ,ft''"-:::,j1,,t".1,,:l:.:.y.,ai '? 51""'' '"n6,
"o,npuni",i'ii,b'ii,t
coi,r',, i,, c:rrc rrirh orhcr
In(ssi,.-ijr, ,;,,iii:1,,:iil:,jl::-',,',1' ".ii'.""t"t'iir'; il: lidffi;",lil:il :;'
.Dr,t lltc JMS Al,l rnrrrrrnr-zcs r tl'ol concepts a pro8.ramtnel
mu Iciuo
t,r'r,rirlcs cDorr-qlr li,rrlrr.cs ,,, .,.ll. 1e u5s Lnessrgi'rq proilucts
{l)cr}r,rrrr,ir;ry Lrr-ji!rS a'pricirri.rrs 'r1't'rt s<'Ilristicrtcd #i;:t'
I r)c rrrs A'r c'rbres
';"rr-"g,;; ro mrxitnize
ts notf.o:i!l.,;l;;.F
coirrr r rnic ,i,::':;:1.11"'s
only loosc '"#i;::il;:[,j:;:;:'''*'
ly'iou plc'j bur also
rs-rtrc1ror,",,r.
,lrrrvr: 16 s11,x(51 a ir,ii ,,r,"t,'itJt rlessrg'ei io r ct;, ni n, rh.y
;,, ;;;,:; ',; ,l .'.ll :l;..';liuer 0., i','"; a cii.nr
'n".r"g;
|ttti:rblc. llrc JIIS,\l,t,,,,,.;,.,;"',;.';
,Jo.,s nor
. . .
" .^^
ll,:,T,1:::',',, ";.:
.,,;;";;:';:i.'";i;,:ll:[:'il]j,.::;:]ij.j' onry
once Lory:r ,:vers
lj,":::;1:1,::,"0
lcss;ig.s o o ,ecei!e cluplicete ,
;l:ffit:1F,i;ff*ffi,,
tr;[l{-#,*,'';i: *:",'1,''""'"ry:,il**
#:::H:,,y: ;il,:"::::.:ff 'rui+',J1;*gffi
l:il ;l"lliff l,: :"t;i;;'l;ffi'::'
1'"
transaction-
a ' :: ;';,'i; #
't''e"
stngte 4uuw J
U++usgsret*
\
.)
'+! i
!
*
t
i
Point-to-Poin
r urrrr-ro-rornJt M
Mcssaeitg
cssaging Domirin
Domrrin
A poinl'to-poinl llteffiOucr or aDolic.t;^n
rvers. Each ,,je\(,rop i<
pplication is
i< built
^- rh- cdncept
h,rirr on_tirc -r rncssage gueues,
^.:.--^-. ol
il"' queues
the fi ^AA.---^).^
:::",':1":i:ii:',':T"1.ii,L':a{
establisbed ro tiota rrr#--'--
tv
1;'Gil ;#:: ;']l'H1.'fi'J:;ll'::f;;
q )PELl]|'j queue' ano recervlng
messages. eucues rerain all rnessages
-
clients extract r
i"nt ,o ,ta^ uniil
cons'jare., o*hril
are consumcd the *---^,^--
or until ih. messa'ges expirc.
Ittepbo'e
'rdd o:irh
n
Com4fbr ArxArrlr6tcr&lrtne
ferch $e
*".,,",,':iJ;ll'j,';i:':',1i,.i,,,1,;:'#",*;.f,ooJ.'
c)na,nrcn
messascs
lly publish or subscribe {+Jlfff:,ffJfiiTl"i.i,jl{,1;llTil
rrrving frorn a ro'ic,s ,,1-t,.ln: t"l':nJ \Tg-archy,f The sylrcm tlakes br'r-
onlv as 1,ng
-rv.ir,"g "'
i,i'r", i"',ri,,il"l" ;iili;ij; :*li:Llll'r<i .its"irrulriprc subscrib.ii.
" i,i"k;:';':':;i;:l'11il;il::;|liffii,J:,,ilri'urriprc
"i;;;;;br;;;;#
s,b'.';u.,r. i,pi",
i,pi., ;;;#;,..;,,i:: ;ff;j:,:il:
Pub/sub r'essaging f,", ,t," .^,,-...,.i,f:'. l:/ ,H
lu,.l
tt
F*tF6!Eb!'
I
,, i,r
.-.... ! . .
-r::
|
-. ;
rCl\
) rJ :1116 ;. c,!-.n crogie.
Messaqe Consumption
Messaging products arc inlrcrcnrly gJrr'llrrerluu5'
bctrvccn :n thc produition and
'.-"''' rsynchronoui: There I rlere ls fundrt::i3f timing
is no lundamenhl tTi"hlde
ona tlc
tf ," ol
of a rnesrge.
rnessroe l1^.o.v^. ,^r"
n a r[ore Drecise sen* M",",s.; "o;,; l.:lorvevcr, rh-
rhe ,;";il";l;; b;,
JMs
ll.;.i,l;;fl#" j.:,".
-i.tttch rynou:trv. A srrbscribcr ;, ,-;;
;;;;il';;;l;ffi ;":ii:,
"o,,ru,nl,ion
_,*..,,,.,^ ^..-u,J|ion
"- rrr sr'Ircr iil,l,",]il;,:i
oI Iwo rvavs: j
-r.r- -- '!r !^F'vrrrJ
cxplicitly rsrcncs
.,,.iiu.. block ferchds tnc
rhe mcssao
mcssagc from the
--^-.,..- -ur.rt
.re reccive n,prh^.J r'he receiuc
the
,ol arive
not 'ethod.
r.;v. \,;r,;- until a rressage arrivei
rvithin a spccified tirne lilrrir
I;;*dl -
.--iJ.''
rffi
lffi
W
A dministered Obiecis
A.rcsrirr is a single-threadcd
conro
pn,d,".,i il:i,,-. J:ffj:.t:l'."..*:lll and consurnins rne:
;sages You use sessions
'n",,"s. L,r..l,nu rressages. to create
!,
d{ :.r i i. t
r
6l
.l
t--.
3t
I
I Eessaqe prqducers
A ncssage produccr is an
t obiccr rh
It implei'enrs ,rr. M.;;";;fi;:::1'n,.'.rtirt'J" by a sessio' iind uscd for sendin!r
r])essages ro a desrinalion.
.',..'",.
t Messaqe ConSumers
A: ness?8e
t 1'l::::
"o^u.ullln
/r mess3ge consumer a ou.s
obiecr rhar i< .r,6,-.r L.-
t,i.pr"'.,u,"ii,."i'r:::jfi::ff'J:1 -
*ni.:.:*'""
a tls c'j;.^r ;:;;;.;::.,,1:''.. .
and used ror receiving
nressase! senr ro a
i
pfovrder manages the delivcry tt*'ott in a dcsrir)al,ll:
oesrnarron_ ort']ll1::
rncss;rges ':l]',,1]t:
a dcsrinariorr.. ,"
frorn'nteresr provider. 1.he JMS
.-_ lllc rcgtslcred consulhers
of the . -
Messiqe Listeners
! lessqe listetrcr is ar oUiccr rt,
1,ris.hjcc,
;:',til';tr,'liyti#;:ilil,jrltiiil:,fi{il::';:"H',";LJ;'ytli::.:':r,:,
laken a r"-."g;;;.i;;r.
"''r'ruo'
rvhen
onMeslase ln the onit{g554gs
Selectors
Messaqe Selectors .'
If-your messcging applicarion
;:r#tr;imi:":'i)::.1;
appiicarion.
j:,:'.,,:::
Messaqeq
The ulrirnate pu+ose of a JMS
aooj rr
is to
rw prod-uce.
other
orher soft*.are aonlierria-. lVil,,--'""
soitw.aie applications. ,^,a a1:11t"" and ro
Pleuucerano loconsurne_nlessa3cs thJr
ca,r ihsn be u.r,d bv
you
you,ro crc'c mcssages rhJt mdtcl| fo rrrat r\ (l,nple i,, r,igr,ry-n..;i;'";:::,;{
to crcltc
'"";;,s.. ,il;.;;:;;;;;;::,":.1.il"""::;,i^j:11l,lI:,::l"pr" but highly flerible, cl
s Ltrs ,,",.,o"" i,ni,i,;;;;;i;:':',:,::,:i'::]':-'r.:r i:"l,Ys rppric.riorrs on hc,crc:jenco,,s rrirro,,ns
i\ I cssagc Hcadcrs
A Jtvlimesagc headcr contains
ptouia.r.o." r?ii"J; lickh r|irr c.rn;ri, virr,cs rh:,r r\,rr,
properties * #ilI'l::;jf f'*'t"' crl's,rr.s irir(l
. rylessage ..i ,.,.
,o,hose p,ovidcd by,he
*#$:."11;'J'"T:i;:::';:'?,0T"-,:'.':"'#"i;;iJ",I:;
use them
lo create m"s."g. ,"l"i,o^
r:""00',"n
other m.ssasing t;,r,.,ut, o,
1,ou .un
Mcssage Dodics
Thc JMS ApI defiaes
tgc bu,dy lbcrrlts, also callcJ rllcsser
to receiv€ data in many rvhich aJlow v()u to
fo-nns and provide c"^""iiii;.'., .il;"- '.',1c5- sc'd utd
1 exlsllng
,:.------.---:-_--:-
Contains
messaging fon nets.
ty
;i:il1fr en,incraror u, .",",,r,,,,,ril-i-u.;:. ;;"fi*.il ,i: """::,::j::
;i::';":fl"j:fiffdM
ectMcssagc scriatizabh objccr',,'iirJi;;;lilg;,;;;;-,g ti,;c,*;". -*. -- - - -
tg. Cornposed of heao.rliJliiit prqp",r..s r h,_, ,*r;"r.
when a message body is not
required. ""t). ryp" l;
ffi0wm,
1
jr'!E applicarionB---
,
I"":::'1f*')-_-.------Myeueuer",,o"r;"uo3odro-.,r...) --_
it importjavaxjms.';
5 import ravax.naming :i n r€ttt5
6 i-port j""r.uGiii.ilrti""; {.p rtie or c-rc*r oliar gornr'ng tD o}o$Fsb
@ xgnvnrs cbnnedivl bl to serda ooP n and JnJ
7 19 $mx'l
8
9 public class MyQueuesender
10 {
11 public stitlc void main($tsingE args)
throws Exception
12 t 4 a. /^ ." -r-.--.'
Propetti€E propEnew Propenies(); . corn,scoo. er*6"prSse . rar,l'5' Sen;arJoitdo u$atn\
c)Jli Irop,put{Conlext.lNIIIAL_CONTEXT_FACToRY,"@,,);
lrs prop.pu{contextPRovtDER_uRL,"B rfloiJ}&:lir.H
lrs
\tl lnitirlcontoxt ic:new InitialContexqprop);
18 ,^- QueueConnectionFactory qcts(eueueConnectionFactorvlic,lookuDa.'conFactJndi,,I:
t9 l€) Quoueconn€ction qconn=qct.cEateQueueConncction(li-"qc41;.i4; -Til';""e'jlrro to J$C.""rghc't)
20 QueueSossion qqession=q6onn.createeueugsession(tiiio,illsion,AUTo AcKNowlroen:E?i'rA!hb
21 t+trtotti 6<sslot0hic* OS b4le b por(orD On{-JHl, Opootj oDS. - " todt'
22 Queuequeue=(Queuelct(.lookup("QueueJndi,'); --+ potds .iO rhe
23 Queuesender qsende.=qsession.createsender(queue); ___.j -ir,n*. Cesrlr,ol*rn Ce Crt(4 l,F<b Orvr,,
er*redC
24t oqt(J
frrlnlng tO Stf|t€ d.j$Ddfb,,
25a t""""n"t ..-
a5-60 c'arr5 ?o 1cxr rrssases bool og ?o djgftJ,*'t 1txf onttrus
261 Iili|X"r:il,n"
nl ds beucs ' bor €i-rtri 5 m€tso3es &nia,os s"me \kr!'e
28 1 int k=l;
zsl in rfrme PDg,nS.
30 I for(int i=l;i<!4;i++)
3rl {
321 if(i==1) To nrn PlOln Omg) SprJng JrnS O{tPn6
::l texts"Hotrnail";
34lt else if(i:=2) Q teel e 4sr'ruor cf CrrlassFsb ;n runninX rncete
rngdo.ncrio
TI texts"Amazon";
JD\ else if(l==3) otffi:3i:P..il'6''*'&ft'-:S;1i&-,1,',11",-"lqr$ir*1
3f textr'Jcuru";
38
39
olse
text!"Bazes";
Cli)qD(a v -ert 'i4'l
CID a{P&rv-alm)h'lc.t
40
47 I fo(int 1=1;1<=5;1s1
tir) a{Xr,r! - ee . jc.r
42 I t Cr),huee.jar
43 I message=qs€ssion,croateToxtMossagg0;
41 I meslags.setstrin gProporty(,'Name",text);
45 I messa ge,setText("This is ltem "+k+,,"-,-."+toxt);
ael System.outprintln("Sendirlg,,+k+,,\t"+text);'
471 qsender.gend(message);
aal ' k#;
4eI I lot
50' lltor
51
52 qse3sion.close0;
53 qconn'close();
s4 yjrlr6a f1!6u<rre&n&r.ictvct
55
56
{ava Hg6ueue&n&'t
57 importravaxjms.r;
58 import javax.naming.*;
59 lmport Java.util.Properties;
60
61 publiccrass MvoueueReceiverimo"'""""""ii1tixr3ll
62 -.uer ftam a..cr.edes"ffis"?
63 '
64 public stadc void main(string argsp) rbrows Exception [r!c'.un! d"-,.i:,14 Ary".d"m't)
65
6frsFsl (hDld'b
66
67 @ chonge trsa Jndi pnfr,,tttr tt
68 Properties prqp=ney Properties();
60 prop.put{ContexllNlTlAL_CONTEXT_FACTORY,.\lveblogicjndi.T3tnitialCo
toarFartcr/.};
70 prop.puqContextPROVtDER_URL,,,t3://localhost'001"t'
71
72 lnilialConlext ic=new lnitiatCont€xt(prop);
73 QueucConnectionFactory qcts(eueueConnectionFactory)ic.lookup("ConFactJndi,,);
74
75 QueueConnection qconn=qct crsabqueueConnection0;
Que!eSession qsossion=qconn.:reateeueuesession(false,Session,AUTO_ACKNOWLEDGE);
ii
Queue queue=(eueue)ct(.lookup("Oud&ndi,,);
l:I9 6 f;trct rtr srscng
80 stdng serector=',Name tt{t,eazeel.,Hobn",,r".-- n"**"*
t;, QueseReceiverqreceiver=isesston.c.ei;ie;eive(queue.setector);
cQriog trs-vor pot"it'n ra B&e,.€ akltimlc*!
tq
u4
uvQu"r"n""ui"". fi=?#iffffu3.,u"*".","k
qFceiver.setJlessadeListengr{mq};
85 -------L objcrf,
86 qconn'start{)i ffi"-1l"""6c L\ttt'<'t Titl'* current cla-x
-E-e.-',tt [slan't h m<rsalc skrr< dc rocxcSex '
!i89 , f.*tari\rae msfr €zlh firr€ ,
90 F-)yqrrtg4fs
I
public void onllossaqe(Messaoe mLot
31f,r,ffi;;;i#i"a+"'(Edat<'acolr"'eoclrmesso-netor'il4t7
r/\csgest<tre
sr
lgrran i6iaressag6 bnsg={Textuessago)ms9;
R"?il?d($;"""s"'i"'".t*s
ii## iJ"11i#:$Tlli Tffi 'i**.s a* ffi.,),
Sf dl ' e,pdntstackTrace{)i
98)
9e)
100).
tot *.-.___*
t02 (App2l On Topic
163 -.--...*-________-____-Igpicpemojava-_B#j.:b(:_amD.)
104 importjavax.naming,';
'105 importiava.util.properties;
139'.o"nl:gtln".j_rrrn5 Apr)
108 public ctasi TopicDemo
r09 t
1.19 public static finat String TOPIC_FACTORY
'l'll pubfic static finat String TOpIC=,,TopicJndi,,;=,,tconFacrJndi,.:
112
.lt3 public static void mainistring argsgiltrrows NamingFxception,
JMsException
{
111
'115
Properties prop=new Propeniesg: Jnf,r! properrtct
4 Cntrlss$rh rt6,s tj
prop'put{context'lNlrlAL-c-oNT_EXT-FACToRY,"corn-sun]enierprise,naming.seria
'!'!6 prop.put(context.pRovro-en_unl,"iiop:rir"" jiii"t.jiqs); """ nitcon texhactory,.);
11.1
118
Contextctx=newtnitialconteit{prop);
ToplcDemo ttsnew Tep;sggrnsil.
qioiu!(gxFuJ."o"t*a,e*,a;#$ifu -j(ur'<'u rr6!s a!,krr-
113
121 )
122
'123 public void dopubrconrext ctx) throws
JMsExceptioo, llamingExcepticn
124 {
125 Topic topic=(Togiclcb(.lookuolToptcr:
126 -Ggr*iAf,|;'$e tn)( &$tnaHon c& OrhsFsh rqisrr5
iil €) rlT:ii:311ffi:li:ll::-':i,*:*l:i*:n:*nrcrory)cb(''|ookup(roprc-rnironv);
i3ffi."Hi"Ye'+:#anr*i$,ieH#*ess
ill ion.ruro_ec KNowLE DG E) ;
|t;
TopicPublisher tp:ts.createpubtisher(iopicli _) F6llshel is creareJ [r]r+i'
ili @ lD lOp, c
179 ----------
180 Applications on Spring JMS
181 {App4X or queue)
183 Send€rApp {on eueue} -\
1s4 ---.----.:*'-:--l-j...-------.-rrlessasesenderlava(Si$&*d..-_h.c_rry.toS.tc tu 6o' d T(^r yn€rsa5 €
185 impolt javaxjms,.;
186 import org,springtrameworkjma.cor".-, @) cdero;ai:ct Jt45fc.rdaf,< tlc't{ 4tidt $mrutb Cf{<' ct'i"$"t
187 publlc class f essageSender {
188 iarBrcr io oarsrxrrtl
plivateJmsremptatejt; SfrrinA Jan Bret : @
133 sar* 5 3s f,res .,p - ppoD
lotrralr'r
pubtic Messasesender0 O
131 &lrff,sb erlrr shrrrd bC iO ruodoT moJe
r93 public void seut{JmsTemplate
it)
194
thisjr jt; settdc.l
195 =
f,-"- J }i 'Jav aL!)
196 )
197 l-"- qn rng.
"-1
'198
199 1-. t.l so oeP;ned B' mabod E ndc^ > .i1vc4 x javq
200 public void sendMessaoelt
201 6cJc. > i<lla k'dc t;z"l-
?9? MBsagecreatorcrcator:newMessagecreator()
203 {
public.MessagecreateMessage(Sessionsession)
l3i
?9q
207
Texutilessage message = nu
tly
;
208 ,
tffi!" rr'e.1 message = session,createTexfluessage{);
z'tv -J tmessage.setstrinqproperty("text","HelloWortd,,):
i99
211 ) \l'etr4sd Jq''br f" 6Dl.r ihrfxr,i.tb r,r,.1 .
catch (J tsExceprion e)
111
s'Printstackrraceo;
lii lreturn message;
216
1i:, ); ) eoe- art :- |e.t ohjcq F,, nreou,,e,s
219 inrx'r curs abof ir'fl.rr'an.rj
220 fitsend(creator); rn""a.1sCt a1"(rn<.L..a torcrtA
tzu <beaDs>
23a;U*dXy:,
11,5
(Ir
Name,, varue=,,rc nd
cu i
i,,D
8t,rh&s c{nrrurd.,F<drrrJcLj.a frrm glc.rFsh rc5istr.,
o n Fa nd
239
?11 <b6rnid=.igmptato"
iiilrii*i,T#l1Je.""Xi??i"TF;??#'[il:X,,#,'::::"*]"-l:-*?,,",
>qo
261
262
ntexi,s u ppo11.
263 fi ffi l;:$g:Tl:,,ij;ework.co ;
264 (
265 public static void main(Sttng
266
argsll)
267
268
?69 ft{*##l[t#i':i,ffltf"'Jl'S3;ffii,tr&#;$??f,q]tri,-"ioncontext(,,sp,;ns.xmi,,);
270 system.ouLprinfl n(.'message
ser)t,,);
271 )
272
273
274
2ft RecelyerApp
276
277
278 importjavaxjms.*i
279 import org.sf rin gframework jms.core.";
280
281 public class ilessageReceiver
282 private JmsTemplate jt;
{ joi Brce in
283
closS fiaA:- sane cr
284 &ndrr4pen .
285 pubtic MessageReceiver0
286 O
{?&&'vlr,
287 public void seUmsTemplate(JmsTemptate
288 t
jt) f- --+x jor:<o1
289
290
thisjt =jg J--- sp*ng ,
) ^m1
291
292 llecqua > i..vac t( 'Jcr!c\
293 >Jcrrrc. R-.r\teC0c",r-
294 public void receiveMessage0
295 t :;.eiv{ rtf
msq frDrn
296 Messi.ge message
= il;eceivefl: O,c, rs-Ct $trlafidrl
297
298
Tc:fltlessa ge tms g :;f iij<
n (me$a9o instanceof Text
299 rlessage)
300 tnsgE(TextMossage)message;
i
301 try
302 {
303 System.ouLprintln(trDsg,getTexq))i
304
.) System.outprintln(tnsg.gestlingproperry(,ierr',));
305
306 catc\J sErception e)
307 {\
308 e.prin6
309 )
310 !l/'?
31t Itdd
312 | //.b4
_:: -_--_-..-.spring.xrnt....--
l!9 .tOOCWpe mans pUBLtC "./APR|NG/,DTD BEAN/E .
M
316 "http:/www.springframework.orgrdtOfspringn€a;.dto;>
316 <beans>
317
119 <bean id="cfl clas-s!',org.springframeworkjndi.JndiObiectFactorvBean,,>
319 <propertynam€="jndiEnvironmenf.>
320 <props>
321 <Prop
322 <prop le}':'l1l1l11l!g.factory,initiat">com.sun.enterprise,namins.serialtnitcontexFactory<prop>
ksy="F ROV?DER-IJRL,'>ilop:/,[ocalhost*d{S<./o;dD>
323 <props> -btr'oorn)n8. prDvldk.urt {++t '
324 <property>
325 <property name='JndiNamo', valueJ,GonFactJndi"/t
326 </bean>
327
328 .9:11-i91C" class.E'org.springframework jndi.JndiObiecrFacroryBean,,>
329 <property name='lndiEnvlronment">
330 <props>
331 <prop
332 <prop :LIRL">iiop:/localhost:+846</prop>
333 </props> .
a/r\t,&r.br | +6+b
334 </property>
135 <,/bean>
336
<property name=.jndiName" value:"eueueJndi,.,/>
337
119 <bean id="i€mplato', clas6=.'org.springlramework.ims.core.JmsTemp,ate,,>
<property name="connectionFaitory-. rets'ici/> ' - --'--'--'-
919 <propertyname=,.defauttDestinatio;',
119
341 <,/bean> rets,'q"/>
u2
<beanid="ms" ctass=,'MessQgeReceiver,,>
l{1 <plopertynsmer"if' reF,'tdmptate"/>
1y
345 </bean>
346 </beans>
347 .----."--.--*- *-*Receiveclientiava__.__4*__..___-__-_-___..--.
348 importolg.sp ngframework.contextsupportii -'-'-
349 public class Receiyeclient
350 {
35t public Etatic void main(String args!)
3s2 t
353 FilesystenxmlApplicationcontet ch=new-FilesystemXmlApplicationcontext(,,spring.xml ,);
354 MessageReceiver mr =(Messas€Receiver){55k#ge16;t;i,;;;;i:--"
355 mr.receivetlessage();
356 )
357
358 l
359
360 Apps (on Toplc)
361
362
Sender App
fpublialxr gppn
363
364 import iavarjnF.r;
365 import org,sprlngtramework jms.core,';
366 public class Messagesender
{
367
368 private JmsTemplate jt
369
. 370 public Messagesende{ O
371
372 public void seUt{JmsTemptate
it}
37t t
374 thlsjt = jt;
375 )
376.
377 public void sendtlressageO
378 t
379 Messagecreator cl€etoJ = new Messagecreator0
380 t
381 public Mosaage crcabM$sage{Session sess,on)
382 A"dr!rrdlt{
383 ]!ln6 d(lr s TextMessage message = null;
384 phkcr !Y
385
,,1'*ro,*J{ messago ! lcsgion.creabTextltessage0;
386 '"v*--
eaato.at4
387 l.t.'.,(.6rGat- messags.setstringProperty("text', "Hello world");
388 ld(. k ce message,setTgxq"thk is test msg");
389
390 )
391 catch (JilsExceptlon e)
352 t
393 o.priltffitackTrace(];
394 )
395 retum message;
396 )
397 ];
398 t0
rb?;( de(hrd$oo
399 rlE' Yr,essate ,
il6end(cteator); ---.> 6drds
400 )
10r )
133 *- ---.-.------***:-.s.tl,nsmL($.drs*3-Qr"j- .,..,.. r$sc..rr.d.-g..,a.J
404 <?rmlyersionJ'1.0" encoding="UTF.8"?> 4o6-416 ----, urru "
405 <tDOCTypE beanE pUBLtC 'illSpntNet/Dto eEAH/ieN- liDrn f,ndi r€{l(n-5
oui.., ut $frn;ng i+
406 "http:/iwww.springframeworl,qrgldtdispring-beans.dtd">
407 <beans>
408 <bean ld="cf ' class="org.springlrameworkjndi.JndiOb.iectFactoryBean">
409 <property namE=".indiEnvironmonf '>
110 <props>
411 <prop key='lava.naming,tactory.initial">com,sun.enterprise.naming.SeriallnitcontextFactory</prop>
4't2 <prop key="PF|€V+F€tUR|Siiop:t/localhost*8,*l'</p.op>
<prop$> &o'narri* . . ,., t 4(+5
414 </property>
415
"-,ao
<propefty name="indiName" value="lconFactJndi"/>
416 </bean>
4'17
414 4tq-4r+ geft Tofic Ptor.,
4191 <bean id=''q" class="org.springframeworkjodi.Jndi0bjeclFactoryBean"> Jodiyritsl.r!
4201 <propertyname="jndiEnvironment'>
421 I <props>
422 <prop key="java.naming.factory.ini6al">com.sun.enterprise.naming.SeriallnitcontextFactory</prop>
| <propkey="FA#€e=!ql.'5iiop://localhost:40,+6</prop>
423 |
424 <,lprop* JGv." rl]ming I pr"v dor. ur, +t4{
425 ll </properttp
426 J <ptoperty name="jndiNams" valus="Topic..;ndi"/>
42lJ 4bean>
428
425
430 ) <bean id:"template" class-"org.spdngtrameworkjms,core.Jm6Template,,>
431 L <property name="connectionFactory" reh"cf'F Pttfr-d,; 4og
<property name="defaultDestination" ret="Sr
1ll
433JI <,lbean> '4q : aq
a'\a r<"Px,'c (lard o\icr"t
iii -r*, Sphosgr4n irl]c!rcd toirn 'rb Jrns
66'sTc'oPb'r
436Y <bean id=''ms" class="Messagesender">
437
I <propetty name="it" ret"lgIqllEl -rttla : +60
43qI <beaD
e <,lbeans>
439
440 -*.-.--.*-- €endclienljava---
4{1 import org.springflamewoIk.conlextsupport';
u2 public class sendclient
443 {
444 public static void main(String argsll)
445 {
446 FilesystemxmlApplicalionCont€t ch:new FilesystemxmlApplicalionContex("spring.xml");
uf Messagesender ms ={Messagesender)hclcry.getBean{"ms");
UE ms.sendMe$ag€0; clx
49 System,ouLprintln("m€ssage s€nf 'h €iooder
450 ) -- x 'iaYac!)
f--
|-'--'--':sp;%,{rn\
jarftres in clAssPAJH: Sqrh€ og pre"ioas app'A '.
etn& >i"vac +.iava
> i.ur^ Serl,dbe^.tr
451
'/
452
453
454 Receiver App (SrO6cr,ler
455 )
456
457 import javaxjms.';
458 importorgspringframeworkjms.core.*;
---llessageReceiverjava--
its9
460 public class llessageRecoiver {
461 private JmsTemplats jt;
462
463
4U public llessageReceive() O
465 ver
496 public void aet rFTemplate(JmsTemplate jt) QecPi
l------+ x 'ja\'a fa)
467 {
468 thisjt = jt; I
+ri og ' xml
469 ) l- ------
470
471 .).i1ys( tf -.jctva
472
473 public yoid receiveMessage0 7iaYc( f<ftflwclierLt
474 t
475 Message message =jtreceive0; F;r5i ,5kr1r a)al$ple Qeccivto I Subs'oi6ea
476 Textltessage lrosq - null; ?D'l'T aPPD- \
477 if (messags inslanceof TextMessage) .405 E$ stzrr amlS cne
478 t ' (tt/tkh'< efllD/
479 tmsg=(TextMessage)message;
,i8o try
481 {
482 System.out.prinfl n(trnsg.getTextO);
483 System.outprlntln(tmsg.getst ngproperty("!ext'.));
4U -
)
485 catch (JMsException e)
486 {
447 e.printStackTrace();
488 )
489 )
490 )
491 )
492 _____________-_____spring,xml__._____...____.___-...-___-_-_.__
493 <IDOCWPE beans PUBLTC "-//SpRtNGI/DTD BEAN'EN"
494 "http:rwww.sprinOframework,org/dtdlspring-beans.dtd">
495 <beans>
496
497 <bean id="cf' class="org.springtrameworkjndi,JncliObiectFacto.vBean,,>
498 <propertyname."indiEnvironment,,>
499 <props>
<prop key='lava.naming,factory'jnitiai">com.sun.enterprise.narning.SeriallnitcontextFactory</prop>
:99
501 <prop key="PR€V|DEf[-URf"iiiopy/tocathost:,t&*S<lp'rop>
!9? </props> irva.(&rn,')6-. prD,,.<r(" (d I 11,+6
503 <,lproperty>
504 <properlyname="jndiName,,valuej'CcnFacundi"/>
505 </bean>
506
<bean id="q" classE .org.springfrarreworkjndi.JndiObjectFactoryBean,,>
:9I
508 <propertyname='lndiEnvironmenf'>
509 <props>
<ptop keyi'lava.naming.factory.initlnl">com.sun.enterprise.naming.SeriallnitcontextFactory<lprop>
919 <propkey='qryryp54-g*t,'>iiop:t/tocathost:fiFt€</propi
:11
512 <ptopg &vtr.nc,mirq . p761,atgr. 11, 1 46t6
513 </propefty>
514 <propertyname='JndiName"value=',fue*Jndit'D
515 <bean> G p;(J.td ;
510
117 <b€an
518
idJ'lomplate', ctass=,'org.springframeworkjms,core.JmsTemplate.,>
<property name="connectionFactoryi ref=''cf,/> r-rt€t^ I a,a-
519 <property name="defaultDestinatio;,' reF'G-V>-- - .
520 <bean> Erc, s6-t
521
522 <beanid="ms" class=,,llltessageReceive]-.>
<property name="if' ret=]teripfate;f>f t4<4
t?q
524 </bean> : Srj
525 <beang
527 importorg.springframe*iork.contexfsuppoA.j
528 public ctass Receiveclient
. 529 {
530 public static void main(string argsll)
531 t
532 FilesystentonlAppticationContet ct(Ener..FilesystemxmtArplicationconbxt{.sp.ing.xml,);
*'
. 53i}
53il *ff :ih"""":ilm' =(MessaseRecet"errliJ6;s"6;?K:i: -
535 )
536
537 )
538
a-----:
TO Ocheive Osgnch,rono&g Cororn cfri(OHc.n 6lco brocoscr co in 8oq:r aod ctebcrpp r)
.^s€ either A,Ja.x (Cli.nr5)dc rc4bn6log3) ol Jc'v o Rr,t ler6 (Jclued,de Ter"hhobJ)
To C,cheiW mesSC.Xg bC.se d CrsgrrcbfDno, 'S Ccrm roudaofi crl knrr?n lcoo
@lu-reYD
$1s i5 €wt, ro prR.m m€ssc{€s k^!e d As3nchronotts Ccrnrocrni(c*ton
r1 prrul** Cot*,in
Top,. as tbe Destlraklo" I ntso'Xt et^
US(S
--j the
Fr, t fr.a hPo o^o thesr mersc,Xe-s clo,-rrdn te€o< paXe nds l( r- oF o'-[c+l:otr'
@ Ptaeaot' ro or(ol€ in GlassFsb ?''X SerVctf
er<f{91-
\-/
6t{r'- o,erc &reue akr6rrrrr* !,""\tg JNOI name
ruc(n------)
Qerd'rces
sdvpfisn
Admin Conso [e &xee,D ----_+ dl{sResurrcea De
\_-2'
JlNprName ,
ftc.-ru<,r tm s"4p6ya AR Lrsea jvns opi {-o rtrdr"e ms6-l furn Se flera'c
)
the 6Furfttre cP O116 rnessqg e
ttto.l-ct
ine" 6
Ttrere i6 a p..,ss)bi li rg & Developtng 5 rcrs og Husc'S€6 &"
-'o?lo+lPra
*rese t1essc,ge6 Ye+kr FXe no : @ 4 l;"* '
Sr,uml"lesage
llapllesage
0b&* l'1csscse
and elc . .-.
x) F+r pkunJos Apr bosed Sl&,t, rcceivc't crpplicortc,n dr"Jl$ coltlr, &,ere&s4\blt"
f-) rt r5 sPnog 6 orr,rr rt<b Flc.: siuc, ro der,eloP hlvc'L 61'rctLi lecict're bascd
I to.t o{pn6.
fn tbi 5 O{pn Slrctr3 Crppn ftfrreSerrfS y166r; \reg.. q,t.l *Tr*;,Hi{,?j "
-) i c)
(Fr€renFrl sn tog L'
and 6pring Cqrpn r€fm 5enr5 m€del tct'be'{ l0$ic5 -
iotcQce lcBic)
Cet'tl*t s [gic{ Pners
Q eFu-rs Lo;rb gpytng{6hr*s ood Sfrfiogoppr,s .rtside ard ere!-uj< crfr lbe 8Om€ ovM
di?Pete'r-t co-Prt't'
-i StYars o{?n ;S fi€ff)5te cllerl-r o?pn 16 $ng a+eo '
-> h"'re sphn3 cr-ppn masr be a Disrri burcrl oePn,
I Spr;nq irultgr<r$f0
i+ i
Spriog slto to ccnrfigr.re ir, SFtutS ConAgurol-icr{) Bre b;.rsr.'tg 4plr-rgin > k.x .
Aaic,n&wrcr yecltnizei cru $e plu$ins c'onff6uwd in srn rs Cor,&6uianan $te
tlt rnar.rcrr i b ts iosEnrt ctJt^d lorole* c'.'rc*tcrn ) . Aettcm & :r,tet insra"ttrHo-n
.
'frtv€s 1:1666 eirlxr clr,,"lrg S{wd 6ktftrp .,t durrrg rhe deployccn'e'r-r r-(
IrL rh.is pmcsss o1-1 5f1e !er.r6 itrcrtart Cclnftiarrd tuit\ b€ freirstc/n]i.JtJ
-)
In ovn]lrg cP6 hre
iro fl-e acnvcred fio3 eon,r,irr4 1&rc6 (Irc*ia",&r vel l-rr€ i. Darr€> -se,v)et' Xml
b'raory coi.doto
Corrhol) e'a )
W.r,to $e d;cqtowl
3rtof5 ccn?;quvot1c"1
@ Acn..n5e',vr€f it&ps and fuKe6 the rEuest an<l useg
anJ ctcrsS **'! c''- re7orcd to
.- ftre gnt,;es to decjde Flrmbean . fip;rcrn
1h.,5 fx€cck(-r-r-'-)
Bth ft-ngBcan
,tethocl s'-eboc'r rnoncLBcS
-@ oP ff'5Beon *A fl* %-
@ oer*tG,-,-,-) rrrh6d oug Bu,sthe$rrncr{roc{
m r€.sLttf l']a6c-
keP *t, rtour in refest a4w;e h rrt've i& viriote '
-O rnb @"rmle At"s69'ntt-r
Qx€-c-otlti,-,-t-),rerhod 'rt}.-'rhg 4te pga"F*
'@
A*r&r,o uses sn*rA^an*r*^ &lo gnr;a +o cletla"+fu'1'1r
'-@,A,n*SovteF
fi&rs€e $e G'tnte totesuttf,ne as
bix,r{,,{a$ndoco
-'6 oou,, PaXe.$.ax thc- rzcvttn ..na was lfu rtsrLlts tb
j oPPn'
-) Ttrre q€ tzoo opprDac-hea 6r*rs 1o16' 6pAn3
(Drrr''
Jo
tc-hea +o &nlap
&trtop srw"' d
^ oi5 coitrr 6e
: - o^,^".
'-'") Atoate
loo 3nr'-t5 Actton cklss Gs
6p''rng
A0prDaab l) Bg rrr')c"'U ."
, A
,_,U*,'., Drsro.Lftrr o,i+fsrt t ;: )
| r,#Ti*u["tj*T-.*," sfr".r' * :* p**@'rtu*
^*^nhe?dfD cfu 6*'6 A'tnonctc'rs c'" si*tX |,*.-ani't spicfS f:re)
*
ff6rrmcl@ dl6cussion.S : ,,+ €grrng c+i ' Irle
frr- Xt" 3'Prr'* ctass
cl&s3 & Kndg
Nwn 5h11t5 AleHc/n
Crtn geh &(Iess fD 3gnn6Conf"no'
th'e &,.rertlooote,r PLt$ f.) OCt VOIC/
9l(us A(tlon (1035 dksfioe taN ati.d d
to 0& acrelg J6 Sil,an6k^
cnd cre a^ F rh.,s SP"nXc0nt''ir'ad
-1? CaLt B. nrcr{rads 0rr i L '
lh)s Gmtotnar tDit\ be crurva-Ftl eltho{ Chtt\n6 f.",- sa'tiL4 (a1 Ju'*q rhe
drflry.-.* 6p sr$'4n {hs ft'o@s iqnoves tl* yxt?-"a^wilhc, o"nP":a a
ocrivzrli ng Sp't q &-tc!ine,l in e151 ft-nr.o crcts s €q-'"ol<)X '
-)
Sampie .shtrt$ A&16) ci"ss Cocle S allroagQl ;-
13 I"x
o{ftrDai}t (| krscl
6f'dz4s
dtamm b,sA and tha afoire
@R" rn. af""
c{p1:n \LW .{,Pr, @ Poteoo ) -++
t5
toirh 6Fng
ApLr-lo0m"t rut
IfroOcf, @ UUsC$st(Jns :-
Sp,tn[*.,,n c-lc{g in stzttroSGn€J3u*H^'
os
-> l*re tce cbn6gurad Srrugfuricocl&rs
pr6de1 lrolpv'
e'}a'6' ofuj<ct fo Sh'uis
ftte. sor{.ot L& can iqenr 111a {,;ri5{}earr .-
Aqi<m ctcrss fb Cb'l-L rhe EL|'sincl5 rnca{rods
th( wq1-ttKl
ctc'rs in S* tsG"95"*l- f;rt{'o vecdt<
#n o",g'n^ Sr'"'rsA'cno'
cr)l$irrat 'shctts &f:o'c'42-6
P*rn A,.rron9wrtr oyrJ J6 pas6e reqAestio !7
Aat$<tl>
lbeGr'6>
' -"'uu(*i^"
z ' dard
q
ru"*t-;*:*;ffi':-t:ffi'
zl}roo> .^ -." t-
o n** *"r'fsacn
' -,--.-'tlode\flnPI l7
,Zbean ;d =' dr, c)(:.s>--
tltF- L-sP;ngBeon
..'
.' ':
-l
|.*t,,'tJlt- ibi'04/5 5riltB*
giws krtor pcoft'nonce ln s*rrl5
Jnlr#..,len
-*"*'*j@
crqrs o$et to sr',rrs Auta" ctctss PID(l/t eirbeJr d:rrt lq',J, Sko/r&{ ot
dtrrtng fhe dtptgrrr"+ ofr tfie a'rbctpptl'
retl<'r erpno: @
c[Pn fu<r"prtrnr
tu\ opprotuh no@ bored std-tfs trrlrh sPnnt
8ffoo,.,77 y6+f
' x; Htn;p,qiat Shuring 6tyut6, <p'nq,h,*-arc &zrcgrarton Aad- cr]s6 i rnpleyn e-rrt-jn9
--, the bafxr .hva CScrs 4 cllenr aapr, fbor &pc'rafeg Brsiness rrCrt^rod coUs &,**
tpr,,t Pre"luittto rnodlfu is carred BossnesDclSorccto-ra
stroJ5 f0 sftioc Co;rb lh']fr nolc c{'P n
n f t,)eb o{Plr'(afioD
C&rnt'dl,r tal.^)
{ngr1, jsp(firrnpagr
er@ft(-'-,-' -) t
.E
tyr,tylt'.
E]
R10if6 e '
trYi.l4 3 -
\\-./'
HfiP lnti4,l
atilr----)
-==----l /
\ nb--5r|-dr'Nl
\-,
--) Irr *'e ab*t_ d..afa", iN UJOaa{)pnS dr11 fu,re (1 a"rts Alp\coA^,
- 00 trut'ltc'r
oom Klslrrrive
!
tlJk \ipg€ Ddrz B a5e Erolar<I ---l
hJlndoc,r
-------+ Fed ---'?
v iqfir cUctt
--'
.J.-
,. Oraoe (rr'in er"r )
Dri\tt('tcrnlc'Fe Lgraoe Ll
Driw{ Ncim€ ,6
'- tr*"@r"t^rmtt: ta"l1-t!
Gnr-rdf'n LrQL" Frt'-'u---------__-n"
tllcrnarrr , t*".-f
_ Frssrrxna', L!r"-J
c,ddt&r s \ardb.f,J4
-L
:
*;-:^ffi::'T,--5", Hbe,rn4'}-r ",'pLtutt(
----- QI+1wr'IL 3>
- fu+Pd* UcrL-----tM^1 5
G'
on l'l8- st.'denr
-,${'Tetpr^rn Hitr,'v.t< Qe't'rrittrrginecrinS Er P/('rd
-) DB Btotux'J'--j
P(e DB -=
prn tre -------- -"{l.)5rtu
piodr.,o rrlKu P ot'tmpxs
*n+-_---e^ftS'
Cs're*a' *ol-':'*t
------r Foand olzLP
---tExrllnA fiWnott Rar'rst Evr'$ntrr"g -+
&gh ctrck on Hb -slzl&/Lt
--4
a- ,Kivrtsc{ S,r" flllttt** n*jlf_:]
@ c*..t ?6f,6 z> kdle
D0 W J*to Dd.raic(er5 OU<+ [p4o)
O Ad.t FHtzr na.l't l'n qrxr5 Annofawr,x... W (t't.rcta< Ph'G s' F;nd Bi meuhoats '
[3upda*e l1ilxztvLb< ccm(15utav6, Dturiipe :OS'^]'J'6DM
-l
+ HiUerrrrre lgpeS -, JDG\tne{a}<N j l]"C}t w.'A4f ------_:)
1 N(*L @ "
-,
.g5-sruden* ---------) TDcnenc{alrri I',rts t-lc".il
--_+p'd*',
Add fion9 o'{ct}ili6cs tu #-ta rfts.4+
s-{-gi- .rr "--.!rv.ire,naLilih?{-
oiSl-uteocrncnPDjats---------'F]U|=ttlxt--JA.ddsfd%cc'PcJilitx{--.----)@<r'"onr.5..-J
q1-9l'!9 tr)i5c ubGric{' \r'
*)et cos, p:1l.,ltt14sjry'qp9c' gll4' ' ----J^/(xl*
-----)
p'u'@:&ilIlilil
- g€rutsf - ;rrl
d;sR.lzhr.
* "E;;:Y
*----- D v*ne pop Bdtd.^r
--) ---=(u(xE
$tJ5P6fiecrury Beao id I ses Poct ---------n l*|tr.
\+bitaJeru DftP .jar:< P+,"1
i fi;s 51-(p fle'ne'rcles Hb6rud6* 'ic!u6\
814'S p6ro cl4t3
clois
Srcp--rffi ;- Add gpvtnqlr4erparfl spnn5lBeona ro the PrRJelt '
]"'
Cbnftgu'e *,e 4rraoin6 ,acldsHcnat kans in *-1 a"66lr*r ^
in d;s6't<x" -. grn/tr}'xm I
--'/ /*do I
-.
4Vt'o>
'.,, /&an id ="'Wg'uA4x*A*o''
--
zl&on>
z&-on id="rr$" cf&ss ='lvlocuBrao >
qrofx\ rrtrne="'dao' tt'p=" llbStudentD[O 17
zlbaoz ' l)tpTttow&n'iufu
'-^-L1^, 't"rPoinvoYr,r
zb?ilo r!,rne=' l*'t't;ceu thtS'=" CJlA"se' *n'oan5'l'dtpinv
/7nPrr1 Tnftt =" g*i a'T^xoPate' vo)l*-'mt'dg' I '
4rwrr+A Mm€ =" &rwitt' rtl=-"nb" f ,
Ll&an>
zbean i6'="5url Llots="ovg'3;niqParncrra"t' "tLLlo'8'd w"tl*,L\w 'St4tU'l-U'aur4n
sooe$r l'lo"rtorfu+p;T
2g*v\ lAme rrr4ernS 5 ">
-'
zQnP6>
z(rr,r1 ke6="m;.clo' > lser^.,;celP^O'
z-lpnrzb >
zlyxaT*g >
zlbean ,
zlwn37
CcnA gctre Torr(l.t €ewe,r eonh rng EcUPse 'ID E
e.-1oY
Chanqer'-
Bte to hlEB-rNF e?lcie<dg VJOtd-"l-
changeli- Ccpg ditpe'tchel-6e$Jte-r'xtnr
Ctsr€e a'.- Add fl"m.6-home1 tiu\ esm\asn-?'?-3'ia1 to tbe tulld Fnb oe$e fiqtel"
Clnogear IP
CnsV;ui* qrobtem i6 "rc,.i(ea rulrr,';t.Y-A!9
Frh c? rhe irrqle*- r<el?da
O rcr'ow ll'bersffe, q'iogllblzd\ag {o-fP"tttd
.'P ri( fI'"P
b) ddd s1n og, ltU"n"re rebred jav Gter inra the libravlcl
hibonnrc 3.Jan
Jar R+uS stP+,i-a?t -l'e'
f,itng jars -1{5e,.,crr}e
Imn-r'r' jar
hlbcrnat-r i- l. 6,{ .,id,,l
-fha Aeflute g 5ar $ t! (jovossi I
'ia'{ s t {#{o. &,A icd
Spno$
iat 0':loerrerlt-.lRa- 1'o-af -1'o o ?rr'o-U6al
Ctrnrnorrd - tOgSlng
\,
CCgmrr$nS-Cll,ta$o'n -?' I'iOtY
6fr'\n6- Webm\,c'icl'l
3rc,t5 *Ot'',
4@an>
A,lbxai5 2
to rhe Wje'k
Lrc?-e'.' add Srrarb Cc'pa")tihYs Qswuls l-3
Md grrclfs Copalailitie-l --i
Vgw ct't'on ***
W --------, ftn;.l.
--a WAe Wud,X<^ ='ou:-
rP-r-o clcrvtas
y)3
-T-
\-odA f- -----n $r.'rlrxl1.s
l]
a
---) kxeJ
desc'rrerr s6sched
a 7\ac*ic|'\yrh
' -----t Jsf -------, V ca&!< Jsp .Pr.."r 9.
-- -----rnexb -'---- rftrfh "' ltaiao
J
NLtr Jtp patt I i7i"r.u..itp-l
trc,E4A.lt;l #-, fre, -l __,____5 ft,.,,astarr----------: add.----HIi:Tff,
€ a/ d
-_) --J
--- Tioisl, -
sltp-il,.'- -----.2c,tor€,
Do 4r,roorn3 mod.Aco$ons ,b 9nar5 C".?',Xur.nU -fl1,. ,
e/rcnds Ad* 1
Pstlic clcrss I"P*tNrl'^
Clienj mo) 60 \c
Jt
Qu',)tic vo;d ser|1"(6;ryg
{'rie ' rrn =mo ;
'lt
J.
Pbuc ftl^F^-'"i o<etulr C '-'- ' - )
qv
a
(,-
LIH*'"" ).1 :'
r{eear.-1'':vfn(1,/
t'J';,'-:
.''t , i{:r. ge+l
wtf, =
;; r"'*Jnf (itu' surl'())"
int wtz = Islqu ' (atK
\r* flB
= J,uk1b(' p"rxctxt
J
tlta1,d g.rne-rhod o? tr;cur.r U'ac.'t
t t/ \
btf yrscr.tt
= (r"^< tttrrm>,m3
-o.Conr&".rbd )'
i ll!"q', t^ttt" ib r€lf-ert o,r+nAl*e
"ftAfr-sl' 8e+Att,uc,re7'msS",v€slttt) ) .
-
\.7
*_____--, Ok
\.--
L\' is the d,Pft"c.'ce blt, prcgvcLmiog Lr.nguage, IeohnologS and Farnerrrorfl
6.:- Nbor ?
4/9/2013 5:01 Pn
2 <Vo@
-taglib
prcfix=',html,' uri=.,/atruts-tags" %>
3 <html> -trTiJ Ed ru t
4 <head></head> 'r,
-13 </hlml>
------------success.isp-Cs-'4f-!pAg)-3-T:a
.%@
,1.1 <html>taglib prefix="myHtml" uri="/struis-tags', %>
16
'17 <head></head>
18 <body>
'19 <h l>Success Page</h1>
20 <h4>Hello <elLll4hlqperty value=,,username',/></h4>
21 <lbody> Ltttrtws qt,'es u!e' na,lre Prb6 vo,l1,e StarlJE obj
22 4hlml> a. -r slnrf5 ?"
24 <web-app>
25 <filter>
26 <filter-name>struts2</filter-name>
.<filter-class>org apache.struts2.dispatcher.ng.filter.strutsPrepareAndExecuteFilter</filler-class>
?! </filteP
28
29 <filter-mapping>
3G <filter-name->struts2.tritter-name'f src*s a a.?ptted $rro, 66, ff6,.r6j 6q 6.k]t
31 <url-paftem>f</url-pattern> | ."_ .,
i"':"t un *d^LYdln'aFe
</filter-mappinfr- C-rnw,r. dta <ls
17
33 <welmme-file-lisF f€rvrcrFGer+ 1,..1 (z.Fe or! p.e- xn ar or.C o(
11 <welcome-file>register. jsp</wetcome_file>
J _-_,.'_lJ_,we,uu,,,y_ rEZ au
c,.tJ tltc
thc ,t
"rd
ce
"n*pors"J
35 <A/velcome_file-list>
.
"oth h.Jc'(ry
JyrlrErg.
3,6 <listenep
37 <listener-class> ) **ltt ott't Lr sen^t lt d"$ u4ft srr'\ nEs t'*$ a4vn
9q
3J
org.springframework.web.context.Contexlloaderlistener
</listener-class> t
40 </listenep ) Gox.,t G^1o1n d.; "1 Se,r vo, s 1.,,r.+ .
t
41 </web-app>
42 ------------------------------strurs xlnr--C6lgt1-q{?-6gqg!1-9 Brc) s.'"+'a
43 <?xml version=" 1.0" encoding=',UTF_8,' ?>
.14 <!DOCTYPE SKUTS PUBLIC
4? "-//ApacheSofrwareFoundation//DTDStrutsConfiguration2.0//EN,,
46 "http.//struts.apache.orq/dtds/struts2.0dld,.>
47 <struts>
19 :i-__I$-l"I:
4v 1" srruts,that tnjgction(for Action Class) wi be done by spring-_>
<constant name="struts.objectFactory,' value='.springi. />
50 <!-- <constant name="slruts.devMo69', ys;us=.'ylJs,' /"r-_,
!1 <packagename="myPack"extends=,,struts-default'>
in spr{s crs nre .>
ii54 O IL</action>
.":H"l'g#leg;1'.Tilffi+'fu[PeffiC"i.9"Li?1"?flTji':?i"-'il ?;an , )
55 </package>
56 </struts>
!1 - --*-----------apptication6on1."1 *1--C$r11-Q1$€1J3{A f', sP*
I
58 <beans xmlns="ltto,ttt r*.sori"qtr"r "
?y xmtns:xsr=htto://www.w3.orq/200ir(MlSchemainstance,.
60
6l xsi:schemaLo""tion="h.p,l@
62 htto;//www.sorinoframffi
99 hdp/wwrryspmgframewori;rclsci€;;/coiGi
64 http://www.sorinoframework.orqEitternay'coniexviorino-context-2.5.xsd,,,
65
66 <!--Configuringdatasource-->
67 <bean idJ'ds" crass="org.springframework.jdbc.datasource.DriverManagerDatasource,,>
bd <property name="usemame,, value=',scott',/>
Page 1 of3
@ h,ar,t e Smff ftrlon Cr{!l{ hd,rne l! uy sgt;01< d bJ+' Its Leanrd ir spazi ticl c.s spi clo*'-ta"'ra-
thar /nc wrrs an-lltunyn {v!+
means l*u tqw bt Srrurs &fiq clat ds sfr,,i l&rrr ; '.,
{-"6Crnftyv*ta',. ftra
i
41912013 5:02.PM
69 <propertyname="password.value="tige/'/>
70 <property name="url" value="idbc:oracle:thin: '/>
71 <property name="drive€lassName" value="oraclejdbc.driver.OracleDrivei'/>
13 :'3XT;**oonent-s*rn base-packase="gl'> J-F..q rrzer'ilrr" r'd &dh s 4 Pt w':k,'ae
74 </beans>
cl&ss rrc $e sft% 8€a)
75 ----------------RegisterActoni"u"--Gtnrf:l-&.troa
Coo4nu'rzd
76 package p1;
77 imporl javax.annolation.Resource:
78 import org.springftamework.stereotype.Component;
79 @component("regAction") l"r syn+sI k-dooclas6 is cc,nf,'5,,r.J at SpB%Beah
80
gl
public class RegisterAction { 1--r
' in
J
sp;o3donh5 ..tr,ll.o^ e;Q .
this.username = username;
e8]
99
100 public String getPassword0 {
101 retum password;
1O2 )
103
104 public void setPassword(String password) {
105 this.password = password;
106 )
107 // all struts logic here
108 public String executeo {
]!i
111
112
i$i#":J,:i$::ft.";ff:l;ys::ffxfg.*^ii *,,'"r cf ftr"x&* ct"ra
]
return "SUCCESS";
113
11 4 )------------------------DBstore.java (fub+Arlo' Eare ) s F tnS
115 package p1;
1'16 public interface DBStore{
'117 public void storeUser(String uname,string Fiassword); oea\cxal.a ol6'mer$"ol
-'t
1i3 ] - --------DBstrorer,npr.;"u"-frp,-;'g8e'..l)sr"l'3
120 package p1;
121 importjavax.sql.*;
122 import java.sql.*;
123 imporl org.springframework.beans.factory.annotation.Autowired;
124 import org.springframework.slereotype.Component;
125
126 id
@Component("dbs-') P(urrefi} beao
127 public class DBstbrelmpl implemqnts DBSlore{
128 Conneclion con; L Sp""gfnr* Peco ... dt
12g @Autowired -lded .s braSo'xe ohred r, ds r,"op,,-J
rtr.,,.i\ a'-'*ot"t
130 DataSource ds: --r
131
132 public void storeUser(String uname,String password)
133 i ---E-0.-.,toa
134 try
135 i
136 con=ds.getconnection0;
6hF.t 4ryn &e-Clmnej'fjdh 061
' Page2of3
toe ax Gn(lg<re
Io tlis {oq
a4ptualoo Sirn a A-.tto,'' ctar,r as tf',ri B*" 'trtt rreal SgrtnXGa'r 61av oll+
cl..r| . }s
41912013 5:O2 PM
l?!
138
Preparedstatement ps=con.preparestatement("insert into userdetaits values(?,?),,);
ps.setstring(1, uname):
139
'1.7O
ps.setstring(2,passwo;d):
int count=ps.executeupdate0;
141
|j? if(count!=0) -- -d''
Deplogeren+ otrett'y aM/&<Lre
1.4.3. System.out.prinflnc,successful,,);
144 else
175 Successfut',);
System.out.printtn("Not Shafs?.sprtoq Ai-ro
146 con.closeQ; t " rWeO -r^F
147 ) rc€i'ni'i5P
LyP6rar,...t<D L ! cldsses
14a e) )5nar5 )'Ynl
i -":;;"^^"
14.9 citchlException
catch(Exceprion ey fl_
4s,.n.ss.ip fLuu
J I
"."":":::
li:
150 ---"'
e.printstackTrace6; I l-> x''ll [*;ru.,u,
uq' L-------+
f-,i1*.2o, Pr
rsl
lsl
ti2 "'
//don;io-;;b;'-:"'
/d".cio;;b; Fdd''
^
l--*-*'*-t |-$::lT}z"
l--+Re6\E'.tr'*'L
43m - 3.6
Asm -GbaooS'3'a
AStn _ bye e _ A.z
&rmmcm6- P;reudoq d
CBnrfruS-taofl7-3.1 )
Pram sr',inA l'5
ccnnmons-togdin t ---.-
P*rrn,"v -e3lq lg",', srr.*a a sl-
Java55:5r - 3')I O.CDA
I
ognr-Eo.9 )
o,jducl+ -- Pott' otc'cJt
-->
Sh(JJs e - c..rt -73'+ \ ? p-- tn*?
3 slq)
SFInJ -Pltrg;O-2
)'C
i*trg1"-1.t5 - I
NnutY- C.ne- ,. * t J
atg'sP. astn -s,1"1, PEI-EAsE
be4ns-3.t t." "
4 , csttt{<t -3,1 t '
, . Cv-rr -J.t.l ! Porn Sp;n5a't
. . r O\frrsJi dh-J.t.t "
" 'iasc-3ll'
&
., v hJdD -3.1'l r n
r r- qa11-!.5sr11o- - 3't l" "
" . ut5 .J |ru-f6 -S'l l ,
n
Page 3 of 3
h*p r l/ tocar bost', rolo / 6r,trrs?5p', nX Anoo I
'J Jn ttrcrrs 8.r
..---
.J -> NO Brm beons
'---,.
: ftno3beans
a-,.r^^r^pr,ns colu be insr-on'dkd'
.- 5nrrn2 conftSurarrun ft,a. rn rlt,s procas oll the
.J @ P* exampla Gppticarron o.., .'wut6z'x cnd 5pring}'5 rd.cE,.zdJ c',r rt€cn rhe e'0c,llt*}ot
'-J h-ao.o Bn
n o,.t rOf o+lrore
lof o+ /rotz
'j u'rrb' 6o,iq5 d?Pn banet"c4 'rg
.J Pn: oP gccuttoo rel cted lo 5v'a'6 2 ; ac#
.\
Et +'e $*n
.olt)
,.-- ,--rnciPle
Ptnc oo
crr oo*do3
(opprle s do e-rle'5rb; oX
Jrran5ouicnr rmr'a^SerncrLt
A LrseY s\)
rhe afptlcarr oo &o."'
onc*-rhon:r
\\; 6ecuri r3 Service Ctt,oot'r
.\
t ggt.g service C trp" 12g'cF o? Agpucc'frccn e/€{qrtcto )
d6)'
\.t
cvcdldtre JBtsco'nreurrt"
tdbc con611olio$ ( KeEs setcp?ta{\X
gerv lceS
roic{d le c,]e'.e
oppllcalt clo
coe ic ccie of rni dd le&r.Ye 6e ceg &*"'l b in the '
.-n trP ccnl ',r
oP llidJ )eor'te
u'ot rhe cmle
Cod e laecorrrs 3peo- 6c Jb crre o?Pt;cdtl o'' I Y.,o "reusc&i I IFX ) n,t*
advicez
I
\-,a) + Cross - 6t rrinX Corfe,(ng
$e'r"g AOP Te{mirot€teg
asftct hJ iriot
adv ire hlea!iD3
joinr pornl fiargei beon
f +<'Xcr ouj
Prinrcc* Ploxfl Lan
/pnrd ahj
Odviscir
Advl (€ l^ Advlce 3
(Jo;or Point I
\i
fJ ioi.riPoi cr,k
asf€u '- rbiS$e tpecj Fc&fiol c&niaini n3 TUIeJ c.nc ^ "ro lrnp lcrrrnt ts€ rol ddls,n''e-2
Acdokltn€S
SeYViCeS .(rrd.]1c&\.
Odvlce :- Qaal mi dd le{rlavr &yvi ae ohido i 5 zhe imP}rrrf nr<rn crl 4 osfr*
can b awfiel
\--)
jrrir*Poinr;- possi{ol e po6i dong inooJ B si nus rnerhoJ cohsrc dd{';6el
'\--l
,tutnfclrf ;- (u) Lar1d ewhl'thor liotrs 4&i rcs cot$ io;nt r-lru's of \-,
The xmr -h.mrcficn
, \J
b. methocr '
adrrite cro \--l
od^.,isgI :- ad'isr + poinlcu.t 1o gottr,i is Cqled odvtscn ' Oekrce
"+p\':3
rhe &rrr oP cldui sc,Y
'sbrett' \'
gusiner! m&hod ib coi\t be Jatceo \n
"
&. i*"1*g:'ri.or^ is ccued .,1n6'^
3,i3.. 'n'€unct v'utgrr'- '
conel€.,,i.Bbe?-(,d.r r.
,a---,-^ is :-
o* 1i'no31 A+""qo"c''relP-6n"m;ng
*cr'.. sp'ioggcan aas
6p\5ioJ middltoave *:'t;G5 'ofinton
";
cauaatrrecvinS'56n3Aoez&sPectJen|arrezrrren#4k'ppUno'JSntfuJlatl&Yzo'r;F4'
fu^e"ns rb.3 &rnor e'pert fierd le,.t-r 6eo.ving (va";^rt"to-).
I
tirger beo n/ ta$€r Ohle* : -
'SpngBeo.n clc'ls ol-'i'h r€i toe are PlanDinS to
objel-t o.r c.pply'? roidcllerDer( &rvi(
is c"ue d tcrrgetbean
/ u.t6a oa:e.*
.
&tg* ,1A.*"
u'lngSprrngAoP,Ag?e*Jnotool5tDLcoloM@useSp;o3Col)91vg.fsu{,pUed
Y\; lclLe.oe.'e-
ft deve'lop Ure"rde$ned
ll idd lec-care Qlefces cDe o''o t"" '1"
'an
- Ser tcce and
v
odv;crs '
rePt'r Fc'8eno's 1o4 ro
rab '
P," rte a'Uo* + tUfsoe
cldlices
:
:
tD proced(ye to der.'etop 65xrngAoP krsed aprioX crppliccrllon.
6KfokDe\cloPfuriogl.*crR.ce,spnogBec.n"-,,|'-,n&lsinesg''ffhodder-tanccHoa<>
defl'ni iiorr s
e'x'\'r"
Sr'r1@ '- c lienl ftlprlaxr * \
;';J;t"'g*Y [ec''-'r'm'x ^ fipprica*onG''rc"t ) "
-> ohial &-
9:Lr.z{ pra,,.'y
6F 03 Coatun641
F
Detr',o
Oe.r,oB.ar, 'iavc\ CsPY\h g Beah )
-se51
- l''lX Adv;ce . iav q (&Pa Advire';
F- sHDgcfu . al'ol (sr,,''g cfu P;rt )
clicoi App,ic.vc (crienrAee.,)
// l'lgAdvlre 'java(Before nari.\-
irnfxr* Org . SP" c.oP ' X\
! ll""t*oa
3 lluo's
fSr-"31"t*
R'* )
f/ Demo' Jd'(c^
Demo
pub\ic irLtel&ae
oP B'rrrbod
o.Lr'. vo\e *HarofSunJ
*'.u); llu'
l
S61 clarK )
tfor**"'l.'.,". (sr'"3
c clc'\s DetnoReavl ihrpltrn#rs ftrno
frr.di
{ 7,rn6ut,.no.r,* op- G rnerho4 \
)
lxt$Ic v614 so1|Jello f Sr"n3 nam€
"'-Fnaras;,'
3op("Derru&an: exat*ton Q &Allerrot) ----+ Nanc :
*tn
S.o.e( tn tn " )
l t DmYPr
J-.rsq1l-leuo ' /7
z?m?ery narne -- ffe{?edMmi' .-..{-
L.: B' n-rthoa tr.rn e
4kot'>
Los
on t_aYg€r ohje6 4 afPldlni adulce --)
z\,-- rru-,s cfj $*n p'xl ohj H
''PPub' ctQss : orf ' sP ' oo? Flo.,re'l:o'k ' P,o*6f,"ft1y Ba'n
'>
Aao id = ?e
Dh
L{hnf(t ty grorSJ-rzruiaas
' tlafug ="D"*o" /7
Dar',e = -f,-ry."a, r,'*afaca
LtYbptrtX rnme = tovgel" "eF =
T--tgy.^ote
" db" l-
Lwwry nam€ =" ;nrocerr;rNa'e'f t
LLi6t >
z\tar/? > advr 4ValLtt >
-T-
Lt
Allst > Advtsc. o 6jera
ZlVnpttW.
Ll&an.
zlEzns"
// CrienrAPP' -Pva
L?ofrtctiftJ naroe --
*
advi ce ' t6f =
'' adv "t,
/W(r\ 0orr€ -- fntttxn \&r)-rr e = .*" l>
LlVa$>
I invopetnf*3##"Jl 6'at'ers
Pbtrc obiear envirbbnpnr- cF rr.,e "'r+p4'
c
L
g' ner$ocl
ir.proceed()1 /lcons *'e
'-'-'-':' & r\e B rrrf:oo
ll exentrcs af $t ent
'
3
c*
.
ftr kb*+
Avound A&lcc a?pnO to oPPnCD
ftr, excrwte cpPlicct$cD cr$ rhe
Lru*i ,
b6'n3 Pn jouo
D
Version i 1'I
\Ttndor : o4ruche
(v"Mn c'n
.J
etse
I n ou; rrrdl- Do{ r€ cnx?t"))
log3ar ' cdccr ("Re'ctrtSt+
l
.- --) q6t "erfo{" re,x-l gs$
$"[ b\$w
to*z}) b\&w
cc'*a or g"ocDn ExcaH'rts'
o( Era+rt-l'
L^ ,r,"
thar Dan4rc>
uLov-no@n
- use .9o*ol
' lo4 in Ae u!4 RctJx
tr3
t .......
:
\en&ti"tx
sc) llv"'o"
-'\ //v'"n e"c"gtlon
"":
1 ct'rtlt 661.E&4tion
(
&lch lExcePticrrr
e) l/ ".t'*(Pn
{ L uornoto
Po"re"l):
' to'U* ' e',o-t
*
te-me'oel)
::. ;d
.!:$trfjf1t3u "_--G#".-l*,t.cr.$
\
\1"ne., to$er = "-*t** poi"rrng o TcsrArp cloN-
Su*icTacol motrod
7---
lo6Xer.deh'6 ("t rrrt" ) ;
lf' .d"ki (.l.,aroa. ;;
ft1at'dor obj ;
.-, ryuku dr. dtlnn"rt"n otr1ert J"'-|,r.1 ,,:c can ..ar;r€ lo6tott"tr+(t*
\nt ou;,-
*+ TJ- Can !e t0
,{sad t0 (rrxrv,n2l lk [rlivc"i ]- + lo6 wreur'1es '
clatscz o-v? \i
) -Ihe aPia-Iable
W
'
-ll*'4*
S"o,J-,'a'*
-,---/
P"t*'\-6*o
X-,1--"6o"t and etc"'
;; ffi;'-x.ti# Y-;X:i-'l--*'."
-1Fiat V'a'llan \ua;te'
,^''
@) &'ru<'rw''rya
"fro"v'a G'utce
uje g'axr 'rn"y)
'
'n
ti;r) f,h EJB csmPs uls
{ t'st
kqln Tronsacncn
] car'rrlExcootlo'r e)
{
bllb'ruc Jiansoq'ncm
1
qJ
I
a-
lomscrylc'n rr{mt Siues S.{tttt P" ACID f'o1rrlrr"r imPleq"rvrro#an
(
A :---) Atoroocirg
(, ----+ Gms;src.rX
L ----+ Solcrflcrrl
D __-___.'
Drlrrbili rg
4 t;yle u*:O;i#j},,
-+-[fu pwes Cornbtni',g fnu]ttplt { retr"a iyrvidlar op'ra$ond iwa
-llre 'Airrnoorg" " - 'l
alo,d &arr. Ror th. ,^6 flrnm'
:- $*fl]n * doia c"t Violo'red *\'*
- :lj
Cr.srrc.q Ev,^ ,.rlen k pt .k,f'.kge
c't-il* eod^Yt'
c(
no rule Vioufion
i &Tram6c@tlon in fiere it a Y*'.'X
G^s;src* cp'l' '
;;;;s; code' rhr"r ** olt I cou"e 'r
a-{&'"
"-t
-fhe Prex oP a6d;n5 lott
",ffi"+
doJ^ u'ndaltorotnJ
-- J*roI*: -
enab[n6 ' 165 Jt"Lanon
ilc Lro i< calltd
&rr{. to nonlp"la}e
^ fuhk'^t
J'+7
pevarl^rs Cunc-attTenl
anJ $rnulhneou-l opam'l-ltrns
S"iLU;ri,l:-
tl@0lik)
Tfc o.biritX c,(- b''i"41"6 DnBale slo L.r^to rwrrsl skrlc
n is furw-'ptcA'is cotrd
h*Sh to6f;ru 6nd L'o'"'t fites urh'^ &rtt-bort
rrrde'n1 Et3 r.s ths D-.rabls &t'J^t'
-[he Arfirc.rurf og Tntsaon on Tlc'noBerur+
Tranrd4lto Hamn€4
(Gdx! tnitft.ctlans to
r\tu{'\ QE 4r.LrleturF,( lD
r^-i r tr nnl,ark flrt TaqoaU
arcr*e n".t'1av(S-)
\--l
Trenc{m{nf6'
D,srru*ei fia^ceatranl
' lelo+l:'t:
gpt(2fiole crroroit) pt*t
'I{6 {on dn Po- 'pBslto * Ia@
' Disrrib.,recl
Loill Seel' pr.rmis5lcrr =:
-Ihe DisrnbLradT)' trncroEd
Io pbaret,
ccwr'';'1+(a
the Tx, Tl
. ..n.- *,on tbe Dsn*q+r.t
S 'oittbe
oPto{ b*
Ijn ghsea.,, iFotl Dbslcl]s
u'tlt be s'
'rollbccck '
fn
ottc'cdse $e o'*t'*'
./otacl. @insel ) r
"r" 9
dlo} to! -r
+
&- .1€3 u fo
t (ptr.s"z)
,t- ^^.t,rr>.-\
Dishiurrtd t".4 tPhare! )
iabxcomlt Tr')
1 rmrcr6ed
{- eS Q can-)
?bsez')
rf
0Ua-!al)
' 0f| 3l{' s -an I(ortn;t-l
-,,
1_l
)e5 u cat
1"")
trboSg
lt"sasf" rrudetS
,.'\
rPc're FairS
A,calrozht......-
3,rrygm<-
, futrcadl
.4
:
..
5
tur' s oirh rlesr<A
ftah'tattlo\
to q 6fco d'PPn 'rhat
hlhtn *€ oboL€ to&r plon is Siuen ho+
jottt n eY fi c^L4tl aJr(
l"l
fut one o, ofl'o^r
I
&!blx E
{ n.f I 1;<-t a b<roHq
i41r
J
=
g.lb T'( n
,{ .,rcX n Ti&er kobl'q
O Ut g-."Ttt satronflcunnu
--r b6te
J0 emble n ogrnb an idua 1t"t;tunce
Lo6\t
O l+u'*.t"T*r, atttaoYbqa SCn0
no,.n
OPJ1 |tk'*J.
h.ik'c"r Y'*lsxnce
-faT ploa'kb'n"tt ^
---)'t0 ercble "r ^
@ T.oti nflt.**to "oY\ottrya -llpl;ol. g'csrc+e lq;c'
'---aao ue!.e
-To
t5* on
dnd erc.'-'
.,. ohl -lio'nsoorro"llattt* oU b fr r b*e o$'crr-
-U creale Trc,.rsortl*nTe,nptarc da5s
, ,9 f* nf,"t Dao rnod.r.te br6<d local, Flat frc'nccctlaD manc'flerDe4 in pvoyvayct]tl c ary'ro eLL)
fie 1lcXcno's tt
r {ttt
re9e,r oao@ oF
DedoxoHLr€
-tri
,-tr} ,nn-t -la'u'"u*t lt4fl"l ilu'rwwos B'*'l'dr &nvzttn
,,m
03r s.*i,e
cl;crf Sl-d,rdttd/'1}
-ihe 6 n a#nu,'tcs
r) rqP:td
r) wryArdneo
a) cqoo/rs (deh*lt)
a) Nor s4ur''tct
4 tP^a'ru1
() rucuor
i
c09:- Tx aftdh.rtr5 Q{e oor rE4dJYe d roh)e &afrg cr:rtb PaD$aYnari c 11 vrgmt '
rDKi Jroneo4lo6Teraplore cE{sS Dor nEiY€d d,;te deouo5 oirh Dqlc'^s'n-Tx rrgmt'
s'methad
4 derlr+*/ clicQr catls
Thi6 B.rrfrbo4 rLtns cot$ neqo Tr
iff€lPg$ue
., (EdYes n€ro:-
f ,^*
[*"
s
L
---
l-- ne.oT x
() (rrs")
STnr
i- The garc
I
oofr
4 Tx irt cr;.nr cfPn o,"o .dffrr"r9.
y;3:^i:t&a
irQ me {"'"'
S&?p(Xtg
()
:--; J*""
umr
I
TTA
_l oTx
fu
clienlAPP bYnr t)
NOTX
brnr( )
TTA
.
1
thrn s an E^cz$lo"
vuntatotl
61;eq AoP br&t )
NO TX
\
l,
1^h \
NOT}
@ r.ro*o,-
:-
Nctro{
ctienr App btrqc)
blr)/() NOI} ,
f.-
T}A
I
N]OT)
q
m0st u.sed Tx
PoFratlS Atkribur rb KEYed '
rl ......--.
{lE oePaut+ Tx arhdhrc iS $r?P ctrr
ttre EFFecxof lx a*trttrres :-
Beon 5 -Traosacfi
cLient'6 Trc.oscLfl cfi!
TRanscrcHctn Atlri bcrte
Tg
Qeqlrire d rDne
Tl Tl
Tz
Te
DTOC
Tt
|tcrndofor1
ClrcruAPP'jav( t- lal
sG-t as rhe cuerLt o{PD'3o\,^ cf lnSzr>o''
ur'rh '@1ic'socJ''<ttnt o
Oh* Jx dh\hatcs tplute tm'tr4nrtr ?T&a*'Bneucee -
.- NE\^r'
P'ops"rr<'o'
P;";;;
rp' P*P6"ff4n" l-\kNDAT0lLl -,
ir'$ irnPlemento-tlorr.
: i'rplenenAt
Ana 16 6ilranaacrlonl'lc'rr'3w
j Akornik'g g.p\ie' gp€dal idbc dr-ive16
.!- * €clrrtij X
Sgcl'r-',hd
N et@ or F Laue I
pro1zt1 rbr dc'-lz^ rtr't i3 Have)llql otc{ ttf r€nrrl k
:----=;1" rtrr"c''-$
ta'Lf rctre 4 tfr.ie
. ---. Apprfrudan detclopc-r-s aye nor rs fgrSible {" *rtS , pet.-ut1 crdnlos rrrltr
\t f;'""rot's a.d or$al
! AmrirgAr,n !&El
D-- -Y A',6o'
zarto"
*ns6;zr*lon
" " ''-, re6rxm6i btc {"r t{"s og"aH o"*
Pmtr..mYners 'rYg
.--a Che,u'ng $re rdeft}; q oP a USe'. is CaSteA Aud1en61crjl<ro
/1
Cheo&log Ih e Accers Pe,. rn isstan a & o' O1y.n cfn Ye&r.dcet is CaU e d fluntril1;2e.Hc/ .
-+ \-/
Ib [s 4-i,oordc "rexomended Fo errabte g€oalYitb Sewlce s 6\ appl;(a.}'torl i\, Dealan-e*lce
-> 'aJtr"
mode " trA oe Oan ure t 6r fi." t'""rr. 6ori g1m1 ge.lzn1 Plo he"a''b/Le
r2
\
-) i
l6peJ.J Annotottoo 5
j'rva crrss os rhe Advlce elc4s
Ta rrnle $e
@ Aof*a "-"-n
_-- ao Pqnt fD B'"rrbods & \vsf&e,.n c)ax '
@Porn G.t
d;;*"ri
6O*O'-"1"0u
----
------'
-ro
-To
*o
T rna[e i: *#;
rhe 'pnr*dna as -fhrde ^o"Jt'-'-
as
HiL*'*
,,,a\< rbe iarn w+-d exawra.-
@A,oc,-a ^*:.:H^*iH:*,"u
t*;'1
6 g.*:,:::T.T. riu ,m
"ff &T,=ii
'ltstBclro ' iar,a
^=
4
/ trgmr,'t 'J*" *
anooturtao' )
1.,or,- o.g ' *P*ti ' lang ^
@A.p".t
hgletctl-
p.'blic. cr(rrg hg ktct+ u + rr""d
g.,,,.rtots4Jd"0B"-
,, $c g''"atats
'*' ' " ''*' xz t\ '\ t ,',mrcur te'dn3 h alr
L(d,?o,ntrnu
(''e"o*rr* (* 141:"rcr '*("))')3*"r* ,
6irnpli ftea rbe Pmaess oP delt'lbpin3 nVc[, c.rchi l-tz]Ltw brrse d' Llr.b cLezt>$ '
Nekaort ____-_-___-_,
Rom open $lmphong
e Orkr rbq, btrnt is @ alldrs rD 15p r/elril5, Seerncrl FCn, osp, hrt"' t
a) dds not otlo(' fo
uJ ,, P
Lo'X crr
Fahnolqies )r) vlco Lc[er.
$rarndo6ies in victo
crn e!€/t Jc,l:q
@ era1z*s dqlrtderlt3 l4elrtt'o
re$cu(ce rL"u*z -laqtzmT;"rana
R'rmbeanS @ uses 5(,$n1r5 &-dlt-io
" @ th,r** ptu6io 16 io penb,. sl
drry,
ord qtdn8nvc
TermrnolqS rcru*;n3 bl(o 5?dir5 4'A
3Prin8 rovc
6ltdi 6 -i 'x
Ter mi oo I og5
e-...--
Dispor.r.n&*ter
Acttuo€e{\det
&rnrrotle I &.rv let Ca;rnr,raotl class
furn9ean cl'acS
Gnnrmod &nftDlter
Aalao ctc':s
Spnog cfu ere
Srmrs cPg ffte
l-Dl5Rl,.tler5fr\'lcrlSicrlrarne 2 -
ZOog hleoar0e>'lro\
8e!',1+' xm)
4a66,5PNocLrdJ
Vie!) Qcidvc'rs ar.{ Vk"rs
(to canBSrr. Qoarrr o"Ses
)
ModetlrgVierr oklp.r
€anf ct6 6mua 1')( etoc,f,
' Flur: oP ereornn in Sp"% HVc aPPa :-
laleb terver ApplicanooSe' v<e
!dabdpfn
rrart : [-----l
L--------J
*8.,
ontrlmrcC,- -,
\@ra:
I--=l +'d 0
)
[r^r*ion ':'---6t%1c)
N Y ro rbe diog.tc,rn i-
apgn sB*tc't '
0 F{otrornr.e. dePlo$ee5 SPri ag t'lv c t'Jcb epPn in L'&t&wcx Cc'rl J
rf' ?he &rr,tl+ it coitl be iOSn'l*l cr'r-c
@ becCrult Og locid,orr- stbrtT.+ €fdrt€f, DlSparztpr
girter duving furr,cr su1,t -rp crr dc.ving flre &t%.rn€nt 6( ot'fupprt '
@ lrs D;urc,r.1", &*q.. affruarS aJ,) o4fro Gnrcxt cailz,)yLu I rz.ur"6 B[i!+lz#tt4h== .-
<Dser.t*crss'rrc+lo6nanaroe) -sewr€r, xral as rbe $.rr'g ConltTtvann Sre f' tfisfroic+t -
rhe b.,ns, Cn(:VoA tn fu1 e*,eV"*yor -!'rc 76tn k f)/t-t,lola!
I1o+<e '
-ou
\J
CcnrnanJ 6rntmtterr ctass i5 sp,, +nr 4rf--de'f ' --1 n-il clat! flwlt iffPlerP'Lt
'6
616 '.**,,3 &.meco 6{F , ulrs' ,"*,.ri ,-" ' G"*a
lot (i"mtt'e;
cfus'
the oor;og &rn9,gurafio. Pre oF SpinX lJebrn\l c agt) 6{ttutn5 $s frro{oi"'3
o v;* Qusolve.rs.
*tt
1a s'eth *"
Vieco Qp561vg-{'- lbrs Le.. te lp...'x?tto
conprxuro$o.} ::t"t: ctlrsncrme
\r*gj' ltrrs \'rlt-oQest'Uen
r*r* A..O9O Ont* r€5csY'es oe 1;a6
\crvies ha,re d csr1 ioe {ieao Lclcx teehn o\oX1 toP u Se '
T&hnologl name
vie(oklotve'{ cl4ss (deft"rr
- Vic'ol?eolver )
' Org sg ' co'b 'Yie1tr ' 1646a[[2cscirrce
J6P- "*'tvet
lelocrrg 6s.sp c,,tb 'f,'tLt''''":';:Y#:::tiaoResdr,e.,
or! "af c'tb ' '9e lt+ '
vra
P'errcovu -l1LesG"'63"w
' hLes' v
e!'s?'c'tb ' sertt<t v;at
tlres
,15rt (x,',ssrstrclLcrns<tse
t ur] :,'a ;; * ' *'^)el vieru' xstt' Xtt'V;-i1s';H**V,-Pt'at*
^"" i;'t;;;';#^j victtt .
jas?u(46rs ' Jc'r'crl€
o./urer -' uic{t
_, gadtet
016 (P'Lx-'zlt '
.L.sp{ reporr6
C"-a@ G^*J
*mps onct n,ur*presE;dns fu linr fu fir- urts(reluesta''ts)oorrfr
^
clctre es '
G*nrttat
(} org.+.*u. S'mptE'- G^t.nrpr i- useR^r to banale sing)? srbmit vt*n %'ow'ne, W thp R'mpa?t ..-
servrf .rovc.
frurr t( )atrp<-}r qnder *t Cd'.t'dloroP Co-nrroUc^ &rr/tf . 6tw.s anG-r.ar";fG,-,.t')weina 76
-
O q.<f &rg. edt4'hv. ' AUr*+['t-Grt"f ,v y I f
Ptt{8 rbe Ye?levr
h latdz) dr"o\ ' B+!4
uc.f.,r to ha,nJln 9i61e ra-Lmir lut n h-q roX", l"ni-]r^e 4^^po4' a^
vu*a -.tv tr,orr;,.( r(e 'vlgqrrt .
I,r^arc Peayrxt )
&nP"i
@F-^,-.a" 6cr.re,ard
e
* pos{ ' mer{rod ** ff::;qr:ffi"T;# sr#-
eyt*- cotrl' G""^'njGnrnlit" dorA "'u'*
"bcrmes ' :"''"--
av\& Ltrr{ $t t\eG^na,r*G,,trdk".; tt^Ib to ltroceYt fie "tr1Ferr-
- E*r:r"le fil.t;caUo.t
o@@
'.:l|P (wtttnoc ma. Nab afpo
Plsnar=1*" *,an
1i+:fum!! rr.ge=
oo&,a'11q-ll
u
id:
rl t..t't,.ln "'''
Oorrf,:
t--_--- i
ol],ae'.
_ 6 :"_, ^
sr+s oQ z,\o+r>.rs o'.I]-.*u.
). i"#*s
.w*h,"
tTff;it*tntt*
Gi Tnde'isp
e?'eljJJe
::lh'fT
. Q) Ed*.
*a1',,sr'mt,"'barecLEd{nu') '^
6t"'z't
i-fl'an
ny^[q"#]*'l*'^U Y*'*, '?*;t;;*t;
' anA ta'lc"* ?un' l-'*kt
. 'h:s
,\ -trt4s the \eerft;r (*t:-'- gl*3
D'rpat t ovSi,.utef
*rr,ns an''
a,,J Jaues
qprst
'- *
?,""ondCa',wrc,r..,^ rh
rn L.l:alr.nn6\ "
(rop,"ire)*- **'
@ .._..
ltnrs rbe
r"qlrrst c"or
c-or
Fr
I,X ;n*K
(:_/
-rt'e S'-ortW'Ut'rJtf1"o;ot 'tag
.
u
il, gts;,"#ml'*ff Q
Yo^, ,r^)o* $ryL Dopont"'G*rc+-'(n?: t+'l\2611 )
anJ Gtrt;a 4+ o47ur
(,.+t*ttr;
&rrfo,r o.
--@ *r,0, BrLg.,frtne r'14er (reto-eros)
Duwrc\pt},'v+ ia4s anA 1ov'z fl'e
: O q1*t k<""*
- b eote c's @ p** da
f ^ t, o,.t..n*.-^t-rrr,r ) koo',no *oh +o
Ve'gfuiog the lJ"r.cr and tafFevn 4 rbe Eyltl ddlct Grreg tr-fl,*r E.ymVa ti dorH crrs .
-,
/- l;r{aJcru ploq.
ur Lrse \Vo (or{)
n
dctk"/ -Io g" t<'rn1
--2 In f,t'tut' Crpplicad.n5 , \'I io X Lrtt/& \krti
.--'s[,nr[l'1vc&wn3grcresscfltTfo-'!fzvo-lVatidcdonsiolitt-lebitGropiex'drdrrot
veraioo)
Forrn Val idan'on5 in SPriDg rnvc oppn6 Ce'6
1' cticr*a; de
a. 6ervc{6 i de
n
r,nlu omarrrrncrfic kt rnlC' lida'tlOns Crvt -- a.l5 liYofr&mcd\ c +{ Fl vt'ltdo+tt"s ure for:Jale
- ffr'it olrui! ttr d"*t e E,-\aliaoNu., llles iir 91e,role jc'rraclc.v( *d tlut j^o", doU -
&n beusei in ou lain& o( s6r.n-6 a'ggns indu&'5 g'nn,lluc d4Pn{. ?,1' clo,es MrLtt -
iyr)enz*s a6 +,-71'"'reta^t'. Va-ct'l.n V,r.t'*.n (t) .rJ -r,-rs+ trrrovictc
't"rgleraa"ttc.
14 '
kn*t rVUa"re( ) r,,rAocls. r,Cui" n.'ug
L1..rJr.2 io6i< In
ioni< ;n \Al;ao+66; .-
\h-Udo v,aa?.""{ u-tcco/r {ak i{e
9qr* 4 ,a;e*Xx* GlvarLodr & V*a.H-(J*rs crcdj
4t\,
Lltikt,b"n>
llu\7
>
zlsp"tg I bo"B;"dFrrs
a+lo'rlPr:
sPrirnmvcft'* 6
gPnng3
imprtenr cnmrch0n6 oP ^"u"''i,;
I_ -- tb( sttaarx"
band le lD( ' "r -"tl:--*:*.J11*:"#
6it-&a'on*
," er*rg
-+ Jn rrvc tr'
er*rgrrvc tr'bandle
elals & +ye"
tr.r16 fcnc-fa*ro llu" "nl
le'v
dGar-l
a ftrrrr
pc'Xe Loe mrtst use tbe G-rtno