Seam - Contextual Components

Seam - Contextual Components
A Framework for Enterprise Java
Version: @version@
Z
!" # $%&&'( ) *
$%&'( + &,-./ )
) 012& 3456 789: )
) ;<&=> )
) ?,@,@ 6 ABC +
)) -,D-EF45 GH-6 IJ#
BC \
)+ EF45 KLMNOP- 6 IJBC g
)Q ;RSTUVWX 6 YZ[ g
)\ ]^ TUVWX 6 _`Z[ h
)a b cd 6 e
f
eJZ[ k
)g ^ TUVWX 6 B`fBZ[ o
)h ^ ijTUVWX 6 Y
Z[ o
)k l 6 JZm[nJZm[ o
)o ^#I TUVWX 6 YY[
Z[ )) /pqr )
+ %GFGstuvwx6 yz{ +
+ ;<&=> Q
+ ?,@,@ 6 |JBC Q
+) -,OEF45 6 |J|JBC \
++ EF45 KLMNOP- 6 |J|JBC a
+Q l6 JBY g
+) /pqr g
Q } B~| 6 *f€ wx h
Q ;<&=> k
Q) /pqr )Q
\ ‚OK6 ƒ„…2†‡ )Q
\ ;<&=> )\
\) /pqr +o
a ˆ‰Š 3456 ‹,Œ +o
a Ž1 +o
a) Œ&‘’ ++
a+ “”&=> ++
aQ *m A •=HM–H Qo
a\ —˜F™‚ Qo
g } B~| š›œˆ‰Š3456 €€ - Q
h ž` š›œ 6 ž` Œ4-,‡ Q+
k I^*e[ 3456 [J Q+
k Ÿ~A Ÿ ¡ |¢ &š£ QQ
k) –FG¤Gtu¥¦§¨‚ Qa
k+ I^*e[ 345& Ÿ~AžŸ ¡ |¢ &š£ Qh
©C©
f ¢Z[ ¢Y
) fJ š›2 ª1«" \
) ª1¬­ \
)) ®¯° ^
[Y K‚PG&EFF \)
)+ ®±&G45²³´¬ \Q
)Q G45&µ¬O¶‡²³´¬ \\
)\ ·¸&—N¹-º»345¼/²³´¬ \a
)a ·¸& ~#½^+ ?,@,@º»345¼/²³´¬ \a
)g ^#I¾¿%345—KM´¬ \a
)h }ÀÁ‹F—KM \g
)k Qo % š£´¬ \h
)k Qo &M- \h
)k) b ) I &M- \h
+ ;,Ã-ĸ;RSŗ \k
+ ;,Ã- \k
+ -,D-;,Ã- Æ[ ZÇ ao
+) M¹;,Ã- ao
++ ‚;,Ã- Æ~J ZÇ ao
+Q “”;,Ã- Æ¢C ZÇ ao
+\ EF45;,Ã- Æ ZÇ a
+a l‚S-KE-;,Ã- Æ Y
ZÇ a
+g 345;,Ã- Æ#YY[
ZÇ a
+h ;,Ã-ȃ a)
+k ;,Ã-¥¦ÉÊËÌ a)
+o ÍÎÏ(Ð=ŗ a)
+) ;RS a+
+) -,D-EF45 aQ
+)) -,OEF45 aQ
+)+ ?,@,@ a\
+)Q C a\
+)\ ÂFE‚Ñ/¡ aa
+)a MNE45 aa
+)g ;RSÒ ag
+)h ;RS-;&dÓ ah
+)k ԃKÕÖ;RS ah
+)o ×ØÙØ;RS ah
++ ˜M‚PG45 ak
+Q HMOMGÂÚF< g
+\ ÛÜÝÞM- g)
+a Kߙ g+
+g |`[ MNOP-} ©I[à gQ
+h OáG}•=;RS ga
Q ;RS&cd gh
Q Kâ,@cd«¬;RS&cd gh
Q) YZ[«¬;RS&cd gk
Q+ ãÁ䯜cdOáM h)
QQ cdtuvKâ,@&¡ h+
Q\ å| Ò­æç&š£ hQ
\ M¹nMNENnèéÐ= hg
\ M¹ hg
©C©
f ¢Z[ ¢Y
\ ‚G45 hg
\ ‚âHÂN hh
\) êl†45 ko
\+
êl†45n‚G45nâHÂN&dÓ£ãÁ䯜OáM
k+
\) ¢YfC C k+
\+ ;,Ã-ĸM¹ k\
\) MNEN ka
\+ èé•=´¬ kh
\+ èéë«ìH8G45 kh
\+) èéÐ=í¬ kk
\++ èéÐ=“¯2ï,45š£´¬ kk
\+Q èéÐ= å| š£´¬ oo
\+\ Z
Y oo
a “”}ðG--&•= o)
a &“”Å— o)
a) S-ñòœ“” oQ
a+ ó^* G?-š›2“”ôª´¬ o\
aQ õ6[ö÷ } õ6`÷ &š°ºœ oa
a\ ³ø&ÂFE‚ og
aa ù[ C oh
aa ¢J [ C ok
aa) I
J [ C ok
ag ðG--&•= o
ag ðG--•=} b êl†45 o
ag) ðG--•=} B~€ ‚OK ag+ “”úûüý agQ “”wx )
ag\ –DF<GH‡ Æ
`Ç +
ah “”¡;RS} b ;RS&˜M—@™ +
ak ¢
[[ C[ Y Q
ak I
mb
#BZ \
g ‚OK}l‚S-KE- g
g %&‚OK g
g ) Ö&êl†45ŗ h
g) } þ¬ÿN )o
g) B~€ ‚OK&š£ ))
g) ‚OK&cd ))
g)) ‚OK&ôª ))
g)+ ‚ï<}Āā )+
g)Q OK&Ăă )Q
g)\ OK&Ąą )Q
g)a ‚OK&Ć³ Yććć )Q
g+ %&l‚S-KE-•= )\
gQ B~€ l‚S-KE-dÓ&š£ )a
gQ KE-dÓ&cd )a
gQ) GN€&0Ĉä )a
gQ+ l‚S-KE-&0Ĉä )g
©C©
C
f ¢Z[ ¢Y
gQQ N-Gĉû…2 )g
gQ\ N-G- )g
gQa N-G&'( )h
h }Ċ–‚PGċD45ê¤Fș +o
h Ž1 +o
h) •=H8G45 +
h) €`[J fJ +)
h)) ¢eJJ J +)
h)+ *
à
mč ++
h+ •=&ij;,Ã- ++
h+ ~# % •=&ij;,Ã-š£´¬ +Q
h+) •=& ž` EF45š£´¬ +Q
h++ •=&ij;,Ã-}Ďďv“” +\
hQ ~# З†đš£´¬ +a
h\ ^fĒ ½žĒ % ^ š£´¬ēĔ +a
ha ž` O@Nš£´¬ +g
k %& b O¶‡˜—45 +h
o óCà J Q+
o óCà Q+
o) ]J YY[
óCà Q+
o) ]J óCà Y Q+
o) ^à Q+
o)) Y QQ
o)) fJ Q\
o+ €Y[à Q\
o+ €Y[àJ óCà Q\
o+) ùC JCà e[ Y[à C[Y Q\
o++ fJ Qa
345OD‡ðG Qg
MKĕG45 Qg
) žĊ–‚PG Qh
+ ĒàĊ–‚PG \
Q ¢[[Ċ–‚PG \+
) I[ \\
) &0Ĉä \\
)) AJ [ e Y \a
)+ B~| KE-dÓº»š£ \a
+ à \h
+ CC_ \h
+ ]m
m Jm e à YY[
ć \h
+) IĖ \h
++ €`[J à \k
+Q #m
\k
+Q ¢eJ \k
+Q) ]J m
m ao
+Q) àI[ÆÇ ao
+Q)) Y
[ ¢ a
+Q+ ]J [J e a
+QQ Y[e ¢eJ f à a)
©C©
C
f ¢Z[ ¢Y
+Q\ ž[J à ^Z
Y a)
+Qa J I
a+
+Qg ž**~ #m
a+
+Qg ]J €J #m
aQ
+Qh #C
#m
b aQ
+Qh AJ à ė ## eJ aQ
+\ ^ |J a\
+a #mč a\
+a ¢ Y a\
+a) J Y aa
+a) *m ©I
aa
+a)) [ ag
+a+ à m e
ag
+aQ J YJ ah
+a\ J ^ ak
+a\ ^à à _m ~# go
+a\) ^à à _m ž` go
+g ]J à I[ go
+g ~ CC_ g
+g) ¢eJJ [ e[ g
+g+ ¢J à [ e[ g
+g+ ][
Y m
ö g+
+h à g+
+k ¢#~*¢ž# gQ
+k ¢eJJ m ¢#~*¢ž# C[ gQ
+k) #J ¢#~*¢ž# e gQ
+k+ ¢J m ¢#~*¢ž# [Jm g\
+o à ^C g\
+ ^ZJ m à Y ga
Q Ęęä},¤ Æ[č mÇ gh
Q K3 gh
Q) H¹ gk
Q) H¹dÓ´¬ gk
Q)) H¹Ěz´¬ ho
Q)+ b
ÂFE‚ ho
Q+ NM‡ě ho
QQ ,¤ h
Q\ K3},¤cd&GFЫ¬ijä h)
\ *Z h+
\ O¶¤F&Ĝˆ h+
\) K™H‡;<ĝĞğĠ„ġĢ,Ã-&VW hQ
\+ G h\
\Q ž*| &VW h\
a *Z ~€b J hg
a AJ ~€b YY hg
a ¢J hg
a) *Z ^[ hh
a+ ž b k)
aQ ¢mY k+
©C©
C
f ¢Z[ ¢Y
g
h
k
)o
)
a\ kQ
aa *`[ ka
ag €
¢ kh
ag ¢[ [ kh
ag) #[J [ kh
ah ¢eJJ *Z kh
a) ¢mJ kk
a+ )og
aQ IJ _J½#]* Y )oh
a\ bm )oh
^[ )o
g ÂFE‚p³´¬ )o
g ģÝ )
g) ž*| ½*Z ĤüĥÁ ))
g+ ԃ&ĦħĨ ))
gQ ԃ&ÂFE‚ ))
g\ ,D&p³ ))
ga Ęęä )+
gg !&ĩ&ĪFĕ )+
g) [ Ħħ´¬ )Q
g+ cd )Q
g+ [ )\
g+ # & ù€ FGF )\
g+) cd&E45 )\
gQ |[_ )\
g\ N™ )a
īÍĈĬ}ÂFE‚™ )k
h īÍĈĬ )k
h īÍĈÂÚF< )k
h) #à
m m _m m Ēč €Y
m )))
h+ #à
m C ))Q
h) |JJ ))Q
h) ¢eJ ))Q
h)) J J ))Q
h)+ I
CJ J J JfC ` ))\
h)Q I
CJ J m [ ))\
ÃĭF4 ))a
k %¢
mĮ£´¬ ))g
k) ‚įİ&ÃĭF4 ))h
]` C
))k
)o ¢eJ ~
öJJ ))k
)o) ¢C[ ]` C
))k
)o) # I
Jà )+o
)o+ # ZY[ _` C
)+
IJ )++
) cd )++
)) ŸŸ Ċ–‚PG )+Q
)) ž[[ ][ )+Q
))) ¢Y )+\
©C©
C
f ¢Z[ ¢Y
))) ¢Y_
ÆÇ )+\
)))) ¢YJ
ÆÇ )+a
)))+ ¢YJ¢YùÆÇ )+g
))+ IJ )+g
))+ IJ
*àYÆÇ )+g
))+) IJJ*àYùÆÇ )+g
)+ ^C[J ^ ^ZY )+g
)Q GHM MNOP- )+h
)\ ;,Ã- )+h
)\ “” € &cd}ıØÙØ )+k
)\) I [[ _m m C Y )+k
)a ˜FG?- )+k
)g —NNM&IJûij° )Qo
)g Ĵ,@–¡ ½ ĜˆNM )Qo
)g J ¡ )Qo
)g) ù` ¡ )Qo
)g+ [ ¡ )Qo
)g) C )Qo
)g+ ĵÝ}ÎĶ )Q
)gQ ^ )Q
)g\ ;DG45 )Q
)g\ J )Q
)g\) |Y )Q)
)h —˜F™ķu )Q)
)k ÂFE‚K<´¬ )Q)
)k ÂFE‚Èĸ´¬ )Q)
)k) K—@™ÂFE‚Ĺ´ )Q)
)k+ L-N‡&K—@™M‚3N )Q+
)o ĺñò¬—NĂă´¬ )Q+
)o Ļļ&O@<Í´¬ )QQ
)o) |Y } ;DG45Í´¬ )QQ
)o+ ĞdNM&Ċ–‚PGÍ´¬ )QQ
)oQ Íͥ×ØĆľĿ¬ )Q\
) | ÂFE‚™ )Q\
) cd )Q\
)) | *Y
–-GHM–´¬ )Q\
)+ ČFG&–-GHM–ŀŁ´¬ )Qa
)Q R™&KE-łŃ´¬ )Qa
)) m óJ[ ]` *[ö )Qg
)) ¢eJ )Qg
))) ~YJ à Y )Qg
))+ žöJ Y ó]* _J m Y )Qh
))Q ó]* # *J )Qk
)+ YJ b_ö ńĆ )\
)+ ;RS YJ ` M‚PG´¬ )\
)+) YJ ` ;RSM‚PG´¬ )\)
)++ YJ ` ;RS´¬ )\+
)+Q -;& YJ ` )\+
)+\ AJ YJ ~[e*
|J )\Q
©C©
C
f ¢Z[ ¢Y
)+a AJ |J ~
¢Z YJ )\\
)+g AJ |J ž` YJ )\a
)+h ;RS}¯2& YJ #YY[
¢Z )\g
)+k AJ YJ *ö^Z
e ©#à
m )\g
)Q ž` m )\k
)Q )\k
)Q) ¢eJ )\k
)Q+ AJ )ao
)\ ¢eJJ Y
öJJ YY[
)a+
)\ eJ )a+
)\ JJ _m b à C[ )a+
)\) AJ e
[ )a+
)\+ I
C[ )aQ
)\Q C[ e[ )aQ
)\Q ^Z
Y m[J )a\
)\Q) ¢C YYJ _m )a\
)\Q+ |[Y e ` )a\
)\QQ ¢m
J )aa
)\Q\ I
mb
)aa
)\Qa à JJJ )ag
)\Qg ¢Z J e C[ )ag
)\Qh #J e[ )ag
)\\ JJ _m à ^ )ah
)\a €ė eJŅ )ak
)\) ¢eJJ C ^^ \ )ak
)\) ~
öJJ )ak
)\+ ¢eJJ )^^ )go
)\+ YYJ ž` )g
)\+) YYJ ~# )g
)\++ ~
öJJ )g)
)\Q ¢eJJ C ^ņ _m ^` )g)
)\\ ¢eJJ C ^ņ _m ^` )g+
)\\ [[J ^` )g+
)\\) ~
öJJ )gQ
)\a ¢eJJ B~| )gQ
)\a ~
öJJ )g\
)\g ¢eJJ ~[ )ga
)\h ¢eJJ b * # )ga
)a ¢Q )gh
)a [[ Y e ¢Q )gh
)a) *m B\½`öJ ZY[ )gk
)a) öJ ^ZY[ €Y
)gk
)a) ¢ Y
)gk
)a)) ^Z Y
)gk
)a)) ¢eJ e[ mJ )h
)a)+ [J m B\½`öJ ZY[ )h
)a+ €Y[àJ m YY[
¢Q )h)
)aQ €Y[àJ YY[
J fJ ¢Q )h+
)aQ óJ `
fJ YY[
)h+
©C©
Z
f ¢Z[ ¢Y
)aQ) ¢mJ e Y[à ¢Q )hQ
)aQ) ¢eJ e[ mJ )hQ
)aQ)) ^Z B Y
)hg
)aQ+ [J Y[àJ m fJė YY[
¢Q )hh
)aQQ ^ZJ ZY[ _m C J ¢IA€ €[ )hk
)aQQ žC fJ J à ¢IA€ YY[
)hk
)aQQ) žö Y [ m
J à _ ¢IA€ YY[
)hk
)a\ bmJ Y )ko
)g ^#ė ]`[J
)k
)g [[ Y e ]`[J
)k
)g [[J o+*~ )k
)g) ¢J à ]`[J
)k)
)g+ ž_ ½Y½#
à )k)
)g) *m B\½`öJ ZY[ )k+
)g) ^ [
ö _m ]`[J
)kQ
)g) à _m m *
m ~C_ )kQ
)g)) *m B\½`öJ ZY[ )k\
)g)) J Y m mĖ[ )k\
)g))) ¢eJ [ mJ )ka
)g))+ €Y[àJ m #YY[
)ka
)g+ *m BY `öJ ZY[ )kg
)g+ [J Y[àJ BY `öJ ZY[ )kg
)g+ J Y m )kg
)g+) [J m ZY[ )kh
)g++ €Y[àJ m ZY[ )kh
)g+) ]mė ee _m ]`[J
oZ )kh
)gQ €Y[àJ YY[
J fJ ]`[J
oZ +oo
)gQ IJ fJ Y +oo
)gQ) ]m mJ e ]`[J
oå +o
)gQ) ¢eJ e[ mJ +o
)gQ)) `à mJ +o)
)gQ)+ fJ C[Y Ye[ +o+
)gQ+ [J €Y[àJ à YY[
+o+
)gQ+ J Y m +o+
)gQ+) [J m YY[
+oQ
)gQ++ €Y[àJ m ZY[ +oQ
)h |ė ]`Ym +o\
)h ]`Ym C Y[à e +o\
)h [[ C Y +o\
)h) IĖ YY +o\
)h) *m B\½`öJ ZY[ +oa
)h) ¢eJ e[ mJ +oa
)h)) [J m B\½`öJ ZY[ +ok
)h)) ù_ [` Y
+ok
)h))) AYJ m `[Z[ e[ +ok
)h)+ €Y[àJ m YY[
]`Ym +o
)h+ *m BY `öJ ZY[ +)
)h+ [J m BY ZY[ +)
©C©
Z
f ¢Z[ ¢Y
)k
+o
+
+)
++
)h+) €Y[àJ m BY ZY[ ++
)h++ ]m ee e ]`Ym a ++
)hQ €Y[àJ YY[
J fJ ]`Ym ao+ +\
)h\ ¢mJ e Y[à ]`Ym +a
)h\ ¢eJ e[ mJ +a
)h\) ¢J m #m
#
^ +h
)h\+ ^Z B Y
m mJ m `[Z[ +h
)h\Q [J Y[àJ m fJė YY[
]`Ym +)
ï,45 +))
)k ;RSd,45 +))
)k) ˜M‚PG45£ï,45 +)\
)k+ ;RS&HMOMGÂÚF<£ï,45 +)h
)kQ ;,Ã-Ňň£ï,45 +)k
)k\ )^^ ʼnŇ% C ;RSš£´¬œ1&ï,45 ++)
)ka èé£&ï,45 +++
)kg IJ£&ï,45 ++Q
)kh MNEN£&ï,45 ++Q
)kk īÍĈ£&ï,45 ++\
)ko b š£´¬œ1&ï,45 ++\
)ko b *`[ }Ŋ£´¬ï,45 ++a
)k —N˜M—@™£&ÂNï,45 ++g
)k) âF3‚™£&ï,45 ++g
)k+ –DF;,ê}ńĆ´¬œ1&ï,45 ++h
×ØÙØ ;RS ++k
+o ;,Ã-M‚PG45&;RS ++k
+o) 7,@,@;RS ++k
+o+ Ęęä},¤&;RS +Q
+oQ “”Ăă´¬œ1&;RS +Q+
+o\ B~| ŋŌ&;RS +QQ
+oa EÃ,@ŋŌ&;RS +Qa
+og | ŋŌ&;RS +Qa
+oh ÂŋŌ&;RS +Qa
+ok Ĝō}v¬;RS +Qg
+oo |
[[ Y +Qk
+o Ğğv;RS +\o
b ;K +\)
+ N™ +\)
+) ï,45 +ag
^ +ak
+) ~č ^ZY +ak
+) š£ēĔ +ak
+)) ž +go
+)) ~B
+g
345&,- +g+
++ ;RS&7ŎF,- +g+
++) 345&ńĆ,- +gQ
++) AJ ö J +gQ
+++ J J YY[
+g\
+++ ¢eJ +gh
©C©
Z
f ¢Z[ ¢Y
+++) J *J _m |
ö € +gk
++++ J *J |[ +ho
+Q ŏ +h)
+Q B~| —8Mê } l +h)
+Q l‚S-KE-—8Mê +h)
+Q) ‚OKl +h)
+\ ĸĬ +hQ
+\ K‚PGĸĬ +hQ
+\ ; +hQ
+\) I
mb
+h\
+\+ Â +h\
+\Q ~€b +ha
+\\ I[ +ha
+\a ~| +hg
+\g ó]* +hg
+\h YJ +hg
+\k óCà +hh
+\) |C š£¯œÄ¸Ĭ•= +hh
©C©
Z
YY[
e_ö e ^Y C Y `à m e[[_J
Y
Y[6
 ö e ŸeeŸ
e e Y [ e [[ ` [J
à YY[
#
Y à ` e[ņ _m m _m à e C[
_[[fe Zņ [J m [JfJņ Yņ ` Y
f
Z m C Zņ _m
m YC [Y[ _` Ė *m `_ Y Y ` [J
f
Y Ő [à à YY[
J _mC m
à
Cņ m m `J e
mm à YY[
[J
[
[àJ m e
Y à `à _mC ` e CYY e_ö àė
J à
A[ö Y[ C ^^ )^^ Yņ Y à [[à _m m _` Ė m[ [ Æ_m m YYJ _` Ė [[à C m YÇ Ő
Jm `B
m m YY[
[àJ Y Y à `à m [ )^^ Y[e
_ ó *mJ ][[ņ mJ Y à J ĖC[ [à m
J őm ee
m à J m
à _ YY[
_m m [à m_ mà _ö Jm
J b _m ^ +o
b ^ +o _ e m ` _ e e C ^^ \ ^+ ` _
Y [ e C ` Y
[J
|_m[ņ b J Y [ e m Y Ae[àņ m Y f
[ `[ [C [[ Y`[ YJ `à [e ņ b ^+ _ö
` Jm m C ^^ \ Y
e
YC _à Jf
m _ Y [ b[àņ m e `m [ e_ m
YC Z Y [[_ Z J
_m m e_ö
e m Y [ e b ^+ņ [J J[ ņ [J
m C[Y mö ` m ` Y`[
Y`[ _ YY[
_m ŸCàmJŸ ^ *m à Y e àė möJ e ^ fJņ f
[[ ŸmCàf
_JmŸ `B
ž_Cņ C +o m Y[[à mJ m e ^ e
m Y e C_ e m C[Y # ^ efJ `B
őmJ f
Y[Z m C C J à ` b
[Ņ
 m m mņ e à Ye Y ^ +o m ņ à ė mC [[à à C [ à ` Yņ YC [[ m e
f
©C©
Z
[à m à ZY
e Ÿ[Jm_JmŸ ņ ņ e à Yņ ^
m_
J ##å
YY m ` Y bf` ##å [6 I
mb
¢^f
e
*m [ [ à ##å Y`[à à e
_m m
_ à C
Y #[C[àņ YC `[f C
Y J [à m [ à [[
Y à
m[à e [f C
Y _m m e f
[à Ő C `
` Cf | Y
C f
J C ##å Ym
ùm e m YY
m _[ _ö _[[ņ _ e ė `[f f
à Jņ _m
m m à efJņ àf
m ##å Ė m[ e[à ee
[à m C Y
e [ Y[[àņ YC Y ` Y
J C B~| Ő _ė
`[C m_ à Y[ Y[Z _öe[_ņ [[` ö f
J J B~| C [[_ à e Y YJe[_ J m [JJ
ÆB~€ Ç m B~| e ` Y
e
b YC `[à m C [ e m Y m
m [ `à ZYJ B~|ė ` Y
[ C C Z
[à m C m[J mņ YCJ e C [ e ė e Y
[
€
[C J
]ė [[ m Y e [C J [C
à e m [à à e ^ ^ +o C [C Y
Z J *m m ZY[ e ` Y`[ e JJ m _m Y
[ Zņ _m[ J m [[ [Y
_m m Z ö m Y e [C J
m em YY[ YY[
*[[àņ )^^ YY[
f
Y[ J [[àņ `à JJ J C[ Ė
` *m YY
m J m e à `J à
[ö _m YY[
e[ [ Y `ņ _m f
_m ee _öe[_ [[ [f__ YY[
m m
Y[ [ [à [ m [ e `J
€
[C YY[
J Y`[ `à m m e m f
Z [ e `à Z m Z [ e `à m C[
Y
őĖņ ņ YY[
ő_m _ _ Ző
C `
Y
őm Je[ e m Y e C_ e m ` [J
Őė[[ ` č m_ à mJ `
à J C
žC à C ee Y [J _m [čà e
mJ I| [
[ö ž` ~#ć ė Cf
Y Y
Z àė[[
©C©
ZC
[à mC LazyInitializationException žC à C m Y`[ _m m
em `ć *m `
ö `ć ]m Y[
e `ć ]m YYJJ f
J Yfmf
ć ė C J [C m Y`f
[ _m à C J [[à mö ` m *màė [[ àY e m
`ö J m
m m ` YC[ m [ à
e m _`
B
*m e C e ¢[ Y
à B
Z `m b ^+ņ _[[ f
[[ Ÿ[Jm_Jm Ÿ | e m f
Ymč B
e Y m Y[ [ C
^C _m
B
e e[ Y YY Æ
m bÇņ C[[à f
[ e m[J YY[
`
m Y e m e[ Y ` e _m ee
e[Z`[àņ `
Y `[JJ _
Y à ` B
Y `[JJ _ Y
B
ee e ¢ m à
ņ Z[ņ `
[ Ő
mö e m e [J Z[ C`[ Æ m C
Z ` m mÇ ` e m Y B
[[_
f`[à e e[ Y `à m C [[_ Y e[à [à Y[ m C[ e Z C`[ņ B `à JJ ` e m Y
]öY
J [f__ `_J
YY[
[ m e[à _
m `_ [Y[ `_ `ņ m f
_m eeņ e[à [ņ C #YY[
à C ö f
CJ e _öY
Jņ [[_J m _
m `_ C
Æ_öY
Ç J[ `_ ` YC [à [f__ Yf
ņ ` [ [f__f[ö Y J[ __Ņ
~e å| *[[àņ m C à m ` e Y e ` Yf
[à _m ö e fe eJ )^^ YY[ Ÿ[Jmf
_JmŸ mC YC å| f` Y[à Y `m e mJ
_m
m [à eJ`[ `_ ee Y[à e m àņ e à
m ö [ _m
m [à ` ZY C C \ f
mJ [[ m
^ +o `
Ÿ
eJ `à Z
YŸ m _à YC e m [C e Ae[àņ b [[ mC[à Y C` å| eJ e[ Z m f
YC `à ^ +o _m e e [C J
[C Z *m [ à [ m à b J
` [ m Ė å| B m e _m
m [à `f
[J å| Æm b CJ [Ç
J J à
Yņ `J Y[ C [ņ `à `[ e f
Y[Z YY[
ņ J [ ee
J J m f
[[à ` à ee
[ ö e C _` YY[
*meņ ©C©
ZC
YC e `[à e YY[
e e m e_ö Ő
[à _ A *ùó m Y
_m[ _m ņ
Z
J [[ Y e m à Y e m C_ Æm ~ b
[
YJÇ Ő m [à à €^ņ _m _[[ [[à
Y[à ^ Y J ^`
*m Y
ė Ye
] mö m [ e C ^^ J _ ö_ ė C JJ ` Ye
]m m m[ m Y
e
Æe ZY[ņ [ m b [e
à
[ e ó^* ĖÇņ eZ m # m m e _öJ _m m ¢~ ZY JY ö m eZ ö m _à `
ö m Z C e m *mė _` YY[
m CJ ž*| YJ
*àė _` e_ö mö [[ *mà [ à J Y ee e f
à C `B
# m mà [C à mJJ # [à Y[ _` YY[
f
e_ö m[ Y`[ [ö Y
ņ àņ à
m
àņ
Jņ àņ [ņ JJņ ~€b m Jņ _öe[_ņ
_öZ Jņ _`C
ņ mJ 
à m m e
e
ņ àė[[ ` č m_ à Y`[ `
Y[
J ~# ž`+ e Y
ņ m ^ * C
Ēč
e [Jm_Jm à
m
àņ B~| e _öe[_ņ I[ e ` [ņ
|[_ |[ e [ņ ž` m e e[[ Z mņ | e
JJ ¢
m e YJ eJ mJ [à CC [f
` à e_ö C ## I[ *mė C b J [` e
J ~€bņ JJ [ņ m _öZ Y à ` [[ àf
m[à ]` C
ņ à
m[à e [f C
Y óJ[ ]`
*[ö ņ e ņ [à e b
ó _Ņ
_ö à C ^^ YY[
Cņ C _ö *
e à Cf
YY ^ +oņ JŅ e ėņ Y`[ņ à ė `[f
J _m ~# ž`+ e Y
ņ à Y[à
^` *
ņ J e[[ YY e ^ +o
m m ` e ņ b ^+ m Y[ _à _ Y[Z _` YY[
C Ő _ė `[C m_ [[ ĖŅ
©C©
ZC
!"#
$%&#'()*
Œ&%Žn # Q)o sĕœK<ñòœŔ&}¯2”ŕ1Ŗ´ŗ
Ŗœn &;ČŔĕœK<¯2n pؗ@DGřôñò2°¬Ŕ&}¯Ŗ´ŗ
Ś &—@DGŽnśŜ&’ŝ%޳ñò2°Ŗ´ŗ
ş
]` ‚nM‚µ¬°Ž-NM4Žn examples/registration/view µûŖ´ŗ
ş
TUVWXĝ—NMR-GvŠ&Ú-Žn
µûŖ´ŗ
ş
C Ú-;<Žn examples/registration/src µûŖ´ŗ
ş
# l<-GŽn examples/registration/build.xml µûŖ´ŗ
examples/registration/resources
+ ,-.$%&#./0
š0n$ANT_HOME
}
$JAVA_HOME
sŢ¯ţcdñòn
#
sŢ¯ţM-ñòœŒ}Ťť¯2ţŦñ°ŗ
ŧn
M-¯œO¶ĕµ¬ build.properties OáM # Q)o
&K345cd¯2ţŦñ°ŗ
ŖŦ./¯2°vŨòũn
&—@DGº»
bin/run.sh
Ŕ¯ţŽnbin/run.bat
}NM¯2
345˜./¯2ţŦñ°ŗ
ŧn
examples/registration
—@DGº»
}Ūū¯2&l<ë«ì—KM(›2ţŦñ°ŗ
ant
deploy
–Hœ8º»n
http://localhost:8080/seam-registration/
ŬmY6½½[
[m6hoho½fJ½ŭ GE-¯2ţŦñ°ŗ
1 ,-.$%&#/0
š0n$ANT_HOME
}
$JAVA_HOME
sŢ¯ţcdñòn
#
sŢ¯ţM-ñòœŒ}Ťť¯2ţŦñ°ŗ
ŧn
M-¯œO¶ĕµ¬
build.properties
OáM
*
ao
&K345cd¯2ţŦñ°ŗ*
ao ×ØÙØ M-´¬œ1
)\\ņ ů[[J ^` Ű&M-HG45ű›2ţŦñ°ŗ
×ØÙØ Ž *
ë°2345s/p´¬œ1Ųų%´ Æ×ØÙØ
š£ĿŴ *
% Į£´¬Œ}Ŕtu%´ŵŗ
ŧnexamples/registration
—@DGº»
}Ūū¯2&l<ë«ì—KM(°Ŗ´ŗ
ant
tomcat.deploy
šŶn*
./¯2ţŦñ°ŗ
©C©
–Hœ8º»n
http://localhost:8080/jboss-seam-registration/
ŬmY6½½[
[m6hoho½B`ffJ½ŭ GE-¯Ŗ´ŗ
*
—KM¯œŷĆn ^+ ;RSŽn
;,ê ÆŸŹv-N<K ^ ;,êʼnŇÇ qĥ%p/¯Ŗ´ŗ
2 $%&#.34
×ØÙØ
^+
56
ź}ŻŠ&Ž *ùó ńĆ,--M“ż¯2°Ŗ´ŗ wŽžſv,-'(Žn
examples/registration
—@DGº»n
ant
testexample
}¯2./ñĿ¬Œ}%´ŗ
Ŗœn뚰& €^ º» *ùó H™MĮ£¯2,-'(´¬Œ}Ŕtu%´ŗ
1 789. "&!:;<%= >?@A$%&#
789:Žn—N¹-®±78&78Òn
'Òn
â-ð<—N¹-ƀ¸%Þ¬žſv345%´ŗ
Œ&Ž
&ƁƂvķu&Ź2ƃĿ¬Œ}Ž%ÞŖĿŻsn b G45-ê}¯2 ^+ EF45
š£´¬ēĔĝn ĜˆŠv &cdēĔƃĿ2ţòŖ´ŗ
^ +o ŖŦƄƅòvēŔ°»›¯Ɔ¬ºŔ¯òŖĿŻ&%n Ƈ›ţûŕ12°ÞŖ´ŗ
š0&‚Ž
+
Ö&ŪūO@<ÕÖĜˆŠvO¶‡Ěz¯Ŗ´ŗ
¯nƈƉŪū¯2O¶‡–ĴF¯2ţŦñ°ŗ
Œò%78Ċ–‚PGŽ—N¹-ƀ¸ñòŖ´ŗ
1 BC.DE
Œ&Žn)
©C©
Ö&
~
‚n
Ö&?,@,@
}n
)
Ö&-,D-EF45 %'Ɗñò2°Ŗ´ŗ
Ĝˆº»ª1¬œ1n;<ƃ2ØŖ¯Ƌ"ŗ
1 F%3G3G = User.java
78—N}¯2
^
?,@,@
sŲ’%´ŗ
Œ&GH-%Žn
ï,45«›2 ijĬ } —Nƌ…Ĭ¥ƍ ƎƏŠdÓ¯2°Ŗ´ŗ ;RS}¯2&GH-dÓ´¬œ1nƐ°ţÖº&ï,45ŔŲ’%´ŗ
^ZY[ @Entity
@Name("user")
@Scope(SESSION)
@Table(name="users")
public class User implements Serializable
{
private static final long serialVersionUID = 1881413500711441951L;
private String username;
private String password;
private String name;
(1)
(2)
(3)
(4)
(5)
public User(String name, String password, String username)
{
this.name = name;
this.password = password;
this.username = username;
}
©C©
+
public User() {}
(6)
@NotNull @Length(min=5, max=15)
public String getPassword()
{
return password;
}
(7)
public void setPassword(String password)
{
this.password = password;
}
@NotNull
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
@Id @NotNull @Length(min=5, max=15)
public String getUsername()
{
return username;
}
(8)
public void setUsername(String username)
{
this.username = username;
}
}
(1)
(2)
(3)
(4)
(5)
(6)
(7)
^+
Ƒƒ
@Entity
ï,45Žn
User
GH-s?,@,@
%µ¬Œ}z¯2°Ŗ´ŗ
;RSŽn
@Name
ï,45%Ɠdñò¬
;RSÒ
sŲ’%´ŗ Œ&Ò­Ž 345ŀ%7ŎG%µ¬Ų’sµûŖ´ŗ b
s

;RSÒ}͏;,Ã-ȃ&>Ɣƕ1¬În
;,Ã-ȃs!&}ÞƖdÓ
Æ[[Ç
%µòũn
ŽM-N-²³¯2º»®¯°M-N-;,Ã-ȃ˜M<¯Ŗ´ŗ
Œ&%Žn b s012 user }°"ȃ}ƗƘ"}ސn Ž User
M-N-ä¯Ŗ´ŗ
sM-N-²³´¬ÎŽn ŲŴ;RS& —O¶;,Ã-
µ¬;,Ã-ȃ®¯°M-N-˜M<¯Ŗ´ŗ —O¶;,Ã-Ž
@Scope
ï,45š£¯2dÓñòŖ´ŗ
User
ŽEF45-;&;RS%´ŗ
^
Ƒƒ
@Table
ï,45Žn
User
GH-s
users
,–¤Fșñò¬Œ}z¯2°Ŗ´ŗ
namenpasswordnusername
Žn
?,@,@
&ijƙĬ%´ŗ
´ƚ2&ijƙĬŽGE-ÂÚF<sdÓñò2°Ŗ´ŗ
D-R-&Dĕ™OPƛë«ìŗƜ&ĸ®OPƛ%
b
«ûŒ&;RSsš£ñò¬}ސŲ’}vûŖ´ŗ
æ;-HGNŽn^ } &Ɲē&ƞƟº»Ų’}vûŖ´ŗ
@NotNull } @Length ï,45Žn ž` [ OD‡ðG&wĥ%´ŗ
Ž
ž`
[
ńĆ¯2°¬œ1n
©C©
Q
(8)
—N&ƌ…Ĭ¥ƍŒòš£´¬Œ}s%ÞŖ´
š£¯2°v°ŷĆ%Ŕš£tu%´Çŗ
^
Ƒƒ
@Id
ï,45Žn
&ƠÃƙĬ%µ¬Œ}z¯2°Ŗ´ŗ
ÆijĬ
ž`
?,@,@
Œ&%nŔ›}ŔơƉ¯2ź¯°Ƣ’vŔ&Ž @Name } @Scope ï,45%´ŗ
Œ&ï,45Žn Œ&GH-s ;RS%µ¬Œ}±d¯2°Ŗ´ŗ
śŜ%Žn
User
GH-&Kâ,@Ž
ƣƤ
b
;RS˜M<ñòn
ŗƜ&ÈĸOPƛ%
b
«›2ƥŪñò¬Œ}sľºûŖ´ŗ
~
‚}?,@,@
<ÂMŗç(ÞƦ´¬—N&;ȐƧƨv;<ŽŲ’µûŖĿŻŗ
¯º¯n
?,@,@
ŽH8G45•=ĝ—N¹-GE-(ľv°ŽŴv&%n
b
&G45-ê}¯2Žš£%ÞŖĿŻŗ
Œ&œ1n
sŲ’}vûŖ´ŗ
11 43
Œ&;RS
EF45
H4IJ;<% KL4= RegisterAction.java
ź}ŻŠ&
345ŽnEF45
G45-ê}¯2š£¯Ŗ´ŗ ÆƩؐż2 C š"Œ}ŔtuÇ
b
345q& b G45ŽŢŤ Ö&Ø%n ŒòEF45 ÂÚF<s
ÖG¯2°Ŗ´ŗ Œ&%Žn G45ŋŌ´¬ƪƫŽ´ƚ2 User «›2ƀÕñò¬œ1n -,D-EF45 š£¯2°Ŗ´ŗ
&ŀ%nˆ…ơƬ´ƚÞ;<ŽśŜ&Ø%´ŗ
^ZY[ )
@Stateless
@Name("register")
public class RegisterAction implements Register
{
(1)
@In
private User user;
(2)
@PersistenceContext
private EntityManager em;
(3)
@Logger
private Log log;
(4)
public String register()
{
List existing = em.createQuery(
"select username from User where username=#{user.username}")
.getResultList();
(5)
if (existing.size()==0)
{
em.persist(user);
log.info("Registered new user #{user.username}");
return "/registered.xhtml";
}
else
©C©
(6)
(7)
(8)
\
{
FacesMessages.instance().add("User #{user.username} already exists"); (9)
return null;
}
}
}
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
^ Ƒƒ @Stateless ï,45Žn Œ&GH--,D-EF45 }¯2¤G¯2°Ŗ´ŗ
@In
ï,45Žn
«›2M‚PGñò¬
&ƙĬ}¯2¤G¯2°Ŗ´ŗ
ŒŒ%nŒ&ƙĬŽnuser
ÆM-N-ȃÒÇ
}°"Ò­&;,Ã-ȃº»M‚PGñòŖ´ŗ
^ Ƒƒ @PersistenceContext ï,45Žn ^+ ?,@,@ ^à |J
M‚PG´¬œ1š£ñòŖ´ŗ
@Logger
ï,45Žn
;RS&
Log
M-N-M‚PG´¬œ1š£ñòŖ´ŗ
G45-êÂÚF<Žn—N¹-}ĝûIJû´¬œ1n Ƒƒ ^+ EntityManager #~ š£¯nb §¨ Æ
Ç ĺ¯Ŗ´ŗ ŒòŽEF45 v&%n register()
ÂÚF<sƭũòœ}ސn
H8G45Ž¼/ŠôªñònĄą¯œ}ސ;ĴFñò¬Œ}ƮƬ¯2ţŦñ
°ŗ
%Ž
^fĒ q%
b
^ ¿sš£tu%µ¬Œ}ƮƬ¯2ţŦñ°ŗ
˜FG™Hœ<%(ľò¬œ1ƃýŖĿŻsn Œò«ûƯĻ& ~# setParameter()
sƑƒ ~# Query Ċ–‚PGƭìƗ´Œ}vûŖ´ŗ ưĮ%¯Ƌ"ć
Log #~ Žn,DäñòœK™ÂFE‚rƱĚztu%´ŗ
b
G45-êÂÚF<ŽnŧŠ&‚Ěz´¬ºƔd´¬-™Ɯ&§¨
Æ
Ç ĺ¯Ŗ´ŗ [[ §¨ Æ
Ç Æµ¬°ŽnC G45-êÂÚF<Ç
Žn ­&‚ƲĚz¯Ŗ´ŗ ƯĻ& b %Žn §¨ Æ
Ç º» b C_ Ɣd´¬œ1n
ļ
b
êl†45±Ƴ
š£´¬Œ}sƯĻ%´ŗ
Ôƴv345}›2nŒ&çƤŠƵƶŽn'£ŠvƷ°ƅ(%´ŗ
¯º¯nŒ&«"v}2Ŕžſv&œ1n Žn§¨ Æ
Ç }¯2 b
C_
&š£tu}¯n
êl†45±Ƴ&Ų’ĬIJûƸÞŖ¯œŗ
§¨
Æ
Ç
}¯2
C_
š£´¬ŷĆn
Žnļ–Hœ8ĕMDG("Œ}ƮƬ¯2ţŦñ°ŗ
ŽnƹĻ&ƺƻ>ƔƼƽ´¬œ1ƾţ&
×ØÙØ;RSƿǀ¯2°Ŗ´ŗ
FacesMessages
;RSŽn
,Däñòœ?Hĝ³øÂFE‚rƱĚztu%´ŗ
×ØÙØ
;RSŽn
M‚PG45µ¬°Žninstance()
ÂÚF<ƭìƗ¯«›2IJǁtu%´ŗ
ŒŒ%n@Scope
ǂzŠƓd¯2°v°Œ}ƮƬ¯2ţŦñ°ŗ
Ś
;RSNMŽnǂzŠ-;sƓdñòv°ŷĆn
—O¶&-;sǃ£ñòŖ´ŗ
-,D-EF45
&—O¶-;Žn-,D-;,Ã-%´ŗ
'ęn´ƚ2&-,D-EF45 Žn -,D-;,Ã-ƙ¯Ŗ´ŗ
Œ&EF45
&G45-êŽnŒ&ďñv345&œ1n
l‚S-K‚FG}ijK‚FGƿǀ¯2°Ŗ´ŗ
ñ»Ôƴv345%Žn
;<DŽDžä¯ijK‚FGsdžLJ&—NGE-;RS}v¬«"OáGN
©C©
a
™´¬Ų’sµ¬ºŔ¯òŖĿŻŗ
Œò´¬&Žžſ%´sn
Žn345&DŽDžä&œ1ĞğvēĔLj’¯2°v°Œ}ƮƬ¯2ţŦñ°ŗ
ñ»nŒ&EF45
Ž
]^
G?-
Æèýũn
User
Ċ–‚PGq&O¶‡&ƜÇ
ŋŌ´¬;,Ã-GE-´¬}Íΐn
H8G45ÚÆEntityManager
Ċ–‚PGÇ
%ƀÕñò¬ƪƫŔGE-´¬Œ}ơƉ¯2ţŦñ°ŗ
űƦ&
)^^
Ã,Gĭº»&ÁljNJvûŖ´ŗ
Njûĺ¯Ŗ´sn
űƦ&
)^^
&DŽDžä&ēsš°ƱŨòũn !nj»&ē 345'Ɗ´¬Œ}Ŕ%ÞŖ´ŗ
œŦ¯n ƾţ&345}›2ŽµŖûǍǎnjŖĿŻŗ
12 IJ;<% MN#O%PQR4 = Register.java
…ǏnEF45 ŽnKLMNOP-sŲ’%´ŗ
^ZY[ +
@Local
public interface Register
{
public String register();
}
C;<Žś$%´ŗj°2TUVWX%´ŗ
1S B%TU%
VWXYZ = components.xml
·ƾţ&
C
OD‡ðGš£¯œǐǑsµ¬ēv»n
K‚PGs³ǒ´¬ÖòǓǔǕÞţvû•=¯ǖţv¬
å| OáM;RSGH-´ƚ2ƎƏ´¬Œ}Ŕ!&"njƅò2°ţŒ}%¯Ƌ"ŗ
%Ž345;RS
å| ÝǗ´¬Ų’sv°Œ}ǘ›œ»n
ޛ}ź›}´¬Œ}%¯Ƌ"ŗ
ǕĥÁ&
345ŽnźŻ&Ǚ¯&
å| ¯ºŲ’}¯ŖĿŻŗ
Ŗœn
Œ&
å| ŽK‚PGsǕÞţv›2°›2Ŕn
µŖûǕÞţvûŖĿŻŗ
!òŔººľ»Ŵnµ¬
;RS&
µ¬
éĥcd&±dstu%µ¬Œ}Žn
ƾţ&ŷĆní£%´ŗ
ÆАn
×ØÙŖòœ;RSÇ
ŒŒ%n)
Ö&ǚǛsµûŖ´ŗ ¯º¯nšŔǜǝĬ&µ¬ǚǛŽn WEB-INF —@DGÌǞ´¬ components.xml
}ƭũò¬OáMcd±d´¬Œ}%´ŗ
nù€
%
^
;RS&ƃÖŨēƓz´¬œ1Žncomponents.xml OáMš£¯Ŗ´ŗ
^ZY[ Q
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2
©C©
g
<core:init jndi-pattern="@jndiPattern@"/>
</components>
Œ&;<Žnorg.jboss.seam.core.init }°"Ò­& ;RS&
}°"Ò­&Kâ,@cd¯Ŗ´ŗ
#
-Gs345—KM´¬}ÞŢ¯ţ
ù€
TǞ´¬œ1nǟǠv @ 4ÿsµûŖ´ŗ
jndiPattern
`[
Y
1[ \] VWXYZ = web.xml
Œ&ďñv345&Dǡ,45DžŽ]#I—KMñòŖ´ŗ
TUVWXsŲ’%´ŗ
ű›2n]^
^ZY[ \
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<!-- Seam -->
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<!-- JSF -->
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>10</session-timeout>
</session-config>
</web-app>
Œ&
web.xml
OáMŽn
}
345%Ž°ÖŔ͏%´ŗ
©C©
b
cd¯Ŗ´ŗ
ŒŒ%ƃ¬cdŽn
h
1^ _ `a = faces-config.xml
ź}ŻŠ&
345ŽDǡ,45Dž}¯2
b
lš£¯Ŗ´ŗű›2nĻļ faces-config.xml sŲ’%´ŗ Œ&ŷĆnldӐ
b
[
š£¯Ŗ´&%nb
,D?‚}¯2
b
[
š£´¬Œ}Ɠd´¬Ų’sµûŖ´ŗ
^ZY[ a
<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/
<!-- Facelets support -->
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
</faces-config>
b ¤S‚< ƎƏsƄ’%µ¬Œ}ƮƬ¯2ţŦñ°ŗ ¤S‚< Ž ;RS}¯2ï,45sÝŨ»ò2°Ŗ´ŗ 345%Žn facesconfig.xml ŽƯĻ& b }Ǣƚ2µŖûš£ñòŖĿŻŗ
'ęnĜˆŠvVWX&cdŦŨ(ýũn
Ŧ
©C©
k
%´ÆÖŖûnêl†45ŖœŽB~|l‚S-dÓÇŗ
%Ž KE-OK
} cd—NŦŨs å| }¯2µ¬ƚÞŔ&%µ¬}°"ƃē¯Ŗ´ŗ
Œ&žſv%Žn
C_
êl†45±ƳñýƄ’%´ŗ
G45;<Ǧ1ÙŻŦœ1n
1b ] VWXYZ = ejb-jar.xml
OáMŽn LM–ŀ&´ƚ2&EF45
ÝǤ´¬Œ}«›2 ^+ }ńĆ¯Ŗ´ŗ
ejb-jar.xml

SeamInterceptor
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
version="3.0">
<interceptors>
<interceptor>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor>
</interceptors>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>*</ejb-name>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
</ejb-jar>
1c ] deVWXYZ = persistence.xml
OáMŽn^
ijK˜Mĕn
—NÚ-&ŷǧƓz¯Ŗ´ŗŖœn¹ĕĞí&cdġŻ%°Ŗ´ŗ
Œ&%Ž./ΐ¼/-ä?Ã-Rtu}¯2°Ŗ´ŗ
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="userDatabase">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>
</persistence-unit>
</persistence>
1f g = register.xhtmlhregistered.xhtml
345&l‚Žn
R´¬ƾţ&Ǩǩš£¯2'Ɗñò2°Ŗ´ŗ
«ûÉò2°¬}Ǫý2°¬ b
[ š£¯2°Ŗ´ŗ
©C©
b
Œ&%Žn~
o
^ZY[ g
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<head>
<title>Register New User</title>
</head>
<body>
<f:view>
<h:form>
<s:validateAll>
<h:panelGrid columns="2">
Username: <h:inputText value="#{user.username}" required="true"/>
Real Name: <h:inputText value="#{user.name}" required="true"/>
Password: <h:inputSecret value="#{user.password}" required="true"/>
</h:panelGrid>
</s:validateAll>
<h:messages/>
<h:commandButton value="Register" action="#{register.register}"/>
</h:form>
</f:view>
</body>
</html>
ŒŒ% ǫí}v¬&Ž <s:validateAll> N™&Ø%´ŗ Œ& b ;RSŽ b
ġŖò¬´ƚ2&ŪūO@<?,@,@ Ɠdñòœ ž` [
ï,45«û¥ƍ´¬«"Ɠz¯2°Ŗ´ŗ
^ZY[ h
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core">
<head>
<title>Successfully Registered New User</title>
</head>
<body>
<f:view>
Welcome, #{user.name}, you are successfully registered as #{user.username}.
</f:view>
</body>
</html>
ŒòŽn×ØÙØ
^ ¿š£¯œǬ&ÈǭŔv°Ǯ¿&
ǯĞ&Ŕ&ŽµûŖĿŻŗ
b
[
‚%´ŗ
1i ]+j VWXYZ = application.xml
©C©
šŶn^#I}¯2 345s—KMñò¬œ1nTUVWXŔŲ’vûŖ´ŗ
^ZY[ k
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">
<display-name>Seam Registration</display-name>
<module>
<web>
<web-uri>jboss-seam-registration.war</web-uri>
<context-root>/seam-registration</context-root>
</web>
</module>
<module>
<ejb>jboss-seam-registration.jar</ejb>
</module>
<module>
<ejb>jboss-seam.jar</ejb>
</module>
<module>
<java>jboss-el.jar</java>
</module>
</application>
Œ&TUVWXŽ?NHMƛLM–&ł}G¯n
]^345;,Ã- /seam-registration ˜M<¯Ŗ´ŗ
?NHMƛ345ŀ&´ƚ2&OáMƃĄľûŖ¯œŗ
11 6klm
O¶‡s–ĴFñòœ}Þn
b
Žn

user
}°"Ò­&ȃ>Ɣ´¬«"’ƕ¯Ŗ´ŗ
!&Ò­˜M<ñòœƜs¸ǰ¯v°œ1
ÆŠ& ;,Ã-ŔÇn Žnuser ;RSM-N-ä¯n !ò
EF45;,Ã-ƀ•¯œŶn User ?,@,@ M-N- b
ĺ¯Ŗ´ŗ
O¶‡&ŪūƜŽn
User
?,@,@%Ɠdñòœ
ž`
[
͐“¯2—NŃĆĬ¥ƍs(ľò¬«"vûŖ´ŗ
͐DZDz¯2°¬ŷĆnb
Ž!&‚ƲĚz¯Ŗ´ŗ!"%vŨòũn O¶‡&ŪūƜ User ?,@,@ &Kâ,@˜M<¯Ŗ´ŗ
ŧnb
Ž
ÈƒÒ
register
&>Ɣ’ƕ¯Ŗ´ŗ
Žn-,D-;,Ã-ŀ& RegisterAction -,D-EF45 ƃÖŨn
!òĺ¯Ŗ´ŗ b Žnregister() G45-êÂÚF<ƭìƗ¯Ŗ´ŗ
Œ&ƭìƗ¯j(´¬­n
ŽÂÚF<;MNE¯n
EF45;,Ã-º» User ?,@,@M‚PG¯Ŗ´ŗ
©C©
)
ÂÚF<ŽŪūñòœ78Òs·¸ǰ´¬ºŠ"ºłƚŖ´ŗ ¸ǰ¯œŷĆn
?HÂFE‚Ž FacesMessages ;RS%ÃM™ñòn [[ §¨ Æ
Ç
sĺñò2‚sƲĚzñò¬Œ}vûŖ´ŗ
FacesMessages
;RSŽÂFE‚Ġ„dz×ØÙŖòœ b ¿ǴŸ¯n C_  b FacesMessage
ǣǤ¯Ŗ´ŗ
register()
!&78Ò&78s¸ǰ¯v°ŷĆn "/registered.xhtml" §¨ Æ
Ç «û registered.xhtml
‚ǵ&–Hœ8ĕMDGsǶ²¯Ŗ´ŗ
b
s‚&Dĕ™ǷǸ´¬}n  user }°"Ò­&ȃ&>Ɣ’ƕ¯n &EF45-;º»ĺñò¬ User ?,@,@&Kâ,@Ɯš£¯Ŗ´ŗ
2 -K!JKnopqrs= tuv$%&#
—N¹-&¥¦§¨GFGstuvwx´¬Œ}Žn
°Ŵò&ĊHM345ë°2Ŕœ°ǵŻƢ’vĥÁ}vûŖ´ŗ Ž b
Ǥýñ»Ğğvķuƿǀ´¬Œ}%n
^fĒ ŖœŽ
žĒ š›œ—N&G?rƱ¯n
b
<h:dataTable>
š›œGFGtuvwx}¯2&Ěz'ǹ¯Ŗ´ŗ
Œ&yz{Žn
Œ&ķu'Ǻ¯2°Ŗ´ŗ
©C©
+
2 BC.DE
Œ&yz{Žn Ö&?,@,@ %µ¬ Messagen Ö&EF45 %µ¬ MessageListBeann !¯2 Ö& ~ º»Ş³ñò2°Ŗ´ŗ
2 F%3G3G = Message.java
?,@,@
Žn
NMn,Ã-nyzÂFE‚&ĵÝ}Îçn
!¯2nÂFE‚s·ıºǻºz´OH™dÓ¯2°Ŗ´ŗ
Message
^ZY[ o
@Entity
@Name("message")
@Scope(EVENT)
public class Message implements Serializable
{
private Long id;
private String title;
private String text;
private boolean read;
private Date datetime;
@Id @GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@NotNull @Length(max=100)
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@NotNull @Lob
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
@NotNull
public boolean isRead() {
return read;
}
public void setRead(boolean read) {
this.read = read;
}
@NotNull
@Basic @Temporal(TemporalType.TIMESTAMP)
public Date getDatetime() {
return datetime;
}
public void setDatetime(Date datetime) {
this.datetime = datetime;
}
}
©C©
Q
21 43
Q#IJ;<% = MessageManagerBean.java
­W&ÍƟn
Ö&EF45
MessageManagerBean
sµûŖ´ŗ
!òŽnO¶‡µ¬ ) Ö&ÿN“ż´¬G45-êÂÚF<dÓ¯2°Ŗ´ŗ
ÿN&
֎nwxº»ÂFE‚ǚǛ¯n
Ŕ"
Ö&ÿNŽnÂFE‚ǼƸ¯Ŗ´ŗ
Œ&NJë°2n­W&}ǕÞvDZ°ŽµûŖĿŻŗ
¯º¯n
012yz{‚ǽƧĀā´¬}Þn
MessageManagerBean
ŽnÂFE‚wx&IJǁŔ(°Ŗ´ŗ
78sǽƧĀāñĿ¬ēĔŽñŖǾŖµûŖ´sn
Œò»&´ƚ2s
b
G45«›2ŕ1»ò¬ľŨ%ŽµûŖĿŻ
ő
èýũn
78s!&‚–FG¤G¯2°¬ºŔ¯òŖĿŻŗ
ű›2nÂFE‚wxIJǁ´¬p؎n G45-êÂÚF<&Ĥľûn e
f
à m %(ľòŖ´ŗ
ÂFE‚&wx˜G?-Ŗœs›2ÂŐÃĭF4¯œ°&%n
-,OEF45 %Œò(°Ŗ´ŗ
^ZY[ @Stateful
@Scope(SESSION)
@Name("messageManager")
public class MessageManagerBean implements Serializable, MessageManager
{
@DataModel
private List<Message> messageList;
(1)
@DataModelSelection
@Out(required=false)
private Message message;
(2)
(3)
@PersistenceContext(type=EXTENDED)
private EntityManager em;
(4)
@Factory("messageList")
(5)
public void findMessages()
{
messageList = em.createQuery("from Message msg order by msg.datetime desc")
.getResultList();
}
public void select()
{
message.setRead(true);
}
(6)
public void delete()
{
messageList.remove(message);
em.remove(message);
message=null;
}
(7)
@Remove
public void destroy() {}
(8)
}
©C©
\
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
ï,45Žn
java.util.List
NM&ƙĬn
javax.faces.model.DataModel
M-N-}¯2
b
‚ǿô¯Ŗ´ŗ
ŒòŽnŚ(“¯2GFGtuvGÕÖ
b
<h:dataTable>
ŀ&wxš£tu}¯Ŗ´ŗ
Œ&%Žn
DataModel
Žn
messageList
}°"Ò­&EF45;,Ã-ŀ%Į£tuvûŖ´ŗ
@DataModelSelection ï,45Žn GFGñòœG}ŋŌ¯œ List
’ȀM‚PG´¬«"Ɠz¯2°Ŗ´ŗ
@Outï,45ŽnŧǚǛñòœƜƣƤ‚ǿô¯Ŗ´ŗ
ű›2nGFGtuwx&(sǚǛñò¬œìn
Message
Žn-,O
&ƙĬM‚PG45ñòn
j°2
message
}°"Ò­&M¹;,Ã-ȃœ‚PG45ñòŖ´ŗ
Œ&-,O Žn^+ ȁȂij;,Ã- ՛2°Ŗ´ŗ Œ& s¸ǰ´¬ȃûn
G?¥¦ñòœ
J
Žn•=ñòœƪƫƀÕñòŖ´ŗ
ű›2n !òjţ-,O ǵ&ÂÚF<ƭìƗ¯Žn ǂzŠ EntityManager
ƭìƗ´Œ}vţn !ò»&ĸ®stu%´ŗ
012
~
‚ǽƧĀā´¬}Þn
messageList
;,Ã-ȃŀƜ՛2°ŖĿŻŗ @Factory ï,45Žn  MessageManagerBean
M-N-&²³Ɠz¯n
0ĈƜcd´¬œ1
findMessages()
ÂÚF<ƭìƗ¯Ŗ´ŗ
findMessages()
messages
&
OáGÂÚF<}ƭìŖ´ŗ
select()
G45-êÂÚF<Žn ǚǛñòœ Message ·ı ¤GÝŨn
—N¹-ŀ&!òĸ®¯Ŗ´ŗ
delete()
G45-êÂÚF<Žn
ǚǛñòœ
Message
—N¹-º»ǼƸ¯Ŗ´ŗ
´ƚ2&-,OEF45
&
;RSŽn
@Remove
}¤GñòœÂÚF<ÕÖŒ}s
Ųų
%´ŗ
Œò«ûn
;,Ã-sĄľûn˜M<&µ»Ƈ¬ƪƫGF´¬}ސn
ŽnŤ'-,O &ǼƸ(°Ŗ´ŗ
@DataModel
ΘsEF45-;&
;RS%µ¬Œ}ƮƬ¯2ţŦñ°ŗ
78K™MEF45}ŋŌ¯K™MEF45º»&´ƚ2&G?-Žn
͏;RS&M-N-ƹí¯Ŗ´ŗ
Æ
345%ŽnEF45-;&;RSŽȄý1š£¯2ţŦñ°ŗÇ
22 IJ;<% MN#O%PQR4 = MessageManager.java
ŔnjȅŻn´ƚ2&EF45 ŽMNOP-ÕnjŖ´ŗ
@Local
public interface MessageManager
{
public void findMessages();
public void select();
public void delete();
public void destroy();
}
ŒŒº»Žn;<ŀ&KLMNOP-&yȆȇȈ¯Ŗ´ŗ
components.xmlnpersistence.xmln
!¯2 application.xml Žn­WŖ%&}źȉ͏v&%n-ÃF¯2 ~ ŕØŖ¯Ƌ"ŗ
©C©
web.xmlnejb-jar.xmlnfaces-config.xmln
a
2S g= messages.jsp
Œ&~‚Ž
b
<h:dataTable>
}¯2ĞƐvŔ&ŽµûŖĿŻŗ
;RSš£¯œžſvŔ&%´ŗ
^ZY[ )
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
<head>
<title>Messages</title>
</head>
<body>
<f:view>
<h:form>
<h2>Message List</h2>
<h:outputText value="No messages to display"
rendered="#{messageList.rowCount==0}"/>
<h:dataTable var="msg" value="#{messageList}"
rendered="#{messageList.rowCount>0}">
<h:column>
<f:facet name="header">
<h:outputText value="Read"/>
</f:facet>
<h:selectBooleanCheckbox value="#{msg.read}" disabled="true"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Title"/>
</f:facet>
<h:commandLink value="#{msg.title}" action="#{messageManager.select}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Date/Time"/>
</f:facet>
<h:outputText value="#{msg.datetime}">
<f:convertDateTime type="both" dateStyle="medium" timeStyle="short"/>
</h:outputText>
</h:column>
<h:column>
<h:commandButton value="Delete" action="#{messageManager.delete}"/>
</h:column>
</h:dataTable>
<h3><h:outputText value="#{message.title}"/></h3>
<div><h:outputText value="#{message.text}"/></div>
</h:form>
</f:view>
</body>
</html>
21 6klm
š0n messages.jsp ‚ǽƧĀāñĿ¬}Þn b R-˜FG Æe
G?-Ç
%Ŕn –Hœ8º»&ƣƤŠv ó^* G?- Æfe
G?-Ç %Ŕn ‚ŽnmessageList
;,Ã-ȃ>Ɣ¯«"} ØŖ´ŗ
Œ&;,Ã-ȃŽn0Ĉäñò2°v°œ1n ŽnOáGÂÚF< findMessages()ƭìƗ¯Ŗ´ŗ !òŽn—N¹-G?Ƕ(ĝn œ‚PG ÆB
Ç
ñòœ
DataModel
&§¨IJǁ(°Ŗ´ŗ
Œ&
DataModel
Žn
<h:dataTable>
©C©
g
Dĕ™´¬œ1Ų’v(—Nƿǀ¯Ŗ´ŗ
78s
<h:commandLink>
GFG´¬}n
b
Ž
select()
G45-êƭìƗ¯Ŗ´ŗ
ŽŒ&ƭìƗ¯MNE¯2ǚǛñòœ(—N
messageManager
;RS&
message
ƙĬM‚PG¯Ŗ´ŗ
G45-ês'(ñò2n
ǚǛ
Message
·ı¤GÝŨŖ´ŗ
ƭìƗ¯&Ąľûn
ŽnǚǛ
Message
message
}°"Ò­&;,Ã-ȃœ‚PG¯Ŗ´ŗ
ŧn
^
;,êŽH8G45;ĴF¯n
Message
“´¬Èĸs—N¹-OHF4ñòŖ´ŗ
šŶn
Œ&‚sƲƂDĕ™ñò2ÂFE‚wxƲĚzn
!&ŜǚǛÂFE‚sĚzñòŖ´ŗ
78s
<h:commandButton>
GFG´¬}n
b
Žndelete()
G45-êƭìƗ¯Ŗ´ŗ
ŽŒ&ƭìƗ¯MNE¯n
ǚǛñòœ(—N messageList ;RS& message ƙĬM‚PG¯Ŗ´ŗ
G45-ês./¯n ǚǛ Message swxº»ǼƸñòn EntityManager & remove()
sƭìƗñòŖ´ŗ ƭìƗ¯&Ąľûn Ž messageList ;,Ã-ȃĸ®¯n
message
}°"Ò­&;,Ã-ȃȊȋ¯Ŗ´ŗ
^
;
,êŽH8G45;ĴF¯n —N¹-º» Message ǼƸ¯Ŗ´ŗ šŶn
Œ&‚sƲƂDĕ™ñòn ÂFE‚wxƲĚz¯Ŗ´ŗ
S w xyz = {|}{ rs$%&#
B~| ŽnðGOKĝN-G•=&Éòœķuƿǀ¯Ŗ´ŗ Š&«" B~| s }ńĆñò2°¬ºǘ¬œ1n žſv *f€ wx345ëƃĿ¯Ŗ¯Ƌ"ŗ
N-G&wx•=´¬Œ}ŽnB~|
&ŀȌŠvķu%µ¬œ1n
Œ&Ž
C
;<sź}ŻŠµûŖĿŻŗ
©C©
h
S BC.DE
Œ&&ŀȌŽnB~| &KE-dÓ%´ŗ ) Ö& ~ } ) Ö&njƋ›}¯œ C
ŔµûŖ´ŗ ƗN¹-GE-ĝH8G45ĞĬsv°&%n EF45 š£´¬=ȍŽµûŖĿŻŗÇ !ò%ŽKE-dÓº»ª1Ŗ¯Ƌ"ŗ
^ZY[ +
<process-definition name="todo">
<start-state name="start">
<transition to="todo"/>
</start-state>
(1)
<task-node name="todo">
<task name="todo" description="#{todoList.description}">
<assignment actor-id="#{actor.id}"/>
</task>
<transition to="done"/>
</task-node>
(2)
(3)
(4)
<end-state name="done"/>
(5)
</process-definition>
(1)
(2)
(3)
ï<ŽKE-&Ȏ=ŠvôªĚ¯Ŗ´ŗ
KE-sôª´¬}n
ƣnj todo ï<Āā¯Ŗ´ŗ
<task-node> ï<Ž ȏnjƪƫ Ě¯Ŗ´ŗ l‚S-KE-&'(swÎȐŁñòn ÖŖœŽÔƒ&N-Gs(ľò¬&ȏķ¯Ŗ´ŗ
<task>
’ȀŽn78«›2'(ñò¬N-GdÓ¯Ŗ´ŗ
Œ&ï<Ž
<start-state>
©C©
k
(4)
(5)
Ö&N-G¯ºdÓñò2°v°&%n
!òsŸą´¬}'(sƲôñòn
ĄąƪƫĀā¯2°ÞŖ´ŗ Œ&N-GŽn todoList }°"Ò­& ;RS
ÆC & wȑÇ º» Y IJǁ¯Ŗ´ŗ
N-Gs²³ñòœ}ÞnN-GŽ78µ¬°Ž78™ĉû…2¬Ų’sµû
Ŗ´ŗ Œ&%ŽnN-GŽnǹǰ&78ĉû…2»ò2°Ŗ´ŗ !òŽnactor
}°"Ò­&×ØÙØ
;RSº»IJǁ¯Ŗ´ŗ
Š&«"v
;RSŔN-Gĉû…2'(´¬œ1š£ñò¬tuĬsµûŖ´ŗ
<end-state>ï<Žnl‚S-KE-&Ȏ=ŠvĄądÓ¯Ŗ´ŗ
'(sŒ&ï<ǷǸ¯œ}Þn KE-M-N-ŽȒȓñòŖ´ŗ
€^
ƿǀñòœKE-dÓ?—@Nš£¯2KE-dÓƃœŷĆn
śŜ&«"vûŖ´ŗ
Œ&<ÃŽnï<&™HO}¯2
l‚S-KEdÓ¯Ŗ´ŗ
ŒòŽññ°vǹ'µûǁ¬l‚S-KE-%´ŗ '(ñòvŨòũv»v° N-G Žn
ÖŦŨ%´ŗ N-GsŸą¯œ}Þ l‚S-KE-ŽĄą¯Ŗ´ŗ
š0& C ŽK™MǽƧ login.jsp Ð=¯Ŗ´ŗ
;RSš£¯2
B~|
Æ'ę&345%Žn 78ťƍŔŲ’%´ŗÇ
Ð=p؎n ſ actor
0Ĉä´¬ŦŨ%´ŗ
^ZY[ Q
@Name("login")
public class Login {
@In
private Actor actor;
private String user;
©C©
)o
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String login()
{
actor.setId(user);
return "/todo.jsp";
}
}
ŒŒ%Žn×ØÙØ
Actor
š£¯2°¬&sľºûŖ´ŗ
;RSM‚PG´¬œ1n
@In
ŧ& ~ ¼ȔŽƢ’%ŽµûŖĿŻŗ
^ZY[ \
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<title>Login</title>
</head>
<body>
<h1>Login</h1>
<f:view>
<h:form>
<div>
<h:inputText value="#{login.user}"/>
<h:commandButton value="Login" action="#{login.login}"/>
</div>
</h:form>
</f:view>
</body>
</html>
) Ö1& C Žnl‚S-KE-M-N-&ôª}N-G&Ąąȕ…¯Ŗ´ŗ
^ZY[ a
@Name("todoList")
public class TodoList {
private String description;
public String getDescription()
{
return description;
}
(1)
public void setDescription(String description) {
this.description = description;
}
@CreateProcess(definition="todo")
©C©
(2)
)
public void createTodo() {}
@StartTask @EndTask
public void done() {}
(3)
}
(1)
(2)
(3)
Y
Kâ,@Žn~
‚º»78ŪūĦŨIJûn
N-Gqrscdñò¬«"n!òKE-dӐǿô¯Ŗ´ŗ
@CreateProcess
ï,45ŽnÒ­ÝÞKE-dÓ&œ1
B~|
KE-M-N-²³¯Ŗ´ŗ
@StartTask
ï,45ŽnN-G$%pŘôª¯Ŗ´ŗ
@EndTask
ŽnN-GĄą¯nl‚S-KE-&Ʋôtu¯Ŗ´ŗ
ǹ'Šv%Žn @StartTask } @EndTask s͏ÂÚF<$Ɨǹ´¬Œ}ŽµûŖĿŻŗ
vȖv»n
ĻļŽ!&N-GŸą´¬œ1n
345š£¯2("ƚÞpŘsµ¬º»%´ŗ
šŶnŒ&345&RMŽ todo.jsp µûŖ´ŗ
^ZY[ g
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s" %>
<html>
<head>
<title>Todo List</title>
</head>
<body>
<h1>Todo List</h1>
<f:view>
<h:form id="list">
<div>
<h:outputText value="There are no todo items."
rendered="#{empty taskInstanceList}"/>
<h:dataTable value="#{taskInstanceList}" var="task"
rendered="#{not empty taskInstanceList}">
<h:column>
<f:facet name="header">
<h:outputText value="Description"/>
</f:facet>
<h:inputText value="#{task.description}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Created"/>
</f:facet>
<h:outputText value="#{task.taskMgmtInstance.processInstance.start}">
<f:convertDateTime type="date"/>
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Priority"/>
</f:facet>
<h:inputText value="#{task.priority}" style="width: 30"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Due Date"/>
</f:facet>
©C©
))
<h:inputText value="#{task.dueDate}" style="width: 100">
<f:convertDateTime type="date" dateStyle="short"/>
</h:inputText>
</h:column>
<h:column>
<s:button value="Done" action="#{todoList.done}" taskInstance="#{task}"/>
</h:column>
</h:dataTable>
</div>
<div>
<h:messages/>
</div>
<div>
<h:commandButton value="Update Items" action="update"/>
</div>
</h:form>
<h:form id="new">
<div>
<h:inputText value="#{todoList.description}"/>
<h:commandButton value="Create New Item" action="#{todoList.createTodo}"/>
</div>
</h:form>
</f:view>
</body>
</html>
ÖŴÖƃ2°ÞŖ´ŗ
‚ŽN-GwxDĕ™¯2°Ŗ´ŗ ŒòŽntaskInstanceList }ƭũò¬ ×ØÙØ;RSº»IJǁ¯Ŗ´ŗ Œ&wxŽbO¶‡&ŀdÓñò2°Ŗ´ŗ
<h:form id="list">
<div>
<h:outputText value="There are no todo items." rendered="#{empty taskInstanceList}"/>
<h:dataTable value="#{taskInstanceList}" var="task"
rendered="#{not empty taskInstanceList}">
...
</h:dataTable>
</div>
</h:form>
wx&Ś’ȀŽ
B~|
GHTaskInstance
&M-N-%´ŗ
śŜ&;<Žſnwxŀ&ŚN-G&ȗȘș°Kâ,@Ěz¯2°Ŗ´ŗ
VWqrn
ÉÊËĝn
ȚĈ&ƜÖ°2Žn
78sŒò»&Ɯĸ®%Þ¬«"Ūū;Kš£¯Ŗ´ŗ
<h:column>
<f:facet name="header">
<h:outputText value="Description"/>
</f:facet>
<h:inputText value="#{task.description}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Created"/>
</f:facet>
<h:outputText value="#{task.taskMgmtInstance.processInstance.start}">
<f:convertDateTime type="date"/>
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Priority"/>
</f:facet>
<h:inputText value="#{task.priority}" style="width: 30"/>
©C©
)+
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Due Date"/>
</f:facet>
<h:inputText value="#{task.dueDate}" style="width: 100">
<f:convertDateTime type="date" dateStyle="short"/>
</h:inputText>
</h:column>
Œ&ÿNŽn
@StartTask
ï,45ÝÞ&G45ÂÚF<sƭìƗñò¬Œ}«ûĄą¯Ŗ´ŗ
G?-âHÂN}¯2 ț¯Ŗ´ŗ
@EndTask
!òŽnö
<h:column>
<s:button value="Done" action="#{todoList.done}" taskInstance="#{task}"/>
</h:column>
Æseam-ui.jar
âF3‚º»n
;Kš£¯2°¬Œ}ƮƬ¯2ţŦñ°ŗÇ
<s:button>
b
Œ&ÿNŽn
N-G&Kâ,@Èĸ´¬œ1š£ñòŖ´ŗ
O¶‡s–ĴFñòœ}Þn
}
B~|
ŽnN-G“´¬Š&«"vÈäŔijä¯Ŗ´ŗ G45-êÂÚF<ŽŹţƄ’%´ŗ
<h:commandButton value="Update Items" action="update"/>
‚&
)
ÖƉ&O¶‡Ž®¯°M,‡p³´¬œ1š£ñòŖ´ŗ
@CreateProcessï,45ÝÞG45ÂÚF<º»ƭìƗñò¬Œ}«û(ľòŖ´ŗ
<h:form id="new">
<div>
<h:inputText value="#{todoList.description}"/>
<h:commandButton value="Create New Item" action="#{todoList.createTodo}"/>
</div>
</h:form>
Œ&Žn!&ĩ°ţÖºŲ’vOáMsµûŖ´sn !ò»Ž ƑƒŠv B~| ĝ
&cd%µûĞğvŔ&ŽµûŖĿŻŗ
S1 6klm
*€
[ ~QM= €‚9ƒ„$%&#
ǢȜŠ¼ȍv Æ<‹FGÇ ǽƧĀāñĿ¬ 345&ŷĆn b½
êl†45±Ƴs‚OKdÓ´¬&šǃvēĔ}vûŖ´ŗ
ǽƧĀāĂsƾ°-NM&345&ŷĆn
А«û-,Ov78MNOP-&ŷĆn
êl†45±Ƴ%Ž4-,‡&ȝòˆ…=>´¬&ŽȞǖvûŖ´ŗ
OK=>´¬Žn
l‚n
G45n
êl†45±Ƴº»OKŋ´¬ȟȠºÞȡ1¬Ų’sµûŖ´ŗ
©C©
)Q
ŽnB~€ KE-dӚ"Œ}%‚OKdÓtu¯Ŗ´ŗ
Œ&žſvƒ„…2†‡º»Š&«"Œòs'ǹñò2°¬ºsľºûŖ´ŗ
[ BC.DE
Œ&Ž
Ö&Cn+
Ö&
~
‚n!ò}
KE-OKdÓ%'Ɗñò2°Ŗ´ŗ ‚OKº»ƃª1Ŗ¯Ƌ"ŗ
B~€ ^ZY[ h
<pageflow-definition
xmlns="http://jboss.com/products/seam/pageflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pageflow
http://jboss.com/products/seam/pageflow-2.0.xsd"
name="numberGuess">
<start-page name="displayGuess" view-id="/numberGuess.jspx">
<redirect/>
<transition name="guess" to="evaluateGuess">
<action expression="#{numberGuess.guess}"/>
</transition>
<transition name="giveup" to="giveup"/>
</start-page>
(1)
<decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
<transition name="true" to="win"/>
<transition name="false" to="evaluateRemainingGuesses"/>
</decision>
(4)
(2)
(3)
<decision name="evaluateRemainingGuesses" expression="#{numberGuess.lastGuess}">
<transition name="true" to="lose"/>
<transition name="false" to="displayGuess"/>
</decision>
<page name="giveup" view-id="/giveup.jspx">
<redirect/>
<transition name="yes" to="lose"/>
<transition name="no" to="displayGuess"/>
</page>
<page name="win" view-id="/win.jspx">
<redirect/>
<end-conversation/>
©C©
)\
</page>
<page name="lose" view-id="/lose.jspx">
<redirect/>
<end-conversation/>
</page>
</pageflow-definition>
(1)
(2)
(3)
(4)
’ȀŽnȏnjƪƫdÓ¯2°Ŗ´ŗ
ŒŒ%Žn4-,‡ŽĞd&
b
lĚz¯n78Ūūȏ›2°Ŗ´ŗ
view-id
ŽƯĻ&
b
êl†45±Ƴ%š£ñò2°¬
b
C_
}͏Ŕ&%´ŗ
‚sǽƧĀā´¬}ސn
redirect
ƙĬŽn

Yfmf
&š£Ɠz¯2°Ŗ´ŗ ÆŒ&§¨s–Hœ8 AI ĚzñòŖ´ŗÇ
<transition> ’ȀŽ b §¨ Æ
Ç Ò­ÝŨŖ´ŗ b G45s!&§¨
Æ
Ç }v¬ŷƐn s./ñòŖ´ŗ B~| sƭìƗñòœŶn '(Ž‚OK™HO&ŧ&ï<ŕØŖ´ŗ
& <action> Žn B~| & %!òs.Œ¬Œ}ƸŨũn b }͏%´ŗ
ŽnŠ&«"v
;RS%ŔƭìƗ´Œ}stu%´ŗ
<decision>
ï<Ž‚OKÁljñĿn
b
^ ¿Ȣȣ´¬Œ}«›2ŧ'(ñò¬ï<Ɣd¯Ŗ´ŗ
<page>
€^ ‚OK?—@N%&‚OKŽśŜ&«"vûŖ´ŗ
‚OKƃĄľûŖ¯œŗ 345&Ȥû&ĥÁ=>´¬Œ}ŽŔ"žſ%´ŗ
ŒòŽ345&Ơ’v‚ numberGuess.jsp %´ŗ
©C©
)a
^ZY[ k
<<?xml version="1.0"?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns="http://www.w3.org/1999/xhtml"
version="2.0">
<jsp:output doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<jsp:directive.page contentType="text/html"/>
<html>
<head>
<title>Guess a number...</title>
<link href="niceforms.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="niceforms.js" />
</head>
<body>
<h1>Guess a number...</h1>
<f:view>
<h:form styleClass="niceform">
<div>
<h:messages globalOnly="true"/>
<h:outputText value="Higher!"
rendered="#{numberGuess.randomNumber gt numberGuess.currentGuess}"/>
<h:outputText value="Lower!"
rendered="#{numberGuess.randomNumber lt numberGuess.currentGuess}"/>
</div>
<div>
I'm thinking of a number between
<h:outputText value="#{numberGuess.smallest}"/> and
<h:outputText value="#{numberGuess.biggest}"/>. You have
<h:outputText value="#{numberGuess.remainingGuesses}"/> guesses.
</div>
<div>
Your guess:
<h:inputText value="#{numberGuess.currentGuess}" id="inputGuess"
required="true" size="3"
rendered="#{(numberGuess.biggest-numberGuess.smallest) gt 20}">
<f:validateLongRange maximum="#{numberGuess.biggest}"
minimum="#{numberGuess.smallest}"/>
</h:inputText>
<h:selectOneMenu value="#{numberGuess.currentGuess}"
id="selectGuessMenu" required="true"
rendered="#{(numberGuess.biggest-numberGuess.smallest) le 20 and
(numberGuess.biggest-numberGuess.smallest) gt 4}">
<s:selectItems value="#{numberGuess.possibilities}" var="i" label="#{i}"/>
</h:selectOneMenu>
<h:selectOneRadio value="#{numberGuess.currentGuess}" id="selectGuessRadio"
required="true"
rendered="#{(numberGuess.biggest-numberGuess.smallest) le 4}">
<s:selectItems value="#{numberGuess.possibilities}" var="i" label="#{i}"/>
</h:selectOneRadio>
<h:commandButton value="Guess" action="guess"/>
<s:button value="Cheat" view="/confirm.jspx"/>
<s:button value="Give up" action="giveup"/>
</div>
<div>
<h:message for="inputGuess" style="color: red"/>
</div>
</h:form>
</f:view>
©C©
)g
</body>
</html>
</jsp:root>
G45ƣƤƭìƗ´Ĥľûn
ĀāƓd´¬ºÖ°2ȥƉ¯2ţŦñ°ŗ
win.jspx
Š&«";¤<ÿNs
guess
‚ŽȦţƯĻ&Ŕ&%´ŗ
^ZY[ )o
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns="http://www.w3.org/1999/xhtml"
version="2.0">
<jsp:output doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<jsp:directive.page contentType="text/html"/>
<html>
<head>
<title>You won!</title>
<link href="niceforms.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>You won!</h1>
<f:view>
Yes, the answer was <h:outputText value="#{numberGuess.currentGuess}" />.
It took you <h:outputText value="#{numberGuess.guessCount}" /> guesses.
<h:outputText value="But you cheated, so it doesn't count!"
rendered="#{numberGuess.cheat}"/>
Would you like to <a href="numberGuess.seam">play again</a>?
</f:view>
</body>
</html>
</jsp:root>
lose.jspx
ŔÍƟ%´ ÆÍƟv&%ȇȈ¯Ŗ´Çŗ šŶŽn C ;RS%´ŗ
^ZY[ )
@Name("numberGuess")
@Scope(ScopeType.CONVERSATION)
public class NumberGuess implements Serializable {
private
private
private
private
private
private
private
int randomNumber;
Integer currentGuess;
int biggest;
int smallest;
int guessCount;
int maxGuesses;
boolean cheated;
@Create
public void begin()
{
randomNumber = new Random().nextInt(100);
guessCount = 0;
biggest = 100;
smallest = 1;
©C©
(1)
)h
}
public void setCurrentGuess(Integer guess)
{
this.currentGuess = guess;
}
public Integer getCurrentGuess()
{
return currentGuess;
}
public void guess()
{
if (currentGuess>randomNumber)
{
biggest = currentGuess - 1;
}
if (currentGuess<randomNumber)
{
smallest = currentGuess + 1;
}
guessCount ++;
}
public boolean isCorrectGuess()
{
return currentGuess==randomNumber;
}
public int getBiggest()
{
return biggest;
}
public int getSmallest()
{
return smallest;
}
public int getGuessCount()
{
return guessCount;
}
public boolean isLastGuess()
{
return guessCount==maxGuesses;
}
public int getRemainingGuesses() {
return maxGuesses-guessCount;
}
public void setMaxGuesses(int maxGuesses) {
this.maxGuesses = maxGuesses;
}
public int getMaxGuesses() {
return maxGuesses;
}
public int getRandomNumber() {
return randomNumber;
}
public void cheated()
{
cheated = true;
}
©C©
)k
public boolean isCheat() {
return cheated;
}
public List<Integer> getPossibilities()
{
List<Integer> result = new ArrayList<Integer>();
for(int i=smallest; i<=biggest; i++) result.add(i);
return result;
}
}
š0n~
‚s
numberGuess
;RS’ƕ´¬}Þn
Ž®¯°;RS²³¯Ŗ´ŗ
!¯2n@Create
ÂÚF<sƭũòn
;RS¼ȧ&0ĈästuvûŖ´ŗ
(1)
OáMŽ
“”
ôª¯
Çn“”&‚OKš£´¬œ1&‚OKdÓ±d¯Ŗ´ŗ
pages.xml
Æ
ȨãŽŶW
^ZY[ ))
<?xml version="1.0" encoding="UTF-8"?>
<pages xmlns="http://jboss.com/products/seam/pages"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2
<page view-id="/numberGuess.jspx">
<begin-conversation join="true" pageflow="numberGuess"/>
</page>
<page view-id="/confirm.jspx">
<begin-conversation nested="true" pageflow="cheat"/>
</page>
</pages>
ëÁºû&ĻûnŒ&
;RSŽȩȪvl‚S-K‚FG%´ŗ
78MNHG45&OKÖ°2=>´¬Ų’ŽŖ›œţµûŖĿŻŗ
Œò«û;RSƲĮ£&tuĬȫ$ñĿŖ´ŗ
[1 6klm
*€
^ …†‡ "&!:;<%= ˆ3#‰Š$%&#
^ ‹Œ8
Œ&Œ345ŽśŜ&ĞȬÕֈ‰Šv‹,&ĥȭŒ4-,‡%´ŗ
©C©
+o
ş
789:
ş
K™M
ş
K™œ
ş
â-ð<cd
ş
‹,¥¦
ş
‹,ǚǛ
ş
ĥȭŒ
ş
ŒŤť
ş
ǹƪ&Œwx
©C©
+
Œ&Œ345Ž
bn^
+on
}}Ŕl}¯2
b
[
š£¯2°Ŗ´ŗ
bnb
[nnC
!¯2nž`+
&345&āȮȯŔµûŖ´
Œ&345µ¬ȰƂ&Ĉçn
°›2ľº¬Œ}&
֎n
!òs}2Ŕ
ȱȲ%µ¬Œ}%´ŗ
þ¬ÿN°›2Ŕn
–Hœ8&ĸ®¯2Ŕn
ԃ&œ@<ô°2Ŕn
ȳƬȘv—NƩÞvŦŨŪū¯2Ŕn
345GHF4ñĿ¬Œ}s}2ŔȞǖ%µ¬Œ}sľºûŖ´ŗ
ŒòǸ³´¬œ1,-ĝ˜™IJûǬȴçŔȵº›œ}ȶľò¬ºŔ¯òŖĿŻsn
'ꐎ!ŻvŒ}ŽµûŖĿŻŗ
ŽnȱȲv
]^
345žſŞȷ%Þ¬«"cȸñò2°Ŗ´ŗ
©C©
+)
!¯2nŒòŖ%;—@™!&Ŕ&«›2ǁ»ò2°œȱȲĬŽn
š£´¬Œ}%¼ǏºÖ¼/Šǁ»òŖ´ŗ
345&Ú-;<ƃòũn
Š&«"345s/p¯2°¬ºȹǁ%ÞŖ´ŗ
!¯2nŒ&ȱȲĬǸ³´¬œ1n
Š&«"ƎƏŠƪƫ•=ĝńĆñòœ—Nƌ…Ĭ¥ƍsš£ñò2°¬ºƃ¬Œ}s%ÞŖ
´ŗ
^1 ‰Š$%&#.Ž
K‚PG&޳Žś­&Ŕ&}͏%´ŗ
ņ
ů !"Ű
ȺȻ¯2ţŦñ°ŗ "Ŗţ345s./¯œv»ũn –Hœ8º»Ɠd¯2 http://localhost:8080/seam-booking/ GE-´¬Œ}stu%´ŗ
njƋ"Š
k
Ö&GHÆǤý2na
Ö&EF45
&MNOP-}
Ö&ï,45&MNOP-Ç
sn
Œ&345&'Ɗ&œ1šľò2°Ŗ´ŗ
a
Ö&EF45
G45-êŽwxVȆñòœĞȬ&œ1´ƚ2&l‚S-K‚FGġŻ%°Ŗ´ŗ
ş
BookingListAction
Žn!&Î&K™M78&œ1ǹƪ&ŒIJǁ¯Ŗ´ŗ
ş
ChangePasswordAction
ş
HotelBookingAction
ş
RegisterAction
Žn!&Î&K™M78&â-ð<Èĸ¯Ŗ´ŗ
Žn345&ŀȼŠķu'Ɗ¯Ŗ´ŗ
‹,ĥȭ¥¦nǚǛnŒnŒŤťŗ
Œ&ķuŽn“”
}¯2'Ɗñò2ëûn
Œ&345%ŽŔ›}ŔŋȌȽţGH-%´ŗ
Žn®¯°4-,‡789:¯Ŗ´ŗ
+ Ö&?,@,@ s345&ij<ÂMŗ'Ɗ¯2°Ŗ´ŗ
ş
Hotel
Žn‹,Ě´?,@,@ %´ŗ
ş
Booking
ş
User
Žnǹƪ&ŒĚ´?,@,@ %´ŗ
Žn‹,Œs%Þ¬78Ě´?,@,@ %´ŗ
^2 ‘.DE
Ⱦsȫ°œv»ũÚ-;<ıŖò¬Œ}ëȿ1¯Ŗ´ŗ
Œ&%ŽnĞd&ķu
Ƌ,¥¦nǚǛnŒ}ŤťÇ
ȡŀ¯Ŗ´ŗ
78&ɀNJº»ƃ¬}n
‹,&ǚǛº»ŒŤťŖ%&´ƚ2Žn
Ö&Ōj¯œƞɁ&ſÌn ÖŖû “” %´ŗ ¯º¯n¥¦Žn“”&wĥ%ŽµûŖĿŻŗ
78Žn ɂv¬–Hœ8N–%͏¥¦§¨‚º»Ôƒ&‹,ǚǛtu%´ŗ
ź}ŻŠ&
]^
345&Ã,GĭŽn“”ǿô´¬œ1&ŞɃ՛2°ŖĿŻŗ
“”ŋŌ´¬ƪƫ•=ɄǕvƺƻȽÞ.Œ´œ1%´ŗ
ĻļnC
]^
345Ž ) Ö&Ǩǩ×ØĆľĿ2š£¯Ŗ´ŗ š0nvŻ»º&ƪƫs HttpSes ©C©
++
ƥɅ»òn
ŽƉnG?-&ŶŲŴijtuvƪƫs—N¹-ɆÞÙØñò2º»n
®±G?-!òɇò&Ɉɉ%ijtuvƪƫs—N¹-º»ƲŞȷñòŖ´ŗ
sion
)
—N¹-ŽšŔ-3Hl,@Ɋ¯°Džv&%n
ɋrƄuvźŠ-3Hl,@Ɋ¯°§¨}v¬Œ}Ŕ«ţµûŖ´ŗ
G?-Ȧ}—N¹-(ÞƦ´¬ɌɍɎsÀǤ´¬œ1n
ǣǤȏnjÎçŔƺƻ}vûŖ´ŗ
Œ&ɏɐvɌɍɎɑǙñĿ¬œ1n
C
345%ŽG?-ç%«ţGE-ñò¬—Nƀ•´¬—NÃĭF4
Æ)
ŧD¹Ç ɒŪ´¬ŷĆs«ţµûŖ´ŗ Œ&ÃĭF4ŽnŲŴ¯ŔîɓŠ%ŽµûŖĿŻŗ
vȖv»—Nsȳ"º&ɔį78s—N&ɕpĄą¯œºŠ"ºĜ¯2("
&%Žvţn
IA
R4¹-}¯2("œ1%´ŗ
ñ»n
ÃĭF4Žƾţ&ÏdzH8G45ç%ƹíñò¬&%n
ÃĭF4ñòœƪƫ}—N¹-ç&wɖĬɗՐŋ´¬ƾţ&ƺƻŔIJûŪò2¯Ŗ"Œ
}v¬œ1%´ŗ
ñ2nHttpSession
ƀ•ñòœƪƫǪɘ¯2ØŖ¯Ƌ"ŗ
īļơƬșţK™HĴ™("Œ}«ûn
EF45—N&MƛĂă%Þ¬ŷĆsµ¬ºŔ¯òŖĿŻsn
əɚ´¬«ûŴ›}Ȟǖ%´ŗ
vȖv»ũn
]^
–Hœ8Žīɛ¾vǽƧɕpɜķżÈɋt¯2°¬œ1%´ŗ
¯º¯n4-,‡&ôǶɝŀ%n
78ŽÔƒ&Ïdz“”ÕÖŒ}ɋñò¬}Wƚ»òœ4-,‡’ÜɞǏƃÖŨœ}¯Ŗ´
ÆɟŔÍƟ&ƪɠɡɢ¯Ŗ¯œÇŗ
Ɛǔ&Ïdz“”ŋŌ´¬EF45-,Áɣ´¬ÂLŎƛ‡ôǶ´¬Œ}n
!m¯2–Hœ8œ@<œĝN–ɤ¬Œ}%78s“”&°ŴòºŀŁ´¬ŷƐ“”
-,sŲŴȒȓñò¬«"OPEO×ØÙĢŒ}Žn
Ⱦsďñţ2Ž%Þv°%¯Ƌ"ŗ
ÆɟŽ
)
ƂźŠ'Ɗ¯œŒ}sµûŖ´ŗ
֎GHM345n ֎ %¯œŗ ŦŨŠnɟŽɥŠvŒ}%íÒ%´ŗÇ
ñ»«°ēĔsµûŖ´ŗ
ŽOá-GH-&ŞɃ}¯2
“”;,Ã-ɒŪ¯2°Ŗ´ŗ
Œ&;,Ã-q%Ž“”ƪƫɦŹɗÕ´¬Œ}s%Þn
ŖœɧÁdÓñòœHMOMGsŲŴ՜ñòŖ´ŗ
ñ»n
“”;,Ã-Ž78sǹǰpŘ¯2°¬—N&¼ǏvÃĭF4}v¬œ1n
345˜}—N¹-ç%—NɨjŠ(ÞƦñĿ¬Ų’sµûŖĿŻŗ
Ļļn“”;,Ã-ŀ%ƀÕ´¬;RSŽ-,OEF45
%´ŗ
Ɠ”;,Ã-ŀ%?,@,@ ĝ C ƀÕ´¬Œ}Ŕ%ÞŖ´ŗÇ C
;ĴŎ,@Žn-,OEF45
s
-3Hl,@ȳ2¯Ŗ"}°"—¤sɩţº»µûŖ´ŗ khhɪ ]`b` o
s-ñòœɫŽɬ'Ŧ›œºŔ¯òŖĿŻsn ɭĵ%ŽŔŽĝɬ'%ŽµûŖĿŻŗ #
&«"v345˜Ž-,OEF45
-,&Ôɮ“¯2īļÉòœÂLŎƛ‡Õ›2°Ŗ´ŗ
Æèýũn
^+
;,êŽĎãvĥÁŖ%Ôɮ(°n 'ęÈ䯜 ` ƙĬƜ&Ø&Ôɮ(°Ŗ´ŗÇ
vȖ-,O
sīîɓŠºŋ´¬űƦ&ǨǩŠvɯȎŽ´ƚ2
HttpSession
Ŕɰ¯ţ…2ŽŖûŖ´ŗ
ű›2n
âO¶¤-ɱɲ´¬œ1n
l‚S-Dž&-,OEF45
º»
]^
EF45ā(´¬'ɳÖ°2Žħ»òv°źŠɴ›œēȫɵɒñò2°¬&%ơƬ¯2
©C©
+Q
ţŦñ°ŗ -,OEF45 š"n -,O ` ɴ›2š"n
-,O
`
ƄŢvŒ}š"vŠ¯2ȁȂĬ&v°345VW´¬Œ}Žœ¯ºtu%´ŗ
¯º¯n
ɶ“š"ƚÞ%Žv°}°"ƬȘ%ŽµûŖĿŻŗ
}ºţn
ŽɦŹvš£Å—ƉŠ}¯2ɷq¯2°Ŗ´ŗ «"Œ!n )oo\ ɪǵŗ
!ò%ŽnţŠţŠƏ"&ŽŁ12þûŖ¯Ƌ"ŗ
Œ&Œ345Žn
Ôƴvɸ¬ɹ°'ǹ´¬œ1n
ɂv¬-;ÕÖ-,O;RSsŠ&«"Ōɺ´¬Œ}stu%µ¬ºz
¯2°Ŗ´ŗ
Œ345&ÂM‚Žn
78‹,¥¦tu¯2°Ŗ´ŗ
¥¦§¨Žn
EF45-;ƀÕñòŖ´ŗ
78sŒò»&‹,&
֐Āā´¬}Þn
“”Žnôª¯Ŗ´ŗ
!¯2n“”-;&;RSŽn
ǚǛñòœ‹,IJǁ´¬œ1n EF45-;&;RSƭìĺ¯Ŗ´ŗ
ɻɆÞ& C
Y š£´¬Œ}vţFGHM&/p'Ɗ´¬œ1n
b
#BZ š£¯2°¬Œ}Ŕz¯2°Ŗ´ŗ
¥¦ķuŽnEF45-;&-,O
!òŽn$V&ÂFE‚wxƃ»ò¬Ŕ&}ÍƟ%´ŗ
I
mf
š£¯2'ƊñòŖ´ŗ
^ZY[ )+
@Stateful
@Name("hotelSearch")
@Scope(ScopeType.SESSION)
@Restrict("#{identity.loggedIn}")
public class HotelSearchingAction implements HotelSearching
{
(1)
(2)
@PersistenceContext
private EntityManager em;
private String searchString;
private int pageSize = 10;
private int page;
@DataModel
private List<Hotel> hotels;
(3)
public void find()
{
page = 0;
queryHotels();
}
public void nextPage()
{
page++;
queryHotels();
}
private void queryHotels()
{
hotels =
em.createQuery("select h from Hotel h where lower(h.name) like #{pattern} " +
"or lower(h.city) like #{pattern} " +
"or lower(h.zip) like #{pattern} " +
"or lower(h.address) like #{pattern}")
.setMaxResults(pageSize)
.setFirstResult( page * pageSize )
.getResultList();
©C©
+\
}
public boolean isNextPageAvailable()
{
return hotels!=null && hotels.size()==pageSize;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
@Factory(value="pattern", scope=ScopeType.EVENT)
public String getSearchPattern()
{
return searchString==null ?
"%" : '%' + searchString.toLowerCase().replace('*', '%') + '%';
}
public String getSearchString()
{
return searchString;
}
public void setSearchString(String searchString)
{
this.searchString = searchString;
}
(4)
@Remove
public void destroy() {}
}
(1)
(2)
(3)
(4)
^ Ƒƒ @Stateful ï,45Žn Œ&GH-s-,OEF45 %µ¬Œ}ɼƐ¯2°Ŗ´ŗ
-,OEF45
Žn
—O¶%“”;,Ã-&-;ÕnjŖ´ŗ
@Restrict
ï,45Ž;RSǵ&EÃ,@Ăȃǃ£¯Ŗ´ŗ
K™M78ŦŨs;RSGE-ɋñò¬«"Ăȃ¯Ŗ´ŗ
EÃ,@&ɽ%Žn ëŨ¬EÃ,@sñ»Ȩãɾǂñò2°Ŗ´ŗ
@DataModel
ï,45Žn
b
ListDataModel
}¯2
List
ǿô¯Ŗ´ŗ
ŒòŽn¥¦ǽƧ%&GFGtuwx&'ƊrƱ¯Ŗ´ŗ
Œ&%Žn
‹,wxŽn hotels }°"Ò­&“”ȃ& ListDataModel }¯2‚ǿô¯Ŗ´ŗ
^ Ƒƒ @Remove ï,45Žn ï,45ÝÞ&ÂÚF<sƭũòœŶn
-,OEF45
sǼƸñòn!¯2n!&ƪƫsȒȓñò¬Œ}dÓ¯2°Ŗ´ŗ %Žn ´ƚ2&
-,OEF45
ŽâHÂN&v°
@Remove
ï,45ÝÞÂÚF<sdÓñò¬Ų’sµûŖ´ŗ
Œ&ÂÚF<Žn
sEF45;,Ã-Ȓȓ´¬}ސƭũòŖ´ŗ
Œ&345&Ơv‚Žnb
[
‹,¥¦ŋŌ´¬ɿȪƃ2ØŖ¯Ƌ"ŗ
‚%´ŗ
^ZY[ )Q
<div class="section">
©C©
+a
<span class="errors">
<h:messages globalOnly="true"/>
</span>
<h1>Search Hotels</h1>
<h:form id="searchCriteria">
<fieldset>
<h:inputText id="searchString" value="#{hotelSearch.searchString}"
style="width: 165px;">
<a:support event="onkeyup" actionListener="#{hotelSearch.find}"
reRender="searchResults" />
(1)
</h:inputText>
&#160;
<a:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}"
reRender="searchResults"/>
&#160;
<a:status>
(2)
<f:facet name="start">
<h:graphicImage value="/img/spinner.gif"/>
</f:facet>
</a:status>
<br/>
<h:outputLabel for="pageSize">Maximum results:</h:outputLabel>&#160;
<h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize">
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="10" itemValue="10"/>
<f:selectItem itemLabel="20" itemValue="20"/>
</h:selectOneMenu>
</fieldset>
</h:form>
</div>
<a:outputPanel id="searchResults">
<div class="section">
<h:outputText value="No Hotels Found"
rendered="#{hotels != null and hotels.rowCount==0}"/>
<h:dataTable id="hotels" value="#{hotels}" var="hot"
rendered="#{hotels.rowCount>0}">
<h:column>
<f:facet name="header">Name</f:facet>
#{hot.name}
</h:column>
<h:column>
<f:facet name="header">Address</f:facet>
#{hot.address}
</h:column>
<h:column>
<f:facet name="header">City, State</f:facet>
#{hot.city}, #{hot.state}, #{hot.country}
</h:column>
<h:column>
<f:facet name="header">Zip</f:facet>
#{hot.zip}
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<s:link id="viewHotel" value="View Hotel"
action="#{hotelBooking.selectHotel(hot)}"/>
</h:column>
</h:dataTable>
<s:link value="More results" action="#{hotelSearch.nextPage}"
rendered="#{hotelSearch.nextPageAvailable}"/>
</div>
(3)
(4)
</a:outputPanel>
(1)
I
mb
#BZ
©C©
<a:support>
N™Žn
onkeyup
&«"v
C
Y
+g
(2)
(3)
(4)
M¹sǶ²¯œ}Þn
b
G45M¹-êsīÍĈ&
XMLHttpRequest
º»ƭũò¬Œ}tu¯2°Ŗ´ŗ ñ»Ʒ°Œ}Žn ƲDĕ™ƙĬŽnb
‚&wĥÁŦŨ&Dĕ™tu}¯n
īÍĈ&D-R-Ħħ¯œ}ސnĥÁŠv‚ĸ®&'(tu¯2°Ŗ´ŗ
I
mb
#BZ
<a:status>
N™Žn
īÍĈ&G?-sĺñò¬&ȏÖçn
njƋ›}¯œŎÂ45M‚ĚzñĿŖ´ŗ
I
mb
#BZ
<a:outputPanel>
N™Žn
īÍĈG?-«›2ƲDĕ™tuv‚&ŝʀdÓ¯Ŗ´ŗ
<s:link> N™Žn b G45-êƯĻ& Æī C
YÇ ž*| GÝŨ¬Œ}s%ÞŖ´ŗ
Ƒƒ
<h:commandLink>
}Ǣƚ2ŒòsíĮv&Žn
Ÿ®¯°œ@<œ%ôţŸ
ĝ
Ÿ®¯°N–%ôţŸ}°›œɕpʁvľv°Œ}%´ŗ
âHÂN
#{hotelBooking.selectHotel(hot)}
&ÂÚF<˜M—@™Į£¯2°¬Œ}ŔƮƬ¯2ţŦñ°ŗ
ŒòŽnƑƒńwñòœ
^ ¿
%ŽƄtu%´sn
Žn
´ƚ2&ÂÚF<˜M—@™Ěǹ%âHÂNš£%Þ¬«" ^ ¿ ȁȂ¯2°Ŗ´ŗ
Œ&‚ŽnNM¯œ}ސ¥¦§¨s/ŠĚz¯n
BookingAction
&
selectHotel()
!Œ%ŽnºvûȗȘș°Œ}s.Œ›2°Ŗ´ŗ
‹,&ǚǛñĿn
HotelÂÚF<ǚǛ§¨ț¯Ŗ´ŗ
“”}ŋʂ´¬ij—N¼ǏÃĭF4´¬œ1n
Œ345sŠ&«"“”-;&-,O
Į£´¬ºƃ2ØŖ¯Ƌ"ŗ
śŜ&;<Žºvûɏɐ%´sn
“”&Śȑ-,F'Ɗ´¬-GäñòœG45&wx}Ǫý¬}=>¯ĝ´ţvû
Ŗ´ŗ -ıĢ«"n ɉº»ËıŻ%ţŦñ°ŗ
^ZY[ )\
@Stateful
@Name("hotelBooking")
@Restrict("#{identity.loggedIn}")
public class HotelBookingAction implements HotelBooking
{
@PersistenceContext(type=EXTENDED)
private EntityManager em;
(1)
@In
private User user;
@In(required=false) @Out
private Hotel hotel;
@In(required=false)
@Out(required=false)
private Booking booking;
(2)
@In
private FacesMessages facesMessages;
@In
private Events events;
@Logger
private Log log;
private boolean bookingValid;
©C©
+h
@Begin
public void selectHotel(Hotel selectedHotel)
{
hotel = em.merge(selectedHotel);
}
(3)
public void bookHotel()
{
booking = new Booking(hotel, user);
Calendar calendar = Calendar.getInstance();
booking.setCheckinDate( calendar.getTime() );
calendar.add(Calendar.DAY_OF_MONTH, 1);
booking.setCheckoutDate( calendar.getTime() );
}
public void setBookingDetails()
{
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
if ( booking.getCheckinDate().before( calendar.getTime() ) )
{
facesMessages.addToControl("checkinDate", "Check in date must be a future date");
bookingValid=false;
}
else if ( !booking.getCheckinDate().before( booking.getCheckoutDate() ) )
{
facesMessages.addToControl("checkoutDate",
"Check out date must be later than check in date");
bookingValid=false;
}
else
{
bookingValid=true;
}
}
public boolean isBookingValid()
{
return bookingValid;
}
@End
public void confirm()
{
em.persist(booking);
facesMessages.add("Thank you, #{user.name}, your confimation number " +
" for #{hotel.name} is #{booking.id}");
log.info("New booking: #{booking.id} for #{user.username}");
events.raiseTransactionSuccessEvent("bookingConfirmed");
}
(4)
@End
public void cancel() {}
@Remove
public void destroy() {}
(1)
Œ&
Žn^+
!&§¨n?,@,@M-N-Žn
&HMOMGŹȔ&•=ɗÕ¯Ŗ´ŗ
(5)
ȁȂij;,Ã-
š£¯Ŗ´ŗ
-,OEF45
ï,45Žn
(2)
@Out
(3)
ñò¬Œ}ƎƏ¯
ÂÚF<ƭìƗ¯&ŶnƙĬ&Ɯs;,Ã-ȃœ‚PGŖ´ŗ
Œ&%Žn´ƚ2&G45-ê&ƭìƗ¯sŸą¯œŶn
hotel
&Ò­&;,Ã-ȃŽ hotel M-N-ȃ&ƜcdñòŖ´ŗ
@Begin
ï,45Žn
©C©
+k
(4)
(5)
ï,45ÝÞÂÚF<sɐĈ“”ôª´¬Œ}dÓ¯2°Ŗ´ŗ
ű›2nG?-&Ąą%Žǹǰ&“”;,Ã-ŽȒȓñòŖĿŻŗ
!&Ĥľûn
ǹǰ&œM<º»&´ƚ2&G?-ƲìŋŌ¯n
“”&īʃ/«¬NM‡œµ¬°Žwʄ´¬
@End
ÂÚF<&ƭìƗ¯«ûȒȓñòŖ´ŗ
@End
ï,45Žn
ï,45ÝÞÂÚF<sǹǰ&ɐĈ“”Ąą´¬Œ}dÓ¯2°Ŗ´ŗ
ű›2nG?-&Ąľû%ǹǰ&“”;,Ã-ŽȒȓñòŖ´ŗ
Žn“”;,Ã-Ȓȓ´¬}Þn
Œ&
^
C
ÂÚF<ŽnƭìƗñòŖ´ŗ Œ&ÂÚF<dÓ´¬Œ}ʅòv°%ţŦñ°ŗ
Žn
HotelBookingAction
‹,¥¦nǚǛnŒnŒŤť'Ɗ¯œ´ƚ2&G45-ê՛2ëûn
!¯2nŒ&ɕpŋŌ´¬ƪƫM-N-ƀÕ¯2°Ŗ´ŗ Œ&;<sn HttpSession
ƙĬº»
J½
´¬Ŕ&}ǢȜ¯2n
«ûG%žſv;<%µ¬Œ}ÍƬ¯2Ŕ»ý¬}Ǫý2°Ŗ´ŗ
ñ»Ʒţ´¬œ1n78ŽnK™MEF45ʆÔƒ&Áɣñòœ“”ÕÖŒ}st
u%´ŗ
¯2Ø2ţŦñ°ŗ Íΐ ) Ö&ɂv¬‹,Œp³´¬Œ}stu%´ŗ
“”ɐÎçnʇǞ¯œŷĆn ŽnšĄŠ“”NM‡œ¯nƪƫȒȓ¯Ŗ´ŗ
“”sĄą¯œŶn!&“”‚þ¬ÿNʈ¯nG45&'( ؜ŷĆn Žn“”s·Ąą¯œŒ}¥Ɨ¯n¥¦‚ĕMDG¯Ŗ´ŗ
^S ’ “DLO”L!
Œ345& ]#I OáM&ŀȧPFG´òũn WEB-INF/lib —@DGŀ
seam-ui.jar
sƃÖºûŖ´ŗ
Œ&âF3‚Žn
}ńĆ´¬ƾţ&
b
L-N‡;KġŻ%°Ŗ´ŗ
Œ&Œ345Žn
¥¦ǽƧº»‹,‚ǵ&ǽƧĀāĂ㐠<s:link> š£¯2°Ŗ´ŗ
<s:link value="View Hotel" action="#{hotelBooking.selectHotel(hotel)}"/>
ŒŒ%n<s:link>
š£´¬Œ}%n
–Hœ8&
Ÿ®¯°œ@<œôţŸ
ķuʉʊ´¬Œ}vţn G45-ê ž*| GÝŨ¬Œ}stu%´ŗ Ƒƒ b
<h:commandLink>
ŽnŸ®¯°œ@<œôţŸ
}Ō/¯ŖĿŻŗ
<s:link>
Žn
“”ʋʌġĢ!&ĩƾţ&ưĮvķuƿǀ¯Ŗ´ŗ
Œ345ŽnАn/book.xhtml ë°2°ţÖº&ĩ& ;K} I
mf
b
#BZ
;Kš£¯Ŗ´ŗ
ŒŒ%Žn!ò»;K&Ȩ㐎ʍòŖĿŻsn Œ&;<=>¯œ°v»ũn b
O¶‡˜—45&œ1& &ķu“ʎ}´¬ɽȺȻ¯2ţŦñ°ŗ
^[ •–J—~
]#I
Ž
ŔġØŖ´ŗ
—˜F™‚Ž
b
[
}ĆľĿ2Œ&
B
s—KMñòninit
Kâ,@sśŜ&«"cdñòœŷƐíîvûŖ´ŗ
seam-debug.jar

;RS& `J
WEB-INF/lib
<core:init jndi-pattern="@jndiPattern@" debug="true"/>
©C©
Qo
Œ&‚%ǹǰK™M¯2°¬EF45ŋŌ´¬´ƚ2& ;,Ã-ŀ& ;RSƃœûn¥ʏ´¬Œ}s%ÞŖ´ŗ
š°ēŽſ–Hœ8º»
http://localhost:8080/seam-booking/debug.seam ŬmY6½½[
[m6hoho½f`öJ½`Jŭ
Ɠd´¬ŦŨ%´ŗ
b w
4 "$%&#
xyz
'˜™š…†‡"&!:;<%=
€€
-&—Å345Žn
&'ɳŠvš£ĔƃĿ2ţòŖ´ŗ
N-G•=}‚OK&œ1&
78ǽƧŽn¥¦ĝ45FșLķu&'Ɗ&œ1
‚OKĮ£¯2°Ŗ´ŗ
©C©
}›}
B~|
B~€ Q
Œ&•=ǽƧŽnĊĕ&ʐťĝ45FșMG•=´¬œ1 B~| Į£¯Ŗ´ŗ
l‚S-KE-Žnɂv¬KE-dÓǚǛ´¬Œ}«û/ŠÈĸñò¬ºŔ¯òŖĿŻ
ŗ
©C©
Q)
*€
dvdstore
—@DG&ŀȦxţŦñ°ŗ
c
œ
'˜™š
‰Š;43„$%&#
$%&#=
œ
ž` Œ—ÅŽn ijĬ&œ1 ž`n EF45 &Ĥľû C
š£¯œžſvŒ—Å&āȮȯ%´ŗ
*€
hibernate
—@DG&ŀȦxţŦñ°ŗ
f j] "&!:;<%=  $%&#
Žn˜M<%ƪƫƀÕ´¬345&'Ɗ}2ŔrƱ¯Ŗ´ŗ
©C©
Q+
¯º¯n˜M<&ƪƫ•=Žn°ÖŔǃú}°"ľŨ%ŽµûŖĿŻŗ ÆАn;,ŏ
ƿǀ´¬ķuë°2
Ç
Œ&ȑ&ƺƻ&œ1n78‚–FG¤GñĿn
!¯2nǢȜŠ-,D-v˜}´¬Ų’s¯ũ¯ũµûŖ´n
!&§¨n–FG¤GĻ¯2°Ö%ŔŠŻv‚ŔGE-tuvûŖ´ŗ Œ& [J
Žn
š£¯œ
I^*e[
345&'ƊēĔƃĿ2ţòŖ´ŗ
¥¦§¨‚ġĢ´ƚ2&345&‚Žn –FG¤Gstu%´ŗ
Œ& [J ŽnŸȽ›ʑû Æ~A Ç Ÿ f -NM |¢ &š£'Ǻ¯2°Ŗ´ŗ
ŒŒ%nl&œ1&—NIJǁ}—NƒU&G45ÂÚF<-ꚣ´¬Ĥľû
n lŽnDĕ™¯2°¬;RSº»—NȽÞƗ¯Ŗ´ Æ~A Çŗ
f žy’ŸŸž z›
.˜¡
index.xhtml
e
[ ‚&wĥŽn š®& [J 9:&-Ěz¯2°Ŗ´ŗ
^ZY[ )a
<h:dataTable value="#{blog.recentBlogEntries}" var="blogEntry" rows="3">
<h:column>
<div class="blogEntry">
<h3>#{blogEntry.title}</h3>
<div>
<h:outputText escape="false"
©C©
QQ
value="#{blogEntry.excerpt==null ? blogEntry.body : blogEntry.excerpt}"/>
</div>
<p>
<h:outputLink value="entry.seam" rendered="#{blogEntry.excerpt!=null}">
<f:param name="blogEntryId" value="#{blogEntry.id}"/>
Read more...
</h:outputLink>
</p>
<p>
[Posted on
<h:outputText value="#{blogEntry.date}">
<f:convertDateTime timeZone="#{blog.timeZone}"
locale="#{blog.locale}" type="both"/>
</h:outputText>]
&#160;
<h:outputLink value="entry.seam">[Link]
<f:param name="blogEntryId" value="#{blogEntry.id}"/>
</h:outputLink>
</p>
</div>
</h:column>
</h:dataTable>
–FG¤Gº»Œ&‚ā/´¬ŷĆn
<h:dataTable>
«ûš£ñò¬—NŽ'ꐎŠ&«"0Ĉäñò¬&%¯Ƌ"ºŗ
ŒŒ%Ǭs.Þ2°¬º}°"}n Blog Ž Blog }°"Ò­& ;RS«›2n
Ų’v}ސʒʓ¯2IJǁñò2 ő ȽÞƗñò2 ő °¬ľŨ%´ŗ ŒòŽn &«"vűƦ&
]^
G45ĜʔţOD‡ðG%ŽwʕŠvOKĂă}ʖv›2°Ŗ´ŗ
^ZY[ )g
@Name("blog")
@Scope(ScopeType.STATELESS)
@AutoCreate
public class BlogService
{
@In EntityManager entityManager;
(1)
@Unwrap
(2)
public Blog getBlog()
{
return (Blog) entityManager.createQuery("select distinct b from Blog b left join fetch b.blogEnt
.setHint("org.hibernate.cacheable", true)
.getSingleResult();
}
}
(1)
(2)
Œ&;RSŽn
•=ij;,Ã-
š£¯Ŗ´ŗ
ŒòŖ%ƃ2ޜĩ&}Žɂvûn
Œ&ij;,Ã-Žn
«›2•=ñòŖ´ŗ
Œ&ij;,Ã-Žn]^
G?-ŹȔ%íî%n
IJǁ¯2°v°lŋŌGE-´¬}ސǶ²´¬µ»Ƈ¬èé&ʗʘtu¯Ŗ´
ŗ
@Unwrap
ï,45Žn
sGHM“¯2'ę&
BlogService
;RS%ŽvţÂÚF<&ĺûƜ ő Blog ő ț´«"Ɠz¯Ŗ´ŗ Œòs •=;RSâN %´ŗ
©C©
Q\
ŒòŽnŒòŖ%&}ŒȅƷ°%´sn
¥¦§¨‚&«"vO¶‡–ĴF&§¨&–FG¤G%ŽŠ"%¯Ƌ"ºʙ
f1 ”JK¢Kop£¤¥¦~
Œ&
[J
Žn
Ś‚&ʚ$78&
[J
VɁ&¥¦tu´¬ďñvO¶‡ÕnjŖ´ŗ
ŒòŽne
[
,Dntemplate.xhtml ġŖò¬ menu.xhtml OáMdÓñòŖ´ŗ
^ZY[ )h
<div id="search">
<h:form>
<h:inputText value="#{searchAction.searchPattern}"/>
<h:commandButton value="Search" action="/search.xhtml"/>
</h:form>
</div>
–FG¤Gtu¥¦§¨‚&'Ɗ&œ1n
¥¦O¶‡&–ĴFÐ=¯œŶn
–Hœ8ĕMDG'(´¬Ų’sµûŖ´ŗ G45§¨ Æ
Ç }¯2 b l
€ š£¯2°¬&%n ŽnO¶‡s–ĴFñòœ}Þn¼/Š l €
ĕMDG¯Ŗ´ŗ
Ɛ&ēĔ}¯2nśŜ&«"vêl†45dÓ´¬Œ}Ŕtu%´ŗ
^ZY[ )k
<navigation-rule>
<navigation-case>
<from-outcome>searchResults</from-outcome>
<to-view-id>/search.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
O¶‡ŽnśŜ}ʛœ«"vŔ&v¬%¯Ƌ"ŗ
^ZY[ +o
<div id="search">
<h:form>
<h:inputText value="#{searchAction.searchPattern}"/>
<h:commandButton value="Search" action="searchResults"/>
</h:form>
</div>
¯º¯nĕMDG´¬}Þn
ht-
&«"v–FG¤G
AI IJǁ´¬œ1n
G?-âHÂN}¯2O¶‡«›2–ĴFñòœƜġĢŲ’sµûŖ´ŗ
b
tp://localhost:8080/seam-blog/search.seam?searchPattern=seam
©C©
Qa
ŽnŒò´¬žſvēĔŽƿǀ¯ŖĿŻsn
%dÓñòœ YJ Y š£¯Ŗ´ŗ
Žƿǀ¯Ŗ´ŗ
WEB-INF/pages.xml
^ZY[ +
<pages>
<page view-id="/search.xhtml">
<param name="searchPattern" value="#{searchService.searchPattern}"/>
</page>
...
</pages>
ŒòŽn‚ĕMDG´¬}ސn

searchPattern
&Ò­&G?-âHÂN}¯2
#{searchService.searchPattern}
&ƜġØn‚Dĕ™´¬­nâHÂN&ƜŗƲǃ£´¬«"Ɠz¯Ŗ
´ŗ
ĕMDG«›2 search.xhtml ‚ā/¯Ŗ´ŗ
^ZY[ +)
<h:dataTable value="#{searchResults}" var="blogEntry">
<h:column>
<div>
<h:outputLink value="entry.seam">
<f:param name="blogEntryId" value="#{blogEntry.id}"/>
#{blogEntry.title}
</h:outputLink>
posted on
<h:outputText value="#{blogEntry.date}">
<f:convertDateTime timeZone="#{blog.timeZone}" locale="#{blog.locale}" type="both"/>
</h:outputText>
</div>
</h:column>
</h:dataTable>
ŒòŔnŖœ'ę&¥¦§¨IJǁ´¬œ1 Ÿ~A Ÿ ¡ |¢ š£¯2°Ŗ´ŗ
^ZY[ ++
@Name("searchService")
public class SearchService
{
@In
private EntityManager entityManager;
private String searchPattern;
@Factory("searchResults")
public List<BlogEntry> getSearchResults()
{
if (searchPattern==null)
{
return null;
}
else
{
©C©
Qg
return entityManager.createQuery("select be from BlogEntry be "" +
"where lower(be.title) like :searchPattern " +
"lower(be.body) like :searchPattern order by be.date desc")
.setParameter( "searchPattern", getSqlSearchPattern() )
.setMaxResults(100)
.getResultList();
}
}
private String getSqlSearchPattern()
{
return searchPattern==null ? "" :
'%' + searchPattern.toLowerCase().replace('*', '%').replace('?', '_') + '%';
}
public String getSearchPattern()
{
return searchPattern;
}
public void setSearchPattern(String searchPattern)
{
this.searchPattern = searchPattern;
}
}
f2 j] "&!:;<%. žy’œž z›
.˜¡
ȦţʜnI^*e[ ‚Ð=&œ1 ~Až ¡ |¢ š£´¬Œ}s…Ǐ&ŷĆsµûŖ´ŗ
!Œ%n
Žn‚G45
&‘ʝƿǀ¯Ŗ´ŗ
[J
Žn
[J
VŪ‚n
entry.xhtml
‚G45š£¯2°Ŗ´ŗ
ŒòŽnǙ¯ľǾ}»¯°ʞ%nŒŒ%Žn~A ¡ |¢ š£´¬ēsrƱºŔ¯òŖĿŻŗ
;RSŽn
&«"vʟ¡Šv
G45ƓȫOD‡ðG&«"/p¯Ŗ´ŗ
entryAction
~Až
¡
|¢
^ZY[ +Q
@Name("entryAction")
@Scope(STATELESS)
public class EntryAction
{
@In(create=true)
private Blog blog;
@Out
private BlogEntry blogEntry;
public void loadBlogEntry(String id) throws EntryNotFoundException
{
blogEntry = blog.getBlogEntry(id);
if (blogEntry==null) throw new EntryNotFoundException(id);
}
}
‚G45Žnpages.xml %ŔƎƏñòŖ´ŗ
©C©
Qh
^ZY[ +\
<pages>
...
<page view-id="/entry.xhtml" action="#{entryAction.loadBlogEntry(blogEntry.id)}">
<param name="blogEntryId" value="#{blogEntry.id}"/>
</page>
<page view-id="/post.xhtml" action="#{loginAction.challenge}"/>
<page view-id="*" action="#{blog.hitCount.hit}"/>
</pages>
$V&èŽn
!&ĩ&ķu“¯2‚G45š›2°Ŗ´
ő
K™MĭD‚ĝ‚lLœNvŠŗ
Ŗœn
‚G45ÂÚF<&˜M—@™âHÂNš£¯2°¬&ŔơƉ¯2ţŦñ°
ŗ ŒòŽ b ^ &Ƒƒķu%ŽµûŖĿŻsn %Ž‚G45ŦŨ%vţ b
ÂÚF<&˜M—@™%Ŕš£%Þ¬«"v›2°Ŗ´ŗ
‚sG?-ñò¬}n
Žš0‚âHÂN
blogEntryId
ŗ˜M<¯n
ŧŲ’v—N
ő
blogEntry
ő
IJǁ´¬‚G45'(¯2º»n !ò M¹;,Ã-TǞ¯Ŗ´ŗ
šŶnśŜsDĕ™ñòŖ´ŗ
entry.xhtml
^ZY[ +a
<div class="blogEntry">
<h3>#{blogEntry.title}</h3>
<div>
<h:outputText escape="false" value="#{blogEntry.body}"/>
</div>
<p>
[Posted on&#160;
<h:outputText value="#{blogEntry.date}">
<f:convertDateTime timezone="#{blog.timeZone}"
locale="#{blog.locale}" type="both"/>
</h:outputText>]
</p>
</div>
`[J
?s—N¹-%ƃÖº»v°ŷĆn
èés-KñòŖ´ŗ Z
Y m_ Œ&èéŽ
%µ›2ʠ¯°&%n èéGH-&ï,45ÝŨŖ´ŗ
EntryNotFoundException
\o\
?H%Žvţ
QoQ
^ZY[ +g
@ApplicationException(rollback=true)
@HttpError(errorCode=HttpServletResponse.SC_NOT_FOUND)
public class EntryNotFoundException extends Exception
{
EntryNotFoundException(String id)
{
super("entry not found: " + id);
©C©
Qk
}
}
Ɛ'Ɗ&ŽnÂÚF<˜M—@™%âHÂNš£¯ŖĿŻŗ
^ZY[ +h
@Name("entryAction")
@Scope(STATELESS)
public class EntryAction
{
@In(create=true)
private Blog blog;
@In @Out
private BlogEntry blogEntry;
public void loadBlogEntry() throws EntryNotFoundException
{
blogEntry = blog.getBlogEntry( blogEntry.getId() );
if (blogEntry==null) throw new EntryNotFoundException(id);
}
}
<pages>
...
<page view-id="/entry.xhtml" action="#{entryAction.loadBlogEntry}">
<param name="blogEntryId" value="#{blogEntry.id}"/>
</page>
...
</pages>
Š&'ƊǚǛ´¬ºŽƩØ&ƺƻ%´ŗ
©C©
\o
1 | '˜™9 '§8¨*
—@-l45Žn;¤<HM7,@,@ġŻ%ëûn
^
[Y
K‚PG&EFFn
&-3;<&²³n
·¸—N¹-º»345&˜-?‚Ŏ™}2Ŕžſ¯Ŗ´ŗ
ŒòŽn
ŪLJ}¯2Ʒ°ēĔ%´ŗ
!¯2nƪƫ—N¹-ƀ•´¬}2ŔÖŖ»v°345Şȷ´¬œ1n
®¯°ëŔnjƆsŠòźŠ´ũ»¯°ºǕɅñ”´ʡʢv
I`à
ʣʤ&
ʥŧ?D¹N&ŀ%ʦŖ›œ}ľº›œÎ&œ1n ʧʨʩʪʫý2ţòŖ´ŗ
Œ&-%ŽnfJ
Ž
#
%š£´¬&sšƷ%´ŗ
K‚PGcd¤Ŏ%Ǚ¯Èĸ´¬ŦŨ%ĩ&
)^^
ĝ
C
^^
\
345˜£²³ñòœK‚PGŔš£tu%´ŗ
^
[Y
svţ2Ŕ
fJ
Žš£tu%´sn
Œ&%Žn^
[Y
š£¯2—˜F™ĝńĆ,-("ēĔz¯œ°}ȶ°Ŗ´ŗ
^
[Y
M-¯œţv°ēŔn
Œ&jŨ¬Œ}s%ÞŖ´
ő
;¤<HMº»´ƚ2&-,FŽ'(tu%´ŗ
fJ
ŽnžſƏ›2¯Ŗýũn,D}ƹ
HFș¯œǕÞvʬ°
#
ŒòŽnŲ’%µòũžſL-N¤Mƛ%Þ¬Œ}ƬȘ¯Ŗ´ŗ
ž`
*[
-G%´ŗ
1 §8©ª
ª1¬­n€ʭ \ ŖœŽ €ʭ a } # Q) } # an!¯2n!òĆ" ^
[Y £&
€^ H™M } *ùó H™MsM-ñò2°¬Œ}Ťť¯2ţŦñ°ŗ
^
[Y & ˜l cdǣǤ¯2ţŦñ°ŗ —˜F™Å<% ./¯2ţŦñ°ŗ
šŶn
—@-l45řô¯œ—@DG%n
;¤<K./¯2ţŦñ°ŗ
ŽÉòœ ]#I ĝ ^#I &‹FƲ—KMÂR¯Ŗ´ŗ Ȥʝvs»n |
˜™sµ¬œ1n
ő
ôǶʮDŽ%ŽwʕŠv
ő
^#I
&Ʋ—KMÂNjûĺ´}nšĄŠŽ
|
s
Y
J
--š°¨œ¯2¯Ŗ"Œ}vûŖ´ŗ Œ&=ȍ«ûn—KMÂΐ Y J
Y
ǕÞţŤƀ¯œ | % ʯ/ñĿ¬Œ}ʰʱ¯Ŗ´ŗ €^ º» ʯ/ñĿ¬ŷƎn Н| Ƚƒđ&Ŝµ¬˜./cd%Œòcd´¬Œ}s%ÞŖ´ŗ
śŜ&«"vƜs«°%¯Ƌ"ŗ
-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512
ɧÁvÂÅsv°}´¬}nśŜsšď&ʰʱƜ%´ŗ
-Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256
;¤<HMº»
Ċ45cdstu%´ŗ
©C©
./¯2°¬v»ũn
bin/run.conf
&
|
\
fJ š›2 ª1«"
ɭ´ʲÈĸ(°œţv°ŷĆŽĞ("Ų’ŽµûŖĿŻ
sǶ²¯œÎNJ%“Я2ţŦñ°ŗ
11 «¬­ ] &MRK
.IJ
ő
OutOfMemoryException
"J&
š0´ƚÞŒ}Žnµvœ&ʼnŇ£
fJ
cd´¬Œ}%´ŗ
Æ
M-—@DGn^
[Y
ðG--n
—N¹-;SG45
!òŽžſ%´ŗśŜ&«"NM¯2ţŦñ°ŗ
#
Ç
cd jboss-seam-1.1.x
seam setup
śŜ&«"Ų’vȟȠ&Ūū’ƕñò¬%¯Ƌ"ŗ
cd jboss-seam-2.0.x
seam setup
śŜ&«"vŲ’vȟȠŪūʳñòŖ´ŗ
~/workspace/jboss-seam$ ./seam setup
Buildfile: build.xml
init:
setup:
[echo] Welcome to seam-gen :-)
[input] Enter your Java project workspace (the directory that contains your Seam projects) [C:/Pro
/Users/pmuir/workspace
[input] Enter your JBoss home directory [C:/Program Files/jboss-4.2.2.GA] [C:/Program Files/jboss/Applications/jboss-4.2.2.GA
[input] Enter the project name [myproject] [myproject]
helloworld
[echo] Accepted project name as: helloworld
[input] Select a RichFaces skin (not applicable if using ICEFaces) [blueSky] ([blueSky], classic,
[input] Is this project deployed as an EAR (with EJB components) or a WAR (with no EJB support) [e
[input] Enter the Java package name for your session beans [com.mydomain.helloworld] [com.mydomain
org.jboss.helloworld
[input] Enter the Java package name for your entity beans [org.jboss.helloworld] [org.jboss.hellow
[input] Enter the Java package name for your test cases [org.jboss.helloworld.test] [org.jboss.hel
[input] What kind of database are you using? [hsql] ([hsql], mysql, oracle, postgres, mssql, db2,
mysql
[input] Enter the Hibernate dialect for your database [org.hibernate.dialect.MySQLDialect] [org.hi
[input] Enter the filesystem path to the JDBC driver jar [lib/hsqldb.jar] [lib/hsqldb.jar]
/Users/pmuir/java/mysql.jar
[input] Enter JDBC driver class for your database [com.mysql.jdbc.Driver] [com.mysql.jdbc.Driver]
[input] Enter the JDBC URL for your database [jdbc:mysql:///test] [jdbc:mysql:///test]
jdbc:mysql:///helloworld
[input] Enter database username [sa] [sa]
pmuir
[input] Enter database password [] []
[input] skipping input as property hibernate.default_schema.new has already been set.
[input] Enter the database catalog name (it is OK to leave this blank) [] []
[input] Are you working with tables that already exist in the database? [n]
(y, [n], )
y
[input] Do you want to drop and recreate the database tables and data in import.sql each time you
©C©
\)
fJ š›2 ª1«"
n
[input] Enter your ICEfaces home directory (leave blank to omit ICEfaces) [] []
[propertyfile] Creating new property file: /Users/pmuir/workspace/jboss-seam/seam-gen/build.properties
[echo] Installing JDBC driver jar to JBoss server
[echo] Type 'seam create-project' to create the new project
BUILD SUCCESSFUL
Total time: 1 minute 32 seconds
~/workspace/jboss-seam $
Œ&ŏŽȾ&Į°œ—O¶Ɯƿǀ¯Ŗ´ŗ
ʈ´ŦŨ%Ǖʴʵ%´ŗ
K“¯2ſ
Ɣ1¬Ų’sµ¬Ƣ’vǚǛŽnK‚PG}¯2^#I¾¿—KM}]#I¾¿—KM&Šnj»
´¬º%´ŗ ^#I K‚PGŽ ^+o “ż¯n C ^^ \ sŲ’%´ŗ ]#I
K‚PGŽ
^+o
Ž“ż¯ŖĿŻsë!»ţ
)^^
ʼnҐ—KMÂstu%¯Ƌ"ŗ
]#IŽ
^#I
Ǣƚ4%=>¯ĝ´°âF3‚%´ŗ
&«"v
^+
s'(tuv345˜M-´¬ŷƎ
ear
ǚǛ¯2ţŦñ°ŗ
ŒòśéŽ
war
ǚǛ¯2ţŦñ°ŗ
śʶn
Œ&%Ž
^#I
—KMÂsǚǛñòœ}ʷd¯Ŗ´sn
]#I
—KMÂ&ŷĆŔŖ›œţ͏-,F%ŕĢŒ}s%ÞŖ´ŗ
·¸&—Nŗ%pŘ¯2°¬ŷĆn
fJ ŲŴǘ»Ŀ2ţŦñ°ŗ
—N¹-·,–s¸ǰ¯2°¬Œ}
cdŽ
seam-gen/build.properties
‰Țñò2°Ŗ´sn
'(´¬Œ}%Èĸ´¬Œ}Ŕtu%´ŗ
śŜ&«"NM´¬Œ}%n^
[Y
®±K‚PG&²³stu%´ŗ
)
ʗƉ&
seam
setup
ðG--—@DGn
seam new-project
C:\Projects\jboss-seam>seam new-project
Buildfile: build.xml
...
new-project:
[echo] A new Seam project named 'helloworld' was created in the C:\Projects directory
[echo] Type 'seam explode' and go to http://localhost:8080/helloworld
[echo] Eclipse Users: Add the project into Eclipse using File > New > Project and select General
[echo] NetBeans Users: Open the project in NetBeans
BUILD SUCCESSFUL
Total time: 7 seconds
C:\Projects\jboss-seam>
ŒòŽn
Bnĸ´¬
B
!¯2
€¢
<HM˜
B
®¯°
^
[Y
K‚PG;Č¯n
^
[Y
ÂN—Në«ì
#
l<-Gű›2Ų’}v¬´ƚ2&Ú-}cdOáMʸn
e
[
,DOáMn -NM4²³¯Ŗ´ŗ ^
[Y %Žn## -> ######... -> ## ->
###### -> ## &ɻË%K‚PGǣǤ¯n ####### ÆŒ&ŷĆn helloworldÇ Ūū¯2n
## GFG´òũn K‚PGŽ¼/Šřô¾¿—@DGŞɃ%—KMñòŖ´ŗ
®±K‚PGœ@8<º» Java ###### ŽǚǛ¯v°%ţŦñ°ŗ
©C©
\+
fJ š›2 ª1«"
^
[Y &—O¶ €ʭ s C ^ \ µ¬°Ž C ^ a €ʭ %vŨòũn ###### -> #####
-> Java ##### &ɻË%nC ^ \ ʹʺ& €ʭ ǚʻŲ’sµûŖ´ŗ
Ɛ&ēĔ}¯2n^
[
&éĥº»
seam
}NM´¬Œ}%K‚PG&—KMstu%´ŗ seam explode
explode
_[
YJ
ƃ¬Žnhttp://localhost:8080/helloworld
ŕŻ%ţŦñ°ŗ
ŒòŽn,D view/layout/template.xhtml š£¯œ e
[ ‚ view/home.xhtml
%´ŗ
^
[Y
º»Œ&‚ĝ,D&ʼȡstu%´ŗ
!¯2–Hœ8ĸ®´¬Œ}%ʽʾ§¨ƃ¬Œ}stu%´ŗ
K‚PG—@DG å| cd<ÃÂs²³ñòŖ´sì›ţû¯v°%ţŦñ°ŗ
Œò»&ź}ŻŠsƑƒ
C
^^
ŋ´¬Ŕ&%n
Ƃ²³¯œ»
)
Ƃ}ƃ¬Ų’&v°Ŕ&%´ŗ Ź K‚PG% koʿ ŽÍŔ&%´ŗ ÆfJ
s%Þ¬źŠ%´º»VWsīļžſv<ÃÂ%´ŗÇ
²³ñòœK‚PGŽ+Ö&—N¹-}ijĬcdġŻ%°Ŗ´ŗ
žĒ €
“¯2
*ùó
7ŎF,-'(´¬ŷƐnpersistence-test.xml
}
import-test.sql
OáMsš£ñòŖ´ŗ
import-test.sql
ŀ&—N¹--ä},-—NŽn
ļ,-s'(ñò¬­—N¹-?Ã-RñòŖ´ŗ myproject-dev-ds.xmln persistence-dev.xml
}
import-dev.sql
OáMŽn
345ôǶ—N¹-—KM´¬}ސš£¯Ŗ´ŗ
fJ
·¸—N¹-%pŘ¯2°¬ºʋý¬ºŠ"º«›2n
-䎗KMΐ¼/Š?Ã-Rñò¬ŷĆsµûŖ´ŗ
myproject-prod-ds.xmln
persistence-prod.xml
!¯2
import-prod.sql
OáMŽn
ˆŽʼnҗN¹-345—KM´¬}ސš£¯Ŗ´ŗ
—KMΐ-䎼/Š?Ã-RñòŖĿŻŗ
12 «®."K;<%'¯°±©
űƦ&G45-NM& ]` OD‡ðGƅò2°¬ŷĆn ë!»ţnŠ&«" C
&-,D-G45ÂÚF<ÕÖžſv
]`
‚s²³ñò¬&Ŧȅ"º}ȶľò¬%¯Ƌ"ŗ śŜ&«"NM¯2ţŦñ°ŗ
seam new-action
Ž°ţÖº&ȟȠƕ12ÞŖ´ŗ !¯2n K‚PG£®¯° e
[ ‚ }
;RS²³¯Ŗ´ŗ
C:\Projects\jboss-seam>seam new-action
Buildfile: build.xml
validate-workspace:
validate-project:
action-input:
[input] Enter the Seam component name
ping
[input] Enter the local interface name [Ping]
[input] Enter the bean class name [PingBean]
[input] Enter the action method name [ping]
©C©
\Q
fJ š›2 ª1«"
[input] Enter the page name [ping]
setup-filters:
new-action:
[echo]
[copy]
[copy]
[copy]
[copy]
[copy]
[echo]
Creating a new stateless session bean component with an action method
Copying 1 file to C:\Projects\helloworld\src\action\org\jboss\helloworld
Copying 1 file to C:\Projects\helloworld\src\action\org\jboss\helloworld
Copying 1 file to C:\Projects\helloworld\src\action\org\jboss\helloworld\test
Copying 1 file to C:\Projects\helloworld\src\action\org\jboss\helloworld\test
Copying 1 file to C:\Projects\helloworld\view
Type 'seam restart' and go to http://localhost:8080/helloworld/ping.seam
BUILD SUCCESSFUL
Total time: 13 seconds
C:\Projects\jboss-seam>
®¯°
;RSǣǤ¯œ&%n
řô¯œ—@DG&—KMƲ./´¬Ų’sµûŖ´ŗ seam restart }Ūū´¬ºn ^
f
[Y
qº»²³ñòœK‚PG
build.xml
OáM
&
restart
N†F'(´¬Œ}%("Œ}s%ÞŖ´ŗ Ʋ./LjĂ´¬Ɛ&ēĔŽn ^
[Y &
resources/META-INF/application.xml
OáMʼȡ´¬Œ}%´ŗ
345Èĸ´¬œì Ʋ./´¬Ų’Žv°Œ}ƮƬ¯2ţŦñ°ŗ
ñµnhttp://localhost:8080/helloworld/ping.seam ŕŻ%nGFGÿNʈ¯2ţŦñ°ŗ
K‚PG&
src
à
—@DGƃòũnŒ&G45Ĺñòœ;<ƃ¬Œ}s%ÞŖ´ŗ
ping()
ÂÚF<–DGRMǞ°2n GFGÿNŔ"wƂʈ¯2ţŦñ°ŗ
šŶnPingTest.xml
OáM
âF3‚TǞ¯n
^
[Y
&
*ùó
H™Mš£¯2ńĆ,-'(¯Ŗ´ŗ
ƐvēĔŽn
seam
test
š£¯2,-./´¬ºn ²³ñòœl<º» test N†F./´¬Œ}%´ŗ
1S "K;<%.²©Q³„'¯°±©
ŧ&-,FŽnśŜ&«"O¶‡²³´¬Œ}%´ŗ
seam new-form
C:\Projects\jboss-seam>seam new-form
Buildfile: C:\Projects\jboss-seam\seam-gen\build.xml
validate-workspace:
validate-project:
action-input:
[input] Enter the Seam component name
hello
[input] Enter the local interface name [Hello]
[input] Enter the bean class name [HelloBean]
[input] Enter the action method name [hello]
[input] Enter the page name [hello]
©C©
\\
fJ š›2 ª1«"
setup-filters:
new-form:
[echo]
[copy]
[copy]
[copy]
[copy]
[copy]
[echo]
Creating a new stateful session bean component with an action method
Copying 1 file to C:\Projects\hello\src\com\hello
Copying 1 file to C:\Projects\hello\src\com\hello
Copying 1 file to C:\Projects\hello\src\com\hello\test
Copying 1 file to C:\Projects\hello\view
Copying 1 file to C:\Projects\hello\src\com\hello\test
Type 'seam restart' and go to http://localhost:8080/hello/hello.seam
BUILD SUCCESSFUL
Total time: 5 seconds
C:\Projects\jboss-seam>
Ʋì345Ʋ./ñĿn http://localhost:8080/helloworld/hello.seam ŕØŖ´ŗ
²³ñòœ;<ƃ2ØŖ¯Ƌ"ŗ ,-'(¯Ŗ´ŗ Ǭº®¯°O@<O¶‡}
;RSǣǤ¯2ØŖ¯Ƌ"ŗ
ÆC
;<Èĸ¯œ»ļ—KMƲ./´¬Œ}ʅòv°«"¯2ţŦñ°ŗÇ
1[ ´µ.•P¶4·¸"&!:;<%'¹6¯°±©
ɻ/%—N¹-&ŀ,–²³¯Ŗ´ŗ
ÆƐ&—N¹-úûüý¬Ų’sµ¬ŷƎŔ"wƂ
ŒŒ%ŧ&«"Ūū¯Ŗ´ŗ
seam
setup
'(¯Ŗ´ŗÇ
seam generate-entities
—KMƲ./¯2n
http://localhost:8080/helloworld
ŕŻ%ţŦñ°ŗ
—N¹-&ȺȻn
·¸Ċ–‚PG&ʼȡn
®¯°Ċ–‚PG&²³stu%´ŗ
²³ñòœ;<ƃ¬}n
ë!»ţµŖûžſv&ˀºòœ}ȶ°Ŗ´ŗ
Ž—NGE-;<sɻpŘ%žſVW%Þ¬«"cȸñò2°¬º»%´ŗ Ŗœ f
J š£¯2Ŵ¬¯œţv°ʥ%ŔǕʴʵ%´ŗ
1^
´µ.
F%3G3G·¸"&!:;<%'¹6¯°±©
y+º]2
·¸&íîv?,@,@GH- src/model Ǟ°2nśŜNM¯2ţŦñ°ŗ
seam generate-ui
—KMÂ-N¯2nhttp://localhost:8080/helloworld ŕŻ%ţŦñ°ŗ
1b ]+j»¼-"&!:;<%'•&MO±©
šŶn
Ƒƒ
C
^^
\
âF3‚™š£¯2345—KM¯œ°}ȶ°Ŗ´ŗ ŖŴn seam unexplode
'(¯2řô¾¿&—@DGǼƸ´¬Ų’sµûŖ´ŗ
^#I
—KM´¬Žn
;¤<K% seam deploy Ūū´¬ºn²³ñòœK‚PG& `[ -G&
deploy
N†F'(¯Ŗ´ŗ
seam
undeploy
ŖœŽ
undeploy
©C©
\a
fJ š›2 ª1«"
N†Fš"}—KMs%ÞŖ´ŗ
—O¶%Žn345Ž C Ye[ š£¯2—KMñòŖ´ŗ ^#I Ž persistence-dev.xml
OáM}
import-dev.sql
OáMġØn
myproject-dev-ds.xml
OáMs—KMñòŖ´ŗ KOáMŽÈĸtu%n śŜ&«"Ūū¯2 Y Ye[
š£¯Ŗ´ŗ
seam -Dprofile=prod deploy
345£®¯°—KMÂKOáMdÓ´¬Œ}Ŕ%ÞŖ´ŗ
K‚PGǃúvÒ­sÝ°œOáMǣǤ¯Ŗ´ ő èýũn persistence-staging.xmln
import-staging.sql
}
myproject-staging-ds.xml
vŠ%´ŗ
-Dprofile=staging
š›2KOáM&Ò­ǚǛ¯Ŗ´ŗ
1c w½¾ˆJ
•&MO¿%
řô¾¿&—@DG%
345—KM´¬ŷĆn
ôǶΐÀÁ‹F—KM&RĦŨ¬%¯Ƌ"ŗ
components.xml
śŜ&(ǣǤ´¬Œ}%n
}
b
[
&Ɲē%—˜F™Å<í¬Ų’sµûŖ´ŗ
<core:init debug="true"/>
śŜ&OáMŽn
]`345ŸŹƲ./´¬Œ}vţƲ—KMñò¬ºŔ¯òŖĿŻŗ
ş
e
[ ‚
ş
pages.xml
OáM
œŦ¯n
°Ŵòº&
C
;<Èĸ´¬Ų’sµ¬ŷƎn
345ŸŹƲ./´¬Ų’sµûŖ´ŗ
Æ
%Žn
FD¹&—KMÂVWX}ŋŌ´¬Œ}%Œò(°Ŗ´ŗ ^#I —KMÂv»
application.xmln ]#I —KMÂv» web.xml %´ŗÇ
¯º¯n
ˁ°ʼȡ½;âM½,-&MG˂Ģv»ũn
Ž
C
;RS&ÀÁƲ—KMÂR¯2°Ŗ´ŗ Œ&ķuí¬œ1Žn
C
;RS
WEB-INF/dev
—@DG—KM´¬Ų’sµûŖ´ŗ
!&§¨n;RSŽ ]#I µ¬°Ž ^#I GH-Kĕ%Žvţn Ğğv GH-Kĕ«›2K<ñò¬«"vûŖ´ŗ
śŜ&Íǘ›2ëţŲ’sµûŖ´ŗ
ş
;RSŽ C ;RS%vŨòũvûŖĿŻŗ ^+ ŽƄt%´ŗ
ÆŒ&͎˃Ţŀ%´ŗÇ
ş
?,@,@Ž‹F—KM%ÞŖĿŻŗ
ş
components.xml
%—KMñòœ;RSŽ‹F—KM%Þv°ŷĆsµûŖ´ŗ
©C©
\g
fJ š›2 ª1«"
ş
‹F—KMtuv;RSŽn
&éĥ—KMñòœGH-º»ŽƃýŖĿŻŗ
ş
—˜FGÅ<ínjboss-seam-debug.jar
TǞ¯vòòũvûŖĿŻŗ
ş
_`Z[  O@NM-¯vŨòũvûŖĿŻŗ
WEB-INF/dev
WEB-INF/lib
fJ š£¯2 ]#I K‚PG²³´¬ŷĆn ÀÁ‹F—KMŽnsrc/
action Ú-—@DGµ¬GH-!&ŖŖš£tu%´ŗ ¯º¯v»sn fJ Ž
^#I K‚PG“´¬ÀÁ‹F—KM“ż¯2°ŖĿŻŗ
1f Si - '˜¡±©
)o Ž CC b
) —KMñòŖ´ŗ # š£´¬v»ũn
Q)
š£´¬Œ}ʰʱ¯Ŗ´ŗ
ŒòŽ
b
)
OáD-'Ɗs˜<ñò2°Ŗ´ŗ%Ŕn Qo HFO¶‡% )o
š£´¬Œ}Ŕtu%´ŗ
Œò("Ž
)
-,FsŲ’%´ŗ
^+
síîv˜‚5&
Qo
&M-n
|àb
b
)
OáD-'Ɗ˄ʺŗ
Œò»&-,F(ýũn
)o
345s—KMtuvûŖ´ŗ
1f Si .O%4
#
Qo
Ž
ʹʺ&—O¶cd%Ɨ˅ñò2°ŖĿŻŗ
'(´¬œ1n^+ KOáMǚǛ¯2 ^| ) M-H
š£¯2M-¯vŨòũvûŖĿŻŗ
Ž
^+
RġŖv°M-%Ž/p¯ŖĿŻŗ
^| M-HŽmf
Y6½½[`B`
½B[[½_[ º»ĕœK<tu%´ŗ
1f1 _ 1 j .O%4
#
Qo & ]` cdŽ server/default/deploy/jbossweb-tomcat55.sar µûŖ´ŗ jsf-libs
—@DGº»
myfaces-api.jar
n
myfaces-impl.jar
ǼƸ´¬Ų’sµûŖ´ŗ
!¯2n—@DG
jsf-api.jarnjsf-impl.jarnel-api.jar
}
el-ri.jar
;Č´¬Ų’sµûŖ´ŗ b & #I Ž lib —@DGµûŖ´ŗ [ & #I
Ž ) -º»IJǁtu%´ŗ
ñ»nconf/web.xml
˄ʺ¯2ţŦñ°ŗ
©C©
ʼȡ´¬Ų’sµûŖ´ŗ
myfaces-impl.jar
jsf-impl.jar
\h
2 B%3À4
ÁµB%TU%
•#
ëŨ¬ ) Ö&ŀȌŠ‘ʝŽn ;,Ã- &‘ʝ};RS&‘ʝ%´ŗ
;RSŽn-,OvĊ–‚PGnĻļŽ
^
%´ŗ
;RS&M-N-Žn;,Ã-}ŋŌʔŨ»òn!&;,Ã-ŀ%Ò­ʫ
ý»òŖ´ŗ ˜M‚PG45 ÆB
Ç Žnqĥ&;RSÒ ÆM-N-ȃÇ
;,Ã-ŀ&Ò­?M-¯n
«¬;RSŏ&/Šv×Øǎ2nƲ×Øǎ2tu´¬ÂLŎƛ‡ƿǀ¯Ŗ´
ŗ
×ØÙŖòœ;,Ã-º»ɾǂª1Ŗ¯Ƌ"ŗ
2 B%3À4
;,Ã-ŽOD‡ðG«›2²³nȒȓñòŖ´ŗ 345Ž C #~
ƭìƗ¯«›2;,Ã-ˆÁ
Æ
Ç
ǂzŠĂă´¬Œ}Ž%ÞŖĿŻŗ
;,Ã-ŽĻļnˇˈŠ%´snŷƐ«›2;,Ã-Žï,45«›2ˆÁñ
òŖ´ŗ
Ĝˆ& ;,Ã-ŽśŜ&Ļû%´ŗ
ş
-,D-;,Ã- Æ[ ZÇ
ş
M¹ ÆŖœŽG?-Ç ;,Ã- Æ^C Æ ĖÇ ZÇ
ş
‚;,Ã- Æ~J ZÇ
ş
“”;,Ã- Æ¢C ZÇ
ş
EF45;,Ã- Æ ZÇ
ş
l‚S-KE-;,Ã- Æ Y
ZÇ
ş
345;,Ã- Æ#YY[
ZÇ
Œò»&;,Ã-&°ţÖºŽn–DFĝŋŌ´¬ƞƟɆº»ȍƦ¯2°¬Œ}sľº
ûŖ´ŗ
¯º¯nŒ&"nj
)
֎Ɖ®¯°ºŔ¯òŖĿŻŗ
“”;,Ã-}l‚S-KE-;,Ã-%´ŗ
]^
345ŀ%&ƪƫ•=s}2Ŕˉˊ%?HsǶ²¯ĝ´°
Ö&=ȍŽn
+
Ö&×ØÙØ;,Ã-
ÆG?-nEF45n345Ç
sl‚S-K‚FG&ˋNJº»Ğd&ƬȘ՜v°º»%´ŗ
èýũn'ę&345&ðGOK&ˋNJº»ƃ¬}78K™MEF45Žˌ
12¼ȍˍɎvŞɃ%´ŗ
!&œ1nź}ŻŠ&
;RSŽn“”;,Ã-µ¬°Žl‚S-KE-;,Ã-&-;TǞñ
òŖ´ŗ
vȖv»n!ò»Ž345&ˋNJº»}2ŔƬȘ&µ¬;,Ã-Ŧº»%´ŗ
ːn!òɇò&;,Ã-ƃ2°ÞŖ¯Ƌ"ŗ
©C©
\k
;,Ã-ĸ;RSŗ
2 43
H4B%3À4
à ÄÅ
ˆ…ƪƫŔœv°;RS
ÆƠ-,D-EF45
Ç
Žn°ÖŔ-,D-;,Ã- Æ'ꐎ;,Ã-%ŽµûŖĿŻÇ ǞºòŖ´ŗ
-,D-;RSŽnµŖûȗȘș°Ŕ&%ŔvţnŖ›œţĊ–‚PGƓȫ%Ŕµ
ûŖĿŻŗ %ŔnŒò»ŽƢ’%¯ũ¯ũǍǎnjŖ´ŗ
21 O¶%
B%3À4
M¹;,Ã-ŽĐšŔˎ°đƪƫÕÖ;,Ã-%n ĩ&ȑˏ&M¹ːˑ´¬
]^G?-;,Ã-&‘ʝ&wʕä%´ŗ
!òŔººľ»Ŵnb
G?-&HMOMG}ŋŌʔŨ»òœM¹;,Ã-Žn
M¹;,Ã-&šŔƢ’v£è%µûnšŔ«ţĮ£ñò¬Ŕ&%´ŗ
G?-ĄąÎnM¹;,Ã-ŋŌ´¬;RSŽȒȓñòŖ´sn
!ò»&ƪƫŽnǙvţ}ŔG?-&HMOMG&ç%ŽíîºÖǂŤ%´ŗ
I|
ǐȍµ¬°Ž
IJ
«û
;RSƭìƗ´}Þn
M¹;,Ã-Žn!&ƭìƗ¯ŦŨ&œ1²³nȒȓñòŖ´ŗ
22 ~B%3À4
Ãy ÄÅ
‚;,Ã-ŽnƪƫDĕ™ñòœ‚&Ğd&M-N-}ŋŌʔŨtu
¯Ŗ´ŗ
M¹-êŀ%ƪƫ&0Ĉästu%n
'ꐁ‚Dĕ™¯2°¬çn
‚ȍƦ´¬ŠŻvM¹º»ŔƪƫGE-stu%´ŗ
ŒòŽĞ˜M<&—NÈä-sŌ/¯2°¬GFL–-&«"vķu
ǍǎnjŖ´ŗ
ƪƫŽ'ęGHM&œ14HMƛñòŖ´ŗ
!&œ1nŒ&ŞɃŽÔƒœM<&ɕpĝþ¬ÿN“¯2ˌ12ȱȲ%´ŗ
2S ‘B%3À4
Ã
Æ ÄÅ
“”;,Ã-Ž
%ŖñŀȌ}v¬;E%´ŗ
“”
Æ
CÇ
Žn78&ˋNJº»&
Ö&pŘſÌ%´ŗ
!òŽ78}&MNHG45nG?-në«ì—N¹-H8G45Ŗœʲ
ºŔ¯òŖĿŻŗ
¯º¯n78}›2“”Žn
Ö&ƺƻ>Ɣ¯Ŗ´ŗ
èýũnЋ,ŒđnĐ˒ʐťđnĐơĠp³đŽ´ƚ2“”%´ŗ “”}°"Ŕ&s Ö&Đ7-3-𵬰ŽĐ78-đ'Ɗ¯2°¬}Ǫýœ°ºŔ¯òŖĿŻs
ŋʂŽŲŴ¯Ŕ!&ĻûŽvûŖĿŻŗ
“”ŽnĐ78sŒ&œ@<œ&ŀ%ǹǰ¯2°¬Œ}đ}ŋŌʔŨ»òœƪƫƀÕ¯Ŗ´
ŗ
ʥ&78ŽnĻļ¤œ@<œ%nµ¬ÎNJŕ(ŀ&ԃ&“”Õ›2°¬ºŔ¯òŖ
ĿŻŗ
“”;,Ã-Žnɂv¬“”º»&ƪƫ&˓ɞvţ¯n˜™&˔˕}v»v°Œ}ƀƍ¯
Ŗ´ŗ
“”&ˋNJº»345Ö°2Ǫý¬Œ}ƅò¬ŽÎçsºº¬ºŔ¯òŖĿŻŗ
¯º¯nƅò2¯Ŗ"}nŒ&;EsǕƩސvûnŔ"“”v¯%ŽǪý»òvţv¬Ŧ
©C©
ao
;,Ã-ĸ;RSŗ
ȅ"}ȶ°Ŗ´ŗ
µ¬“”Žſ Ö&G?-&çj°2°Ŗ´ŗ ԃ&G?-Ŗœʲ“”Žn
«›2ƿǀñòœï,45š›2nˆÁzñòvŨòũvûŖĿŻŗ
µ¬“”ŽŖœ
N-G
N-GŽɐĈl‚S-KE-&ˋNJ%ŽƢ’vƬȘÕ֓”%µûn
N-Gs˖˗«ţŸą´¬ŷĆn
l‚S-KE-&ƪƫĀāȽÞ.Œ´tuĬ՛2°Ŗ´ŗ
ŽN-GˆÁ£ĞƐvï,45&EFƿǀ¯Ŗ´ŗ
%´ŗ
«û˘°“”& ŸqĥŸ %“”Ƕ²ñĿ¬«"v S- Ŕtu%´ŗ ŒòŽÉòœķu%´ŗ
Ļļn'ꐎG?-}G?-&ç
C[
EF45ŀ%
«û“”ƪƫŽƀÕñòŖ´ŗ
Žcdtuv
“”NM‡œ
'Ɗ¯n
¼/ŠƄʃĬv“”Ȓȓ¯n
78s“”ŀį¯2Ŕn78K™MEF45«ûƀÕñò¬ƪƫŽęȃvţÀǤ¯v
°Œ}sƀƍñò2°Ŗ´ŗ
ŽÍKE-ŀ&͏ɐĈ“”;,Ã-ŀ%Ƕ²´¬Ïdz&G?-Ð=4ä¯
Ŗ´ŗ
µ¬°Žn
ŽGHM–Hœ8&ŀ“”&ƪƫƀÕ´¬«"cdñò¬ŷĆŔµûŖ´ŗ
2[ IJ;<%B%3À4
à ÄÅ
EF45;,Ã-Ž78K™Mŋ´¬ƪƫƀÕ¯Ŗ´ŗ
°ţÖº&Ɂè%Ž“”&ç%ƪƫƹí´¬Œ}sí£vŒ}sµûŖ´sn
K™M78ŋ´¬™K˜ȟȠśé&;RSƀÕ´¬œ1n
EF45;,Ã-š£´¬Œ}Ž˙³%ÞŖĿŻŗ
Ifah Y[ ʼnŇ%ŽnEF45;,Ã-Ž Y[ EF45ƬȘ¯Ŗ´ŗ
2^ gU4&MI4B%3À4
à ÄÅ
l‚S-KE-;,Ã-ŽɐĈl‚S-KE-ŋ´¬ƪƫƀÕ¯Ŗ´ŗ
Œ&ƪƫŽ
~|
?‚
Æ
B~|Ç
«›2•=}ijäs(ľòŖ´ŗ
l‚S-KE-Žnԃ78&ԃMNHG45˚ț¯¯Ŗ´ŗ
ű›2nŒ&ƪƫŽÔƒ78&ç%ǂŤvēĔ%ƹíñòŖ´ŗ
ǹǰ&N-GŽǹǰ&l‚S-KE-M-N-Ɣd¯n
l‚S-KE-&HMOMGŽ KE-dÓƏ˛ š£´¬Œ}%éĥdÓñòŖ´ŗ
ű›2nl‚S-KE-&ˆÁ&œ1ĞƐvï,45ŽµûŖĿŻŗ
2b "&!:;<%B%3À4
Ã+ ÄÅ
345;,Ã-Ž–DFƞƟº»ëvØ&–DF&;,Ã-%
´ŗ
©C©
a
;,Ã-ĸ;RSŗ
345;,Ã-ŽƠncd—NnȺȻ—NnÂNŗ&«"v˜ŠvȟȠ
ƀÕ´¬œ1ǍǎnjŖ´ŗ
èýũn
Ž345;,Ã-ŀ
!&Ŕ&&cdĝÂNŗƀ•¯2°Ŗ´ŗ
2c B%3À4
ǀ
;,Ã-ŽÒ­æçn;,Ã-ȃ
&EFdÓ¯Ŗ´ŗ
Œò»Ž–DFƞƟ&EF45ĝG?-ƙĬ}ÍƟķu¯Ŗ´ŗ
Š&«"vƜ%Ŕ;,Ã-ȃ}˜M<s%ÞŖ´sn
Ļļn
;RSM-N-;,Ã-ȃ˜M<¯Ŗ´ŗ
ű›2n;,Ã-ŀ%Žn
;RSM-N-Ž;,Ã-ȃÒ
Æ°ÖŔ%Žv°sĻļŽ;RSÒ}͏Ç
%ɼƐñòŖ´ŗ
Contexts
GH-Ļ¯2Ğd&-;&Ɠdñòœ;RSM-N-K™H‡ŠGE
-Ŕ%ÞŖ´ŗ
!òŽ
Context
MNOP-&-DF<§ìÖ°œM-N-ǵ&GE-ƿǀ¯Ŗ´ŗ
User user = (User) Contexts.getSessionContext().get("user");
Ò­“ż´¬Ɯcd¯œûÈĸ¯œû´¬Œ}Ŕ%ÞŖ´ŗ
Contexts.getSessionContext().set("user", user);
¯º¯vs»nĻļnM‚PG45Ļ¯2;,Ã-º»;RSIJǁ¯n
œ‚PG45Ļ¯2;RSM-N-;,Ã-TǞ¯Ŗ´ŗ
2f B%3À4
£¤ÈÉÊË
$V&«"n;RSM-N-ŽĞd&˝ǘ&-;º»IJǁ´¬Œ}ŔµûŖ´
sn
!òśé&ŷĆn´ƚ2&-,O-;Ž
ÉÊËÌ
ű›2¥¦ñòŖ´ŗ
!&Ë˞ŽśŜ&Ļû%´ŗ
ş
M¹;,Ã-
ş
‚;,Ã- Æ~J ZÇ
ş
“”;,Ã- Æ¢C ZÇ
ş
EF45;,Ã- Æ ZÇ
ş
l‚S-KE-;,Ã- Æ Y
ZÇ
ş
345;,Ã- Æ#YY[
ZÇ
ƭìƗ´Œ}«›2ÉÊËÌ&¥¦Ŕtu%´ŗ
‚º»Ò­«›2GE-´¬ŷƎ°ÖŔnÉÊËÌ¥¦sǶ²¯Ŗ´ŗ
Contexts.lookupInStatefulContexts()
b
2i ÌÍÎ0ÏD•#
©C©
a)
;,Ã-ĸ;RSŗ
C[
ƞƟŔ
^
ƞƟŔ͏GHMº».Œ¬ÍÎÏ(&G?-•=´¬œ1&ķގŖ›œţdÓ¯
2°ŖĿŻŗ
C[
;,êŽſȩ´ƚ2&-DF<ÍÎÏ(Šʯ/ñĿn
-DF<EO}´¬Œ}345;<˟ĿŖ´ŗ
^
;,êŽ-,D-;RSsÍÎÏ(ŠGE-ñò¬Œ}tu¯n
ԃ&-DF<sˠ}Ö&-,D-EF45
GE-´¬v»ũèé-K¯Ŗ´ŗ
Œ&ɸ¬ɹ°ŽˡƂ&㺰ÍĈG?-¹-}´¬ɩ°-NM&
]`
345%ŽǕʴʵ%µ›œºŔ¯òŖĿŻŗ
¯º¯nƾţ&ˡƂ&㺰īÍĈG?-
Æ##åÇ
ƾ£´¬š®&345&œ1n
ÍÎÏ(ŽŖˢòŔv°Ɂ'%µûnK™H‡Å—}¯2RñòvŨòũvûŖĿŻŗ
ŽÍÎÏ(•=DMˣ;,Ã-ŗˤûÙØŖ´ŗ
EF45}345;,Ã-Ž¤-DF<v›2°Ŗ´ŗ
ŽÍÎÏ(ŠÐ=ñò¬œ1;,Ã-ŀ%&ÍÎÏ(G?-ɋ¯Ŗ´ŗ
M¹}‚;,Ã-ŽˆƦ4™-DF<%´ŗ
˥˦Əýũl‚S-KE-;,Ã-Ž¤-DF<%´sn
'ꐎÍÎÏ(Ž}2ŔŖò%nŒ&Ɂ'Žź}ŻŠȥƉñòv°ºŔ¯òŖĿŻŗ
šŶn
͏ɐĈ“”;,Ã-ŀ&ÍÎÏ(G?-4HMƛ´¬Œ}«›2n
Žn“”;,Ã-&œ1 KE-Ȧ}“”Ȧ}&4™-DF< ŗ'˧¯Ŗ´ŗ
EF45;,Ã-Ž¤-DF<%¯ũ¯ũ˨ǶĬ&ƪƫġĢ&%n
«ûEF45-;;RSŽÍÎÏ(GE-º»°ÖŔƀ˩ñò2°Ŗ´ŗ Ž—O¶%G?-
EF45-;EF45
}
C
4HMƛ¯Ŗ´ŗ
Æ
!¯2nǶ²´¬ŠŻv—F<KFGŔ¥Ɨ¯2˪ô¯Ŗ´ŗÇ
345-;&;RSŽĻļ˨ǶĬ&ƪƫƀÕ¯v°œ1n
ŒòŽ345-;&;RS&œ1&—O¶&ɸ¬ɹ°%ŽµûŖĿŻ
ŗ
vȖv»n™K˜D¹&ÍĈäŽ
ˌ˫
;-sºº¬º»%´ŗ
¯º¯n
@Synchronized
ï,45ǣǤ´¬Œ}%n
EF45
Ŗœ
C
;RS4HMƛñòœ-DF<ŗLjĂtu%´ŗ
Œ&ÍÎÏ(ŗŽn
ôǶĨˬ%&ĞƐvpŘŖ›œţŲ’}´¬Œ}vţn
GHMsɦŹ˨ǶĬEF45ĝ“”ƪƫš£%Þ¬Œ}ƬȘ¯Ŗ´ŗ
##å
21 B%TU%
;RSŽ ~ Æ~[ [ C `B
Ç %´ŗ ˭ȔŠŽn
;RSŽ C Ŕ¯ţŽ ^ +o ?NHMƛ %´ŗ Ž
;RSs
^
sŲų%ŽvţnŖœ
^
+o
ƒˮ&;,êsvţ2Ŕš£%ÞŖ´sn Ž ^ +o ʝɉ¯2cȸñòn^ +o
}LjţńĆñò2°Ŗ´ŗ ŽśŜ& ;RSNM R¯Ŗ´ŗ
ş
^ +o -,D-EF45 ş
^ +o -,OEF45 ş
^ +o ?,@,@ ©C©
a+
;,Ã-ĸ;RSŗ
ş
C
ş
^ +o ÂFE‚Ñ/¡ 21 43
H4IJ;<% -,D-EF45
;RSŽnԃ&ƭƗ¯“¯2ƪƫƀÕ´¬Œ}s%ÞŖĿŻŗ
ű›2n!ò»ŽĻļñŖǾŖv
;,Ã-q&Ɛ;RS&ƪƫɕp´¬&ǍǎnjŖ´ŗ
!ò»Ž
&G45-ê}¯2š£%Þ¬ºŔ¯òŖĿŻsn
Ěz&œ1
;RSKâ,@ƿǀ´¬Œ}Ž%ÞŖĿŻŗ
b
b
-,D-EF45 Ž°ÖŔ-,D-;,Ã-ǞºòŖ´ŗ
®¯°M-N-sŚG?-%š£ñò¬&}ÍƟ-,D-EF45
ŽÍÎÏ(ŠGE-ñò¬Œ}stu%´ŗ
M-N-G?-ĉû…2¬Œ}Ž
^+ ;,ê&˯˰%´ŗ Æ ĻļM-N-ŽƲĮ£tuvº»ĉû…2»òŖ´n
ÖŖûn
&š£˱Ø&Ŕ&º»—NġĢM-N-ȃƃÖŨ¬Œ}s%ÞŖ¬Œ}ƬȘ¯Ŗ´
ŗÇ
-,D-EF45 ŽšŔȗȘ&ľºv°ȑˏ& ;RS%´ŗ
-,D-EF45
;RSŽ
Component.getInstance()
ŖœŽ
@In(create=true) š£¯2M-N-ätu%´ŗŒò»Ž ù€ FGFĝ ƣƤ new
ĊDN%M-N-äñò¬ƚÞ%ŽµûŖĿŻŗ
211 43
Q#IJ;<% -,OEF45
;RSŽn
&ԃ&ƭƗ¯“¯2ƪƫƀÕ´¬Œ}s%Þ¬ŦŨ%vţn
ԃ&G?-“¯2ƪƫƀÕ´¬Œ}Ŕ%ÞŖ´ŗ
—N¹-ƀÕñò2°v°345&ƪƫŽn
Ļļn-,OEF45
«›2ƀÕñò¬Ų’sµûŖ´ŗ
ŒòŽ
}ĩ&ƾţ&
]^
345OD‡ðG}&ǕÞvDZ°%´ŗ
ǹǰ&“”&ȟȠƣƤ
HttpSession
ʈ¯Ù1¬Ĥľûn
“”;,Ã-§ìÖ°œ-,OEF45
&M-N-ȃ&ŀ!òƀÕ´ƚÞ%´ŗ
ŒòŽn
sŒ&ƪƫ&HMOMG&•=tu¯n
ɂv¬ÍÎ'(ŀ&“”ŋŌ´¬ƪƫ&ç˓ɞsv°Œ}ƀƍ¯Ŗ´ŗ
-,OEF45
Ž¯ũ¯ũ
b
ĚzŔ¯ţŽO¶‡&–ĴF&œ1Kâ,@ƿǀ´¬
;RS&˜FÙ }¯2š£ñòŖ´ŗ
G45-ênŖœŽn
b
—O¶%n-,OEF45
Ž“”;,Ã-}˜M<¯Ŗ´ŗ
!ò»Ž‚Ŕ¯ţŽ-,D-;,Ã-}˜M<%ÞŖĿŻŗ
EF45-;&-,D-EF45 ǵ&ÍÎÏ(G?-Žn °Ö%Ŕ «›24HMƛñòŖ´ŗ
©C©
aQ
;,Ã-ĸ;RSŗ
-,OEF45
;RSŽ
Component.getInstance()
ŖœŽ
@In(create=true) š£¯2M-N-ätu%´ŗŒò»Ž ù€ FGFĝ ƣƤ new
ĊDN%M-N-äñò¬ƚÞ%ŽµûŖĿŻŗ
212 F%3G3G ?,@,@
Ž;,Ã-ȃ}˜M<¯n;RS}¯2ķu´¬Œ}ŔµûŖ´ŗ
?,@,@Žn;,Ã-ĸɼƐXǤý2ijɼƐXÕ֜1n
?,@,@&M-N-Žn «›2ˇˈŠM-N-äñò¬«ûn Ģ¯ȅ C
;<ŀ%ǂzŠ˜M<ñòŖ´ŗ
?,@,@ ;RSŽ˜M‚PG45Ŕ;,Ã-ˆÁŔR¯ŖĿŻŗ
Ŗœn?,@,@ ˲&—Nƌ…Ĭ¥ƍ&ƭìƗ¯ŔR¯2°ŖĿŻŗ
?,@,@
ŽnĻļ
b
G45-ê}¯2š£ñòŖĿŻsn
¯ũ¯ũnĚzµ¬°ŽO¶‡&–ĴF&œ1
b
;RSKâ,@ƿǀ´¬˜FÙ }¯2ķu¯Ŗ´ŗ Аn?,@,@
˜FÙ
}¯2š£´¬Œ}ŽwʕŠ%µûn
ǣǤ
½
Èĸ
½
ǼƸNM&ķu&'Ɗ&œ1&-,D-EF45
G45-ê}°›¯Ƌš£ñòŖ´ŗ
—O¶%n?,@,@
-,D-EF45 }Ž˜M<¯ŖĿŻŗ
Ž“”;,Ã-}˜M<¯Ŗ´ŗ
GH-N™ñòœʼnŇ%Žn
-,OEF45
ŀ%?,@,@
&ȺȻƀÕ´¬Œ}«ûn ?,@,@ ƣƤŠ“”µ¬°ŽEF45-;&
;,Ã-ȃ˜M<´¬ēsī%µ¬Œ}ƮƬ¯2ţŦñ°ŗ
Œ&=ȍ&œ1n´ƚ2&
345s
;RS%µ¬œ1?,@,@ dÓ´¬ľŨ%ŽµûŖĿŻŗ
?,@,@ ;RSŽ Component.getInstance() ŖœŽ @In(create=true)
š£¯2M-N-ätu%´ŗµ¬°ŽnƣƤ new ĊDNš£´¬Œ}stu%´ŗ
21S Æ
C
Ž-,D-µ¬°Ž-,OEF45
&«"š£ñò¬Œ}ŔµûŖ´ŗ
¯º¯n!ò»ŽEF45
&ķuƿǀ¯2°ŖĿŻŗ
ÆƎƏŠH8G45ˆÁn
ƎƏŠEÃ,@n
îɓŠGH-NäñòœƪƫD345n ^ +o ijĬn NM‡œÂÚF<vŠÇ
Ŷ&ɽ%n^
;,êv¯%
ĝ
ž`
š£´¬ēĔ˳˴¯2°Ŗ´ŗ
Œ&7-3-%Žn;RSŽEF45
&Ĥľû
C
%´ŗ
¯º¯nƾţ&345˜%Žn
-,OEF45
;RSGH-N™´¬«ûn “”µ¬°ŽEF45-;& C
;RSGH-N™´¬ēsƾǙīîɓŠ%µ¬Œ}ƮƬ¯2ţŦñ°ŗ
—O¶%nC ŽM¹;,Ã-}˜M<¯Ŗ´ŗ
EF45-;&
©C©
C
ǵ&ÍÎÏ(G?-Ž°ÖŔ
a\
;,Ã-ĸ;RSŗ
«û4HMƛñòŖ´ŗ
C
;RSŽ
Component.getInstance()
š£¯2M-N-ätu%´ŗŒò»ŽƣƤ
ĊDN%M-N-äñò¬ƚÞ%ŽµûŖĿŻŗ
ŖœŽ
@In(create=true)
new
21[ ¿JIÐ6 ÂFE‚Ñ/¾
Ž
;RS}¯2ķu´¬Œ}s%ÞŖ´ŗ
¯º¯nÂFE‚Ñ/¡
Žnĩ&
;RS}Ŗ›œţɂv›œ¾%ƭìƗñòŖ´ŗ
;,Ã-ȃĻ2!ò»ƭìƗ´Ĥľûn
|
Ė
µ¬°ŽnY
ɍħñòœÂFE‚ȏnjĦŨŖ´ŗ
ÂFE‚Ñ/¾
Žn
;,Ã-}˜M<%ÞŖĿŻŗ
Ŗœn!ò»&ĐƭìƗ¯˵đ&EF45ĝ“”ƪƫGE-%ÞŖĿŻŗ
¯º¯nÂFE‚Ñ/¾ Žn˜M‚PG45}ĩ& &ķuR¯Ŗ´ŗ
ÂFE‚Ñ/¡
Ž345«›2M-N-äñòŖĿŻŗŒò»ŽÂFE‚Ħħ¯œ}ސ
^ ;,ꐫ›2M-N-äñòŖ´ŗ
21^ O%PI&;<%
!&¤‚FG
ƘM‚PG45n;,Ã-ˆÁn—Nƌ…Ĭ¥ƍvŠÇ
'(´¬œ1n Ž;RS&ƭìƗ¯MNE¯vŨòũvûŖĿŻŗ
C
%Žn
Ž;RS&M-N-äŸŹĂă´¬œ1nĞƐvcdŽƄ’%´ŗ ?,@,@
%Žn˜M‚PG45};,Ã-ˆÁsƓdñò2°v°œ1nMNE45ŽƄ’
%´ŗ
EF45
%Žn^
MNENEF45
;RS&œ19:¯vŨòũvûŖĿŻŗ ï,45ŽśŜ&«"š£¯Ŗ´ŗ
@Stateless
@Interceptors(SeamInterceptor.class)
public class LoginAction implements Login {
...
}
¯º¯nŔ›}Ʒ°ēĔŽnejb-jar.xml MNENdÓ´¬Œ}%´ŗ
<interceptors>
<interceptor>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor>
</interceptors>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>*</ejb-name>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
©C©
aa
;,Ã-ĸ;RSŗ
21b B%TU%
Ñ
´ƚ2&
;RSŽÒ­sŲ’%´ŗ
ï,45š£¯2;RSÒ­ĉû…2Ŗ´ŗ
@Name
@Name("loginAction")
@Stateless
public class LoginAction implements Login {
...
}
Œ&Ò­Žn
;RSÒ
Æ
Y
Ç
%n
^
Ƒƒ%dÓñòœĩ&Ò­}&ŋŌŽµûŖĿŻŗ ¯º¯n ;RSҎnjƋ"Š
b •= &«"/p´¬œ1n ) Ö&;EŽÍw}Ǫý¬Œ}s%ÞŖ´ŗ
Ž;RSÒdÓ´¬˶w&ēĔ%ŽµûŖĿŻsn
Ò­Ɠd´¬Ų’sµûŖ´ŗ
Ŕ¯!"¯v°}nĩ&
ï,45ŽŠòŔķu¯v°%¯Ƌ"ŗ
@Name
°ÖŔnŠŒº%
njƋ"Š
b
&«"n
;RSM-N-Žn
Ļļ;RSÒ}͏ҭ&;,Ã-ȃ}§Ć¯Ŗ´ŗ
ű›2nèýũnContexts.getStatelessContext().get("loginAction")
š›2n
LoginAction
GE-%Þ¬%¯Ƌ"ŗ
˭ȔŠŽn
¼ȧs;RSM-N-䴬Ύ°Ö%Ŕn
!òŽ;RSҐ«›2®¯°M-N-ȃ}§Ć¯Ŗ´ŗ
¯º¯nŒ&ŷĆŔ
b
&«"n
345ŽK™H‡Ĝʔ°œ
#~
;«›2;RSĩ&;,Ã-ȃ}§ĆñĿ¬Œ}Ŕtu%´ŗ
Ğd&;RSs4-,‡&ŀ%ԃ&Kƿǀ´¬ŷĆ&ØnŒòŽí£%´ŗ
èýũnǹǰ&K™M
User
Ž
currentUser
EF45;,Ã-ȃ§Ćñò2°¬ºŔ¯òŖĿŻsn
wē%nµ¬•=ķu&ƠȔ%µ¬
User
Ž
user
“”;,Ã-ȃ§Ćñò2°¬ºŔ¯òŖĿŻŗ
īļǕ±˷v345&œ1n!¯2×ØÙØ
;RS&œ1n˃˸Ҏ¯ũ¯ũšľòŖ´ŗ
@Name("com.jboss.myapp.loginAction")
@Stateless
public class LoginAction implements Login {
...
}
C ;<ŀ%Ŕ b &¿Ə˛ŀ%Ŕ˃˸ñòœ;RSҎš£%ÞŖ´ŗ
<h:commandButton type="submit" value="Login"
action="#{com.jboss.myapp.loginAction.login}"/>
ŒòŽ"›}"¯°&%n
Ž˃˸ÒžſvÒ­?M-´¬ķuŔƿǀ¯Ŗ´ŗ
śŜ&«"v( components.xml OáMǣǤ¯2ţŦñ°ŗ
<factory name="loginAction" scope="STATELESS" value="#{com.jboss.myapp.loginAction}"/>
´ƚ2&×ØÙØ ;RSŽ˃˸Ò՛2°Ŗ´sn !ò»&ź}ŻŠŽ ©C©
ag
;,Ã-ĸ;RSŗ
B ġŖò2°¬ components.xml OáM«›2žſvÒ­?M-ñòŖ´ŗ
21c B%TU%
4B&.aÒ
@Scopeï,45š£¯2n;RS&—O¶-;
Æ;,Ã-Ç
Ċ˜HM<´¬Œ}s%ÞŖ´ŗ Œò«›2 «›2M-N-äñò¬În
;RSM-N-sŠŻv;,Ã-}§Ć´¬ºdÓs%ÞŖ´ŗ
@Name("user")
@Entity
@Scope(SESSION)
public class User {
...
}
org.jboss.seam.ScopeType
Žtuv-;&dz˹dÓ¯Ŗ´ŗ
21f ӀM#'ÔÕB%TU%
wĥ&
;RSGH-Ž4-,‡&ŀ%ԃ&K¨œ´Œ}s%ÞŖ´ŗ
èýũnEF45-;&;RS
User
GH-Žn
«ţǹǰ&78}¯2š£ñòŖ´sn78•=ǽƧ%Ž“”-;&;RS}¯
2š£ñòŖ´ŗ
@Role
ï,45Žn;RS“¯2ɂv›œ-;ÕÖǣǤƓd&K&dÓt
u¯2°Ŗ´ŗ
Œò«ûn
͏;RSGH-ɂv¬;,Ã-ȃ˜M<´¬Œ}s%Þ¬«"vûŖ´
ŗ
ÆŠ&
;RS
M-NŔԃ&;,Ã-ȃ˜M<stu%´sn
ŒòŽGH-D¹%tu%µû¼/M-N-äĮ£¯2°Ŗ´ŗÇ
@Name("user")
@Entity
@Scope(CONVERSATION)
@Role(name="currentUser", scope=SESSION)
public class User {
...
}
@Roles
ï,45Žnʠ¯°ŦŨƾţ&ǣǤ&K&Ɠdtu¯Ŗ´ŗ
@Name("user")
@Entity
@Scope(CONVERSATION)
@Roles({@Role(name="currentUser", scope=SESSION),
@Role(name="tempUser", scope=EVENT)})
public class User {
...
}
21i Ö×Ø×B%TU%
ƾţ&«°OD‡ðG&«"n
Ž¼Á¼ȧsƿǀ¯2°¬ķuš"Œ}ȌȵŨ2°¬ Æ^ Ő _ €J bÇŗ ×ØÙØ&
MNEN
ÆŶWÇ
}
;RS&EF%'Ɗñò2°Ŗ´ŗ
©C©
ah
;,Ã-ĸ;RSŗ
ŒòŽn345sHNM‡%×ØÙØ&;RS}ĝûIJû("Œ}rƱ
¯Ŗ´ŗ
ĸn×ØÙØ&;RSǯ¼&'ƊǞÞʺý¬Œ}«›2
&ĜˆķuL-N¤Mƛ´¬Œ}ñýrƱ¯Ŗ´ŗ
×ØÙØ&;RSŽ
&Ò­æç org.jboss.seam.core } ͏ҭ& C âF3‚ë°2dÓñòŖ´ŗ
×ØÙØ;RSŽn
;RS}ÍƟM‚PG´¬Œ}Ŕtu%´sn
ưĮv-N,@FG instance() ÂÚF<Ŕƿǀ¯Ŗ´ŗ
FacesMessages.instance().add("Welcome back, #{user.name}!");
22 –ORK;<%
ĸĬ&ơŪ µ¬°Ž Ăă&ʖɌ Žɭ%ŽŔ"Ǖƾƒ& C ôǶĨ˺¯°‘ʝ%´ŗ
ĸĬ&ơŪŽµ¬;RSsĩ&;RS&ȺȻtu¯Ŗ´ŗ
!òŽ;,ê
ÂÚF<µ¬°ŽM-N-ȃĩ&;RSĐM‚PG
ÆơŪÇ
đñĿ¬Œ}%'ǹ¯Ŗ´ŗ
ŒòŖ%ƃ2ޜ´ƚ2&ĸĬ&ơŪ&'Ɗ%Žn
M‚PG45Ž;RSs²³ñòœ}ސ.Œûn
!&ŶnȺȻŽ;RS&HMOMG&ç%Èä¯ŖĿŻŗ
-,D-;RSë°2nŒòŽ=ºv›2°Ŗ´ŗ
GHM&ˋNJº»nĞd&-,D-v;RS&´ƚ2&M-N-Ž˄ʺt
u%´ŗ
wēnŽ-,Ov;RS&š£ƢNJǞ°2°Ŗ´ŗ
ű›2nʟ¡ŠvĸĬ&ơŪŽŔŽĝµŖûí£vŞɃ%ŽµûŖĿŻŗ
ŽM‚PG45&wʕä}¯2n˜M‚PG45
Æ`B
Ç
&‘ʝɒŪ¯Ŗ¯œŗ
M‚PG45}“Ȼ´¬}n˜M‚PG45ŽśŜ&Ļû%´ŗ
ş
;,Ã-ĸ
f
˜M‚PG45ŽñŖǾŖvɂv¬;,Ã-º»-,Ov;RS×Øǎ
2¬œ1š£ñòŖ´ŗ
ÆĐ«û˘°
Æ_Ç
đ;,Ã-º»&;RSŽĐ«ûˎ°
Æ_Ç
đ;,Ã-º»&ȺȻŔÕÖºŔ¯òŖĿŻŗÇ
ş
˻ēȫŠ f ƜŽ;,Ã-ȃº»ƭũò¬;RS&ƙĬM‚PGñòn
Ŗœn;RSƙĬº»;,Ã-œ‚PG ÆB
Ç ñòþñòŖ´ŗ
M-N-ȃ!&Ŕ&cd´¬Œ}%nƭũòœ;RSsžſ;,Ã-È
ƒ&Ɯɕp´¬Œ}tu¯Ŗ´ŗ
ş
/Š
f
˜M‚PG45Ž;RSsƭũò¬œìǶ²¯Ŗ´ŗ
vȖv»n;,Ã-&ƜŽÎçǐ˼%Èä¯n
;RSs-,OŦº»%´ŗ
ˆ˽ŠnM-N-ȃ&ƜM‚PGnœ‚PG&ƝēƓd´¬Œ}%˜M‚
PG45Ž;,Ã-ȃ;RS&M-N-ȃ?M-tu¯Ŗ´
ŗ ŔnjȅŻn˜M‚PG45tu´¬œ1ï,45sš£ñò2°Ŗ´ŗ
@In
ï,45ŽƜsM-N-ȃM‚PGñò¬Œ}Ɠd¯2°Ŗ´ŗ
@Name("loginAction")
@Stateless
public class LoginAction implements Login {
©C©
ak
;,Ã-ĸ;RSŗ
@In User user;
...
}
µ¬°Žn ÂÚF<
@Name("loginAction")
@Stateless
public class LoginAction implements Login {
User user;
@In
public void setUser(User user) {
this.user=user;
}
...
}
—O¶%Žn
ŽKâ,@Òµ¬°ŽM‚PGñòœM-N-ȃҚ£¯2n
´ƚ2&;,Ã-&ÉÊËÌ¥¦(°Ŗ´ŗ
èýũn
@In("currentUser")š£´¬Œ}%ǂzŠ;,Ã-ȃƓd´¬Œ}Ŕ%ÞŖ´ŗ
Ɠdñòœ;,Ã-ȃ}ŋŌ¯œ·¸&;RSM-N-s¸ǰ¯v°}ސn
;RS&M-N-&²³˂Ģv»ũn
@In(create=true)
Ɠd´¬Ų’sµûŖ´ŗ ƜsĊ45% Æ[[ %ŔtuÇ %µòũn@In(required=false)
Ɠd¯2ţŦñ°ŗ
°ţÖº&;RS%Žn
!ò»sš£ñò¬}Œȅ%ŽŠŒ%ŔNjûĺ¯
@In(create=true) Ɠd´¬Ų’sµ¬ºŔ¯òŖĿŻŗ Œ&«"vŷĆn ;RS
@AutoCreate ï,45ÝŨ¬Œ}stu%n create=true ǂzŠš£¯vţ2Ŕn
Ų’v}Þļp³ñò¬«"vûŖ´ŗ
¿&ƜM‚PG´¬Œ}Ŕtu%´ŗ
@Name("loginAction")
@Stateless
public class LoginAction implements Login {
@In("#{user.username}") String username;
...
}
ơŪñòœƜŽÂÚF<sĄą¯œ‚PGñòœŶʖēȫơŪñòŖ´Æ
cdñòŖ´ Çŗ
èýũ
null
Æ;RSHMOMG}M‚PG45Ö°2Žŧɽ«ûƾţ&ȟȠsµûŖ´ŗ
Ç
ï,45ŽnƙĬsM-N-ȃº»Ŕœ‚PGñò¬ƚÞŒ}Ɠd¯Ŗ
@Out´ŗ
@Name("loginAction")
@Stateless
@Interceptors(SeamInterceptor.class)
public class LoginAction implements Login {
@Out User user;
...
}
©C©
go
;,Ã-ĸ;RSŗ
µ¬°Ž J ÂÚF<º»
@Name("loginAction")
@Stateless
@Interceptors(SeamInterceptor.class)
public class LoginAction implements Login {
User user;
@Out
public User getUser() {
return user;
}
...
}
ƙĬŽM‚PG}œ‚PG&Ɲēñò¬Œ}Ŕtu%´ŗ
@Name("loginAction")
@Stateless
public class LoginAction implements Login {
@In @Out User user;
...
}
µ¬°Ž
@Name("loginAction")
@Stateless
public class LoginAction implements Login {
User user;
@In
public void setUser(User user) {
this.user=user;
}
@Out
public User getUser() {
return user;
}
...
}
2S LOQ$OK#¿ÙJC
EF45
}?,@,@
;RSŽĻļ&
^
+o
&HMOMG&;˜FG
Æ@PostConstructn@PreDestroy
vŠÇ
&´ƚ2R¯2°Ŗ´ŗ
¯ºŔn
Ž
C
;RS
%&Œò»;˜FG&š£ŔR¯2°Ŗ´ŗ ¯º¯nŒò»&ï,45Ž )^^
ʼnŇ%Žíî}v»v°œ1n
Ž
@PostConstruct
}
@PreDestroy
}ɰȣv
)
Ö&ǣǤ;RSHMOMG;˜FGdÓ¯2°Ŗ´ŗ
ÂÚF<Ž
s;RSM-N-䯜ŶƭũòŖ´ŗ
;RSŽ Ö& @Create ÂÚF<&ØdÓtu%´ŗ
@Create
ÂÚF<Ž
;RSs˜M<´¬;,Ã-sĄą´¬}ސƭũòŖ´ŗ
@Destroy
©C©
;RSŽ g
;,Ã-ĸ;RSŗ
Ö& @Destroy ÂÚF<&ØdÓtu%´ŗ
ñ»n-,OEF45
;RSŽâHÂNȳ¯&
ÝŨ¬Œ}sŲų%´ŗŒ&ÂÚF<Ž;,Ã-sĄą´¬}ސ
«ûƭũòŖ´ŗ
@Remove
šŶnŋŌ´¬ï,45Ž
@Startup
ï,45%´ŗŒòŽƾţ&345ĝEF45-;&;RSǃ
£tu%´ŗ
@Startup
ï,45ŽGHMº»012ȺȻñò¬&ȏÖ&%Žvţ;,Ã-sôªñò
œ»ʽʾ;RSM-N-ä´¬«"
Ɠz¯Ŗ´ŗ
@Startup(depends={....})
Ɠd´¬Œ}«ûôª´¬;RS&M-N-ä&ËŽ&Ăăstu%´ŗ
2[ ÚÛÜÝO%4
#
ï,45Žn
Ğd&—KMÂ4êĊ%ŽŲų%Ɛ&ŷƎ!"%v°«"v;RS&ÛÜÝM
-D45tu¯Ŗ´ŗ ŒòŽśŜ&ŷƐưĮ%´ŗ
@Install
ş
,-%Ğd&MOH-HGĭ&;RSÅFG}¯œ°ŗ
ş
Ğd&—KMÂ4êĊ%;RS'ƊÈĸ¯œ°ŗ
ş
ĸĬsíîvŷĆŦŨĞd&;RSM-¯œ°
ÆOD‡ðG&pĨưĮÇŗ
@Install
Ž ÉÊËÌ } ĸĬ Ɠd´¬Œ}%/p¯Ŗ´ŗ
;RS&ÉÊË̎n
GH-â-ŀÍ;RSÒÕÖԃ&GH-sµ¬ŷƐn
M-´ƚÞ;RSƔd´¬œ1
sš£´¬Ž˾%´ŗ
Ž«ûÉÊ˿ËÌsƁ°;RSǚǛ¯Ŗ´ŗ
µ»º1Ɣ1»òœÉÊËÌ&ƜsµûŖ´ Æ̀ËÇŗ
BUILT_IN
)
FRAMEWORK
ő ×ØÙŖòœšŔÉÊËÌś°;RS%´ŗ
ő
<â,@OD‡ðG«›2dÓñòœ;RSŽ×ØÙØ;RS
Ċ˜HM<´¬tuĬsµûŖ´sn
345«›2Ċ˜HM<ñòŖ´ŗ
+
APPLICATION
ő
—O¶ÉÊËÌn
ŒòŽź}ŻŠ&345;RSë°2ǃú%´ŗ
Q
DEPLOYMENT
\
MOCK
ő —KMÂǫí&345;RS£%´ŗ
ő ,-š£ñò¬ÅFGĊ–‚PG£%´ŗ
| Ã}“”´¬ messageSender }°"Ò­&;RSsµ¬}´¬}n
©C©
g)
;,Ã-ĸ;RSŗ
@Name("messageSender")
public class MessageSender {
public void sendMessage() {
//do something with JMS
}
}
7ŎF,-%n íîv| Ãsv°&%nŒ&ÂÚF<Ȋ¯2¯Ŗ°œţvûŖ´ŗ
7ŎF,-s'(ñò¬}ސGH-â-¸ǰ´¬ŨòŠ345%Ž—KMñ
òv° ö ;RSp³¯Ŗ´ŗ
@Name("messageSender")
@Install(precedence=MOCK)
public class MockMessageSender extends MessageSender {
public void sendMessage() {
//do nothing!
}
}
ŽGH-â-%Ɲē&;RSǶƃ¯œ}Þn
sŠnj»&˜‚5š£´¬º̂ŨŖ´ŗ
####
GH-â-µ¬Ôƒ&GH-ŢŤĂă%Þ¬v»ũn
ŒòŽ´ũ»¯°Œ}%´ŗ
¯º¯n ƾţ&ĸĬÕÖƲĮ£tuvOD‡ðGVW¯2°¬ŷĆn ƾţ& ŹȔ!&OD‡ðG–DGñĿœ°}Žȶľv°%¯Ƌ"ŗ
ĩŠ&«"v;RSsM-ñò2°¬ºn
GH-â-ŀŠŻvGH-sš£tu%µ¬ºż2n
M-´ƚÞ;RSƔ1¬ēĔ&ēsƩŖò¬ŽŴ%´ŗ
@Install
ï,45ŽŒ&ķuŔĂă¯2°Ŗ´ŗ
Žƾţ&×ØÙØ;RS&ÛÜÝÞM-'ǹ´¬œ1qĥ%Œ&ÂLŎƛ‡
š£¯Ŗ´ŗ ¯º¯n345%Ž̃»ţš£´¬Ų’sv°%¯Ƌ"ŗ
2^ MÞ%—
ŒŻv"›}"¯°;<ƃ¬&̄Þ̄Þ¯2°¬&Ž̅%´ºʙ
private static final Log log = LogFactory.getLog(CreateOrderAction.class);
public Order createOrder(User user, Product product, int quantity) {
if ( log.isDebugEnabled() ) {
log.debug("Creating new order for user: " + user.username() +
" product: " + product.name()
+ " quantity: " + quantity);
}
return new Order(user, product, quantity);
}
žſvK™ÂFE‚&œ1&;<Š"¯2ŒŻvɏɐ´¬Œ}s%Þ¬&ºəɚ´¬&
ŽȞǖ%´ŗ
'ę&l‚S-K‚FGŋŌ´¬;<(«ûKߙŋŌ´¬ēs«ûƾţµûŖ´ŗ C
;ĴŎ,@s o ɪ&çŔ›}Ʒ°Ŕ&ǪýƗĿvº›œŒ}Žˆ…ˀÞ%´ŗ
ŽœţñŻ&;<žȀä´¬Kߙ #~ ƿǀ¯Ŗ´ŗ
@Logger private Log log;
©C©
g+
;,Ã-ĸ;RSŗ
public Order createOrder(User user, Product product, int quantity) {
log.debug("Creating new order for user: #0 product: #1 quantity: #2", user.username(), product.nam
return new Order(user, product, quantity);
}
ȃs˜Š%µ¬}ƎƏ´¬ºŠ"ºŽƺƻ%ŽµûŖĿŻ
ő
##
ȃs˜Š%µ¬Ų’sµ¬?,@,@
;RSśév»n
Šnj»&ēĔ%Ŕ"Ŗţ°ţ%¯Ƌ"ŗ
##
-™Ō§Žndebug(
ÂÚF<&qĥ%.Œ¬œ1n
"›}"¯°
if
(
log.isDebugEnabled()
)
«¬̆ɀŽƄ’%µ¬Œ}ƮƬ¯2ţŦñ°ŗ
ŽŠ&;RS
Log
M‚PG¯œºǘ›2°¬œ1n
ĻļnK™L,̇ǂzŠƓd´¬Ų’v°Œ}ŔƮƬ¯2ţŦñ°ŗ
}
Product
sn
;RS&ŷĆn!òŽñ»ƷţvûŖ´ŗ
User
ǹǰ&;,Ã-%íîv
@Logger private Log log;
public Order createOrder(User user, Product product, int quantity) {
log.debug("Creating new order for user: #{user.username} product: #{product.name} quantity: #0", q
return new Order(user, product, quantity);
}
KߙŽ¼/Š [JQB µ¬°Ž €ʭ [JJJ ƗūɍÝ´¬ºǚǛ¯Ŗ´ŗ [JQB
sGH-â-Ļ›2°òũn Ž!òš£¯Ŗ´ŗ !"%vŨòũn Ž €ʭ [JJJ
š£¯Ŗ´ŗ
2b
Mutable
O%PQR4w
@ReadOnly
345sǂzŠ
setAttribute()
ƭìƗ´}}ސn
EF45˜M<¯œtÈĊ–‚PG&ƪƫÈäsÔɮñò¬ŦŨv&%n
ƾţ&345˜&ķuŽˀţźŠ°°Ǥɑv
HttpSession
GH-N™&'Ɗ՛2°Ŗ´ŗ
ŒòŽOPMĊ˜sǶ²´¬}ސŦŨǹò¬&%n
ôǶÎç%,-ñò¬Œ}s%Þv°˜™&˔˕%´ŗ
ñ»'ę&ÔɮÂFE‚ŽEF45ƙĬ}˜M<¯œ4HMƛñòœĊ–‚PG™
HOŹȔġŻ%°Ŗ´ŗ !¯2n!òŽīîɓ%´ŗ
ŔnjȅŻn^
-,OEF45
Ž¼/Šĕ,@vPFG'(sŲ’%µûn
tÈƪƫ&Ôɮ}̈̉ñòœ
^
;,êŽƙĬD¹&ÔɮvŠšǃäs("Œ}stu%´ŗ
µ°ţn´ƚ2&
78s
^
+o
R´¬̊ŖòœʼnŇ%pŘ¯2°¬ľŨ%ŽµûŖĿŻŗ
!Œ%nEF45}“”-;& C }?,@,@ ;RS&œ1n
Ž
]`
;,êEF45GH-N™&$%GH-NEOvƪƫ•=&ĞƐvDMˣƿǀ¯Ŗ´
ŗ
EF45ĝ“”-;&
C
;RS&œ1n
Žn
;RSs345«ûƭìƗñò¬G?-&ʆn
setAttribute()
ƭʻŒ}«û¼/ŠÔɮƵŖ´ŗ
©C©
gQ
;,Ã-ĸ;RSŗ
ŔnjȅŻnŒ&-H,‚ŽıØIJûũºû´¬;RS%ŽƄɧÁ%´ŗ
Œ&ɸ¬ɹ°Žn
org.jboss.seam.core.Mutable
MNOP-'Ɗ´¬ºn
org.jboss.seam.core.AbstractMutable
ȁȂ´¬ºn
µ¬°Žn;RSŀǯ¼&ĕ,@PFG&K‚FGVW´¬º«ûĂătu%
´ŗ śŜèz¯Ŗ´ŗ
@Name("account")
public class Account extends AbstractMutable
{
private BigDecimal balance;
public void setBalance(BigDecimal balance)
{
setDirty(this.balance, balance);
this.balance = balance;
}
public BigDecimal getBalance()
{
return balance;
}
...
}
µ¬°ŽnÍƟ&î¨ǁ¬œ1 @ReadOnly ï,45&š£Ŕtu%´ŗ
@Name("account")
public class Account
{
private BigDecimal balance;
public void setBalance(BigDecimal balance)
{
this.balance = balance;
}
@ReadOnly
public BigDecimal getBalance()
{
return balance;
}
...
}
EF45ĝ“”-;&?,@,@
;RS&ŷĆn
Ž
ÔɮsƄ’vŷĆn
Æ
“”-;&Ç
?,@,@sǹǰ&
•=&ijĬ;,Ã-ŋŌÝŨ»ò2°¬ȃûn
G?-ʆ
setAttribute()
ƭʻŒ}«û¼/ŠÔɮ&p³LjĂ¯Ŗ´ŗ
Œ&-H,‚ŽŲŴ¯ŔîɓŠ%Žv°&%n EF45ĝ“”-;?,@,@ ŽơƬ¯2š£¯2ţŦñ°ŗ
?,@,@
M-N-Е=đ´¬œ1n
-,OEF45
ĝ
C
°Ö%ŔVW´¬Œ}s%ÞŖ´ŗ
śŜèz¯Ŗ´ŗ
@Stateful
@Name("account")
public class AccountManager extends AbstractMutable
{
private Account account; // an entity bean
@Unwrap
©C©
g\
;,Ã-ĸ;RSŗ
public void getAccount()
{
return account;
}
...
}
345OD‡ðGë°2
EntityHome
GH-Ž
;RSš£´¬Œ}%?,@,@
M-N-•=´¬Éòœƿǀ¯2°¬Œ}ƮƬ¯2ţŦñ°ŗ
2c QßK
!w“DB%TU%
;RS%Žv°Ċ–‚PG}Ōɺ´¬Œ}Ŕ¯ũ¯ũµûŖ´ŗ %ŔnĝŽû
@In
š£¯2
;RSM‚PG¯n
ƜĝÂÚF<˜M—@™¿vŠ%!ò»š°œ°}ȶ"Œ}sµûŖ´ŗ
ΐŽn!ò
;,Ã-&HMOMGŋŌÝŨ¬Ų’ñýµûŖ´
Æèýũ
@DestroyÇŗ
!Œ%n
;,Ã-Ž
%Žv°°Ċ–‚PGġĢŒ}stu%n
Žn;,Ã-˜M<´¬ī;RS}Ōɺ´¬Œ}rƱ´¬
)n+
&Éòœķuƿǀ¯Ŗ´ŗ
OáG;RSâN
Žn
;RSī;RSĊ–‚PG£&M-N-ä´¬ķu}¯2/pñĿŖ´
ŗ
OáGÂÚF<
Žn
;,Ã-ȃsȺȻñòœ}ސƭìƗñòŖ´sn
!ò}˜M<¯œƜŽÕ›2°ŖĿŻŗ
@Factory
ï,45š£¯2OáGÂÚF<dÓ¯Ŗ´ŗ
OáGÂÚF<ŽƜ;,Ã-ȃ}˜M<¯n
˜M<ñòœƜ&-;Ɣd¯Ŗ´ŗ ) ȑˏ&OáGÂÚF<-NMsµûŖ´ŗ
š0&-NMŽn «û;,Ã-˜M<ñòœƜĺ¯Ŗ´ŗ
@Factory(scope=CONVERSATION)
public List<Customer> getCustomerList() {
return ... ;
}
)
ŽƉ&-NMŽn
NM&ÂÚF<%´ŗ
Ɯ;,Ã-ȃ!&Ŕ&˜M<¯œ
void
@DataModel List<Customer> customerList;
@Factory("customerList")
public void initCustomerList() {
customerList = ... ;
}
Šnj»&ŷĆŔn
customerList
;,Ã-ȃȺȻ¯2!&Ɯs
[[
vûn
!&Ɯ&HMOMG%("Œ}sŒòś$v°ŷĆn
OáGÂÚF<sƭũòŖ´ŗ
ñ»LjūvâNŽ
•=;RSâN
%´ŗ
Œ&ŷĆn
;,Ã-ȃ˜M<´¬
;RSsµûn
Œ&;RSs;,Ã-ȃ&Ɯ•=ûn ȤûŽGHM%ƃýv°ŷĆ%´ŗ
©C©
ga
;,Ã-ĸ;RSŗ
•=;RSŽ
@Unwrap
ÂÚF<ÕÖ´ƚ2&;RS%´ŗ
Œ&ÂÚF<ŽnGHMƃývţv¬Ɯĺ¯n
ʆʗ
;,Ã-ȃsȺȻñòòũƭìƗñòŖ´ŗ
@Name("customerList")
@Scope(CONVERSATION)
public class CustomerListManager
{
...
@Unwrap
public List<Customer> getCustomerList() {
return ... ;
}
}
¤S‚ĭ;RSâNŽ;RS&HMOMG%«ûĂăŲ’}´¬ŷƧ
Ċ–‚PGsµ¬}ÞАí£%´ŗ
èýũn;,Ã-ĄąÎGFŲ’}´¬ƢɎ̋&Ċ–‚PGsµ¬}ÞnĊ
–‚PG
@Unwrap
¯n¤S‚ĭ;RS&
@Destroy
ÂÚF<%GF´¬Œ}stu%´ŗ
@Name("hens")
@Scope(APPLICATION)
public class HenHouse {
Set<Hen> hens;
@In(required=false) Hen hen;
@Unwrap
public List<Hen> getHens() {
if (hens == null) {
// Setup our hens
}
return hens;
}
@Observer({"chickBorn", "chickenBoughtAtMarket"})
public addHen() {
hens.add(hen);
}
@Observer("chickenSoldAtMarket")
public removeHen() {
hens.remove(hen);
}
@Observer("foxGetsIn")
public removeAllHens() {
hens.clear();
}
...
}
ŒŒ%Ž•=;RSsĜ̌v´Ċ–‚PG&ƾţ&M¹̆ɀ¯2°Ŗ´ŗ
;RSŽŒò»&G45!&Ŕ&•=¯nĊ–‚PGŽGE-Ȧ}HF
ñò¬œ1wɖĬ&µ¬lsƿǀñòŖ´ŗ
©C©
gg
S B%TU%
.`a
å| ¹-&޳šď´¬}°"ǭ̍Ž%Ž̎̏ñò2°Ŗ´ŗ
!òŔººľ»Ŵnå| š›2cd¯œ°}°"ñŖǾŖv=ȍs¸ǰ¯Ŗ´ŗ
C;<º»—KMÂǫí&ȟȠúûɣ¯œ°n
ƲĮ£tuvOD‡ðGp³tu¯œ°n ×ØÙØķucd¯œ°ɰ&=ȍ%´ŗ
Ž;RScd´¬̐Ö&Kƿǀ¯Ŗ´ŗ
Kâ,@OáMŖœŽweb.xml%&Kâ,@cd«¬cd}n
components.xml
«¬cd%´ŗ
S &Mà3G`a¨©B%TU%
.`a
;RSŽn–DF;,Ã-âHÂNnµ¬°ŽGH-â-&
}ÒÝŨ»òœKâ,@OáM&°Ŵòº«›2ncdKâ,@
¸ǰ´¬seam.propertiesƿǀ´¬Œ}stu%´ŗ
cdtuŽ;RSŽncdƙĬ“¯2C-NM&Kâ,@£EFNÂ
ÚF<ǿô¯vŨòũvûŖĿŻŗ
com.jboss.myapp.settings}°"Ò­&;RSsnsetLocale
()
OáMµ¬°Ž–DF;
com.jboss
.myapp.se
ttings.lo
}°
"Ò
­&
K
â,
@
ƿǀ
´¬
Œ}
st
u}
vû
n
Ž!
&;
R
S
²
³´
¬}
ސ
loc
©C©
gh
;RS&cd
ƙĬ&Ɯcd¯Ŗ´ŗ
͏ÂLŎƛ‡Ž¼ȧ&cdŔšľòŖ´ŗœ}ýũn“”&NM‡œcd´¬Ž
n
web.xmlŖœŽ
seam.propertiesë°2n
org.jboss.seam.core.manager.conversationTimeout&Ɯƿǀ¯Ŗ´ŗ
Æorg.jboss.seam.core.manager}°"Ò­&×ØÙØ;RSs¸ǰ¯n !òŽsetConversationTimeout () }°"EFNÂÚF<sµûŖ´ŗÇ
S1
components.xml¨©B%TU%
.`a
components.xmlOáMŽnŧz´«"Kâ,@cd«ûŔǙ¯ũºûLjū%´ŗ
ş
¼/ŠM-sŸą˱Ø}v›2°¬;RScd%ÞŖ´ŗ
ŒòŽ×ØÙØ;RS}n—KMÂ-Ãĭꐫ›2¥Ɨñòœ
@Nameï,45ÝÞ&345;RSn &ƝēsġŖòŖ´ŗ
ş
@Nameï,45&ȳ°GH-;RS}¯2M-tu%´ŗ
ŒòŽɂv¬Ò­%ԃʗM-ñò¬«"vµ¬ȑ&MOH-HGĭ;RS
}›2šŔí£%´ Ɯ}ýũn•=“ʎij;,Ã-Ç ŗ
ş
@
I
n
s
t
a
l
©C©
gk
;RS&cd
&œ1—O¶%M-¯v°;RSM-tu%´ŗ
ş
;RS&-;$ɆÞ ÆCÇ %ÞŖ´ŗ
components.xmlOáMŽŧ&+Ö&ɂv¬ŷǧǞţŒ}s%ÞŖ´ŗ
ş
war&WEB-INF—@DG
ş
jar&META-INF—@DG
ş
@Nameï,45ÝÞ&GH-ġĢ˟Ƭ&jar
Ļļn;RSŽ—KMÂ-Ãĭêsseam.properties
OáMĝMETAINF/components.xmlÕÖLM–q%
@Nameï,45&Ý°œGH-Ƕƃ¯œ}ސM-ñòŖ´
ƜŦ¯n@Install
ï,45s—O¶%M-¯v°}
Ɠd¯2°v°ȃûÇ
ŗ
components.xmlOáMšýũn
ï,45$ɆÞ´¬Ų’sµ¬«"vĞƐvŷƐ“д¬Œ}s%ÞŖ´ŗ
œ}ýũnŧ&components.xmlOáMŽ B~| M-¯Ŗ´ŗ
<components xmlns="http://jboss.com/products/seam/components"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bpm="http://jboss.com/products/seam/bpm">
<bpm:jbpm/>
</components>
ŒòŽśŜ}͏Œ}¯Ŗ´ŗ
<components>
<component class="org.jboss.seam.bpm.Jbpm"/>
</components>
ŒòŽ)ȑˏ&ɂv¬•=“ʎij;,Ã-}M-}cd(°Ŗ´ŗ
<components xmlns="http://jboss.com/products/seam/components"
xmlns:persistence="http://jboss.com/products/seam/persistence"
<persistence:managed-persistence-context name="customerDatabase"
persistence-unit-jndi-name="java:/customerEntityManagerFactory"/>
<persistence:managed-persistence-context name="accountingDatabase"
persistence-unit-jndi-name="java:/accountingEntityManagerFactory"/>
</components>
ŒòŽśŜ}͏%´ŗ
<components>
<component name="customerDatabase"
class="org.jboss.seam.persistence.ManagedPersistenceContext">
<property name="persistenceUnitJndiName">java:/customerEntityManagerFactory</property>
</component>
<component name="accountingDatabase"
class="org.jboss.seam.persistence.ManagedPersistenceContext">
<property name="persistenceUnitJndiName">java:/accountingEntityManagerFactory</property>
</component>
</components>
©C©
ho
;RS&cd
Œ&èŽEF45-;&•=“ʎij;,Ã-²³¯Ŗ´
Æ'ꐎʰʱñò¬Ŕ&%ŽµûŖĿŻÇ ŗ
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
<core:managed-persistence-context name="productDatabase"
scope="session"
persistence-unit-jndi-name="java:/productEntityManagerFactory"/>
</components>
<components>
<component name="productDatabase"
scope="session"
class="org.jboss.seam.core.ManagedPersistenceContext">
<property name="persistenceUnitJndiName">java:/productEntityManagerFactory</property>
</component>
</components>
ij;,Ã-&«"vĜō}v¬Ċ–‚PG“¯2auto-create
Ċ45š£´¬&ŽwʕŠvŒ}%´ŗ!"´¬Œ}%n@In
ï,45š"}ސǂzŠcreate=trueƓd´¬Œ}̑ʲ Œ}s%ÞŖ´ŗ
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
<core:managed-persistence-context name="productDatabase"
auto-create="true"
persistence-unit-jndi-name="java:/productEntityManagerFactory"/>
</components>
<components>
<component name="productDatabase"
auto-create="true"
class="org.jboss.seam.persistence.ManagedPersistenceContext">
<property name="persistenceUnitJndiName">java:/productEntityManagerFactory</property>
</component>
</components>
<factory>ƎƏŽnƜŔ¯ţŽÂÚF<§Ć¿Ɠd¯2n
!òsš0ȺȻñòœ}ސ;,Ã-ȃƜ0Ĉä´¬«"%ÞŖ´ŗ
<components>
<factory name="contact" method="#{contactManager.loadContact}" scope="CONVERSATION"/>
</components>
;RS&Đ?M-đ ÆƐÒÇ s²³tu%´ŗ
<components>
<factory name="user" value="#{actor}" scope="STATELESS"/>
</components>
©C©
h
;RS&cd
«ţš£ñò¬¿“¯2ŔĐ?M-đ²³´¬Œ}´»tu%´ŗ
<components>
<factory name="contact" value="#{contactManager.contact}" scope="STATELESS"/>
</components>
<factory>ƎƏ%auto-create="true"š"Œ}Ž
ĵļŠ«ţƉ´¬Œ}%´ŗ
<components>
<factory name="session" value="#{entityManager.delegate}" scope="STATELESS" auto-create="true"/>
</components>
—KM},-&Ɲēë°2components.xmlOáMźŻ&Ǚ¯˃Ţ
´¬ŦŨ%͏OáMƲĮ£¯œ°}°"Œ}sµûŖ´ŗ
Žcomponents.xmlOáMq@wildcard@¾¿
&ðM<L<TǞ´¬Œ}stu%n#l<-G ƗKMÎÇ ĝGH-â-
components.properties}°"OáMʫý¬Œ}
ÆôǶÎÇ
«›2
ƜǞÞʺý¬Œ}s%ÞŖ´ŗŒ&KŽK™H‡%ƃ¬Œ}s%ÞŖ´
ŗ
S2 á¾â¬š`aQßO#
Ŕ¯Ŕå| %cdsŲ’vǕɎ&;RSsµ¬v»ncomponents.xml
ġŖò¬ȟȠƾţ&ãºvOáMÁĉ´¬Œ}ŽƬȘsµ¬%¯Ƌ"ŗ
Žµ¬GHcom.helloworld.Hello&cd
com/helloworld/Hello.component.xml}°"Ò­&Ú-q
ǞţŒ}s%ÞŖ´ŗ
ÆŔ¯º¯œ»Œ&âNƃ̒ýsµ¬ºŔ¯òŖĿŻŗvȖv»n
ž`%ŔÍƟ&ĝûē¯2°¬º»%´ŗÇ
!&OáM&’ȀŽ<components>
ŖœŽ <component>’Ȁ&°Ŵòºstu%´ŗ
š0&Ċ45ŽOáMqÔƒ;RS&dÓstu%´ŗ
<components>
<component class="com.helloworld.Hello" name="hello">
<property name="name">#{user.name}</property>
</component>
<factory name="message" value="#{hello.message}"/>
</components>
̐ŽƉ&Ċ45Žſw;RS¯ºdÓŖœŽcd%ÞŖĿŻsn
̓ƴñŽµûŖĿŻŗ
<component name="hello">
<property name="name">#{user.name}</property>
</component>
̐ŽƉ&Ċ45%ŽnGH-Ҏ;RSdÓs9ŷ´¬OáMҐ«›2ˇƓd
ñòŖ´ŗ
µ¬°Žncom/helloworld/components.xml%
©C©
h)
;RS&cd
âF3‚q&´ƚ2&GH-&cd´¬Œ}Ŕtu%´ŗ
SS `aopq&Mà3G. Ġ„dznĴ,@–nĴ,@–HF⡎nµvœsŒə´¬Ļûcd%ÞŖ´ŗ
org.jboss.seam.core.manager.conversationTimeout 60000
<core:manager conversation-timeout="60000"/>
<component name="org.jboss.seam.core.manager">
<property name="conversationTimeout">60000</property>
</component>
Ġ„dzŖœŽĴ,@–º»Ş³ñò¬TdznEFn-ŔRñòŖ´ŗ
org.jboss.seam.bpm.jbpm.processDefinitions order.jpdl.xml, return.jpdl.xml, inventory.jpdl.xml
<bpm:jbpm>
<bpm:process-definitions>
<value>order.jpdl.xml</value>
<value>return.jpdl.xml</value>
<value>inventory.jpdl.xml</value>
</bpm:process-definitions>
</bpm:jbpm>
<component name="org.jboss.seam.bpm.jbpm">
<property name="processDefinitions">
<value>order.jpdl.xml</value>
<value>return.jpdl.xml</value>
<value>inventory.jpdl.xml</value>
</property>
</component>
Ġ„dzƜ&Ã}nĠ„dzŖœŽĴ,@–&Ɯº»³¬¤F%ñýŔRñòŖ´ŗ
<component name="issueEditor">
<property name="issueStatuses">
<key>open</key> <value>open issue</value>
<key>resolved</key> <value>issue resolved by developer</value>
<key>closed</key> <value>resolution accepted by user</value>
</property>
</component>
šŶnƜ§Ć¿
ÆC[f`J
ZYÇ
š›2;RSŌɺñĿ¬Œ}s%ÞŖ´ŗ
ŒòŽ@InÖº›œơŪ}ŽŖ›œţɂv¬&%ơƬ¯2ţŦñ°ŗ
vȖv»n!òŽƭìƗ¯Î%Žvţn;RS²³Î.Œ¬º»%´ŗ
¯œs›2nbĝYJ&«"v·¸&¢;,ꐫ›2ƿǀñò¬Ä¸ĬơŪ«û̔°%
´ŗ
<drools:managed-working-memory name="policyPricingWorkingMemory" rule-base="#{policyPricingRules}"/>
<component name="policyPricingWorkingMemory"
class="org.jboss.seam.drools.ManagedWorkingMemory">
<property name="ruleBase">#{policyPricingRules}</property>
</component>
©C©
h+
;RS&cd
S[ ãzŸÑªäå.˜¡
K™H‡Ļ¯2n)ȑˏ&̕ɂv¬;RSƎƏ&ēĔsµûŖ´ŗ
å| Ò­æ皣´¬ēĔ}š£¯v°ēĔ%´ŗŧŽnÒ­æ皣¯v°ʟ¡Šv components.xmlOáMz¯Ŗ´ŗ
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xsi:schemaLocation="http://jboss.com/products/seam/components http://jboss.com/products/se
<component class="org.jboss.seam.core.init">
<property name="debug">true</property>
<property name="jndiPattern">@jndiPattern@</property>
</component>
</components>
Ȧx&ĻûnŒòŽ̖Á̓ƴ%´ŗ
ñ»̗°Œ}Žn;RS}ƙĬ&Ò­Žn—KMÎ&ƌ…Ĭ¥ƍ&“ʎ}vûŖĿ
Żŗ
Ò­æ皛œ˜‚5ŽŒ&«"vûŖ´ŗ
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2
<core:init debug="true" jndi-pattern="@jndiPattern@"/>
</components>
-äƎƏŽɏɐ%ŽµûŖ´sn'ę&å| &qrŽž̘ºÖ=>¯ĝ´°Ŕ&%´ŗ
Œ&-äŽĮ£tuvŚ;RS}ƙĬŋ´¬ȨãȟȠƿǀ´¬Ŕ&%n
å| ?—@N%M,‚Pv¼/ǴŸŪūtu¯Ŗ´ŗ
OáM&²³}ƀ̙«ûžſ¯2ţòŖ
Ò­æçÝÞ&’Ȁ&š£ŽnŢ¯°components.xml´ŗ
ñ2nŒòŽ×ØÙØ;RS“¯2ŽƷţķu´¬«"%´snŽœ¯278;
RS“¯2ŽŠ"%¯Ƌ"ºʙ
š0nŽ)Ö&̚ǰ¯œÅ—R¯Ŗ´ŗ
֎78;RS“´¬wʕŠv<component>
ƎƏŗ
Ŕ"֎×ØÙØ;RS“´¬Ò­æçÝÞ&ƎƏ%´ŗ
Ž78;RS“¯2ŔžſÒ­æçƎƏ%Þ¬«"¯2ţò2°Ŗ´ŗ
ï,45âF3‚ÝǤ´¬Œ}«›2nå| ˟Ƭ&CâF3‚Žn@NamespaceÒ­æçŋŌÝŨ¬Œ}s%ÞŖ´ŗ
}°"Ò­
&OáM
%ƎƏñò
ÆâF3‚D¹&ï,45ŽnâF3‚—@DGq&package-info.javaŖ´ŗÇ
ŒòŽYà—ź»&è%´ŗ
©C©
hQ
;RS&cd
@Namespace(value="http://jboss.com/products/seam/examples/seampay")
package org.jboss.seam.example.seampay;
import org.jboss.seam.annotations.Namespace;
ĝ»vŨòũv»v°Œ}Žncomponents.xml%Ò­æç-NMš"Œ}ŦŨ%´̛
Œ"¯2ŧ&«"ɆţŒ}stuvûŖ´ŗ
<components xmlns="http://jboss.com/products/seam/components"
xmlns:pay="http://jboss.com/products/seam/examples/seampay"
... >
<pay:payment-home new-instance="#{newPayment}"
created-message="Created a new payment to #{newPayment.payee}" />
<pay:payment name="newPayment"
payee="Somebody"
account="#{selectedAccount}"
payment-date="#{currentDatetime}"
created-date="#{currentDatetime}" />
...
</components>
ŖœŽn
<components xmlns="http://jboss.com/products/seam/components"
xmlns:pay="http://jboss.com/products/seam/examples/seampay"
... >
<pay:payment-home>
<pay:new-instance>"#{newPayment}"</pay:new-instance>
<pay:created-message>Created a new payment to #{newPayment.payee}</pay:created-message>
</pay:payment-home>
<pay:payment name="newPayment">
<pay:payee>Somebody"</pay:payee>
<pay:account>#{selectedAccount}</pay:account>
<pay:payment-date>#{currentDatetime}</pay:payment-date>
<pay:created-date>#{currentDatetime}</pay:created-date>
</pay:payment>
...
</components>
Œò»&ŽÒ­æçÝޒȀ&)Ö&Į£Å—ɾǂ¯Ŗ´ŗ
š0&ƎƏ%Ž<pay:payment-home>Ž paymentHome;RSȺȻ¯2°Ŗ´ŗ
package org.jboss.seam.example.seampay;
...
@Name("paymentHome")
public class PaymentController
extends EntityHome<Payment>
{
...
}
!&’ȀҎ;RSÒ̜MO%Ō§¯œ¾¿v›2°Ŗ´ŗ
!&’Ȁ&ƙĬҎKâ,@Ò̜MO%Ō§¯œ¾¿v›2°Ŗ´ŗ
G
H
©C©
h\
;RS&cd
ȺȻ¯Ŗ´ŗ
Payment
&3-%Žnµ¬?,@,@s;RS}¯2ƎƏñò«"}¯2°Ŗ´ŗ
package org.jboss.seam.example.seampay;
...
@Entity
public class Payment
implements Serializable
{
...
}
78dÓ;RS“¯2ƌ…Ĭ¥ƍ}¼/ǴŸŪūsķu´¬«"¯œ°v»n
-äsŲ’vûŖ´ŗŽ;RS&ȡŖûº»-ä¼/²³´¬«"vķ
u
ŽŖŦƿǀ¯2°ŖĿŻ&%nɻ/%²³´¬Ų’sµûŖ´ŗƑƒŠvâF3‚&-Ã
¤dӎ˲M<}¯2Į£%ÞŖ´ŗ
ŧŽ«›2š£˱Ø&Ò­æç%´ŗ
ş
Y ő http://jboss.com/products/seam/components
ş
ő http://jboss.com/products/seam/core
ş
[ ő http://jboss.com/products/seam/drools
ş
e_ö ő http://jboss.com/products/seam/framework
ş
B ő http://jboss.com/products/seam/jms
ş
J ő http://jboss.com/products/seam/remoting
ş
m ő http://jboss.com/products/seam/theme
ş
à ő http://jboss.com/products/seam/security
ş
[ ő http://jboss.com/products/seam/mail
ş
_` ő http://jboss.com/products/seam/web
ş
Ye ő http://jboss.com/products/seam/pdf
ş
YJ ő http://jboss.com/products/seam/spring
©C©
ha
[ O¶%
hO%PI&PhæçÏD
;,Ã-ĸ;RSŗǴŸ´¬Ŕ&}¯2n
345&ĞȬ}v›2°¬ˌƂ&̝§ĆʳŕñĿ¬ ) Ö&Ĝˆ‘ʝs¸ǰ¯Ŗ´ŗ
š0&Ŕ&Žn M¹s b HMGvÂÚF<§Ć¿ Æm `J ZYÇ
˴¯2M¹-ꐤF%Þ¬«"vLjūvM¹Å—%´ŗ ) ŽƉ&Ŕ&Žn
l‚S-K‚FG'Ɗ´¬;RS“¯2̞įŠŋȌɁ
Æ
f
J
Ç
ǃ£´¬œ1ï,45ĝMNEN˘̟̠š£¯2°¬}°"Œ}%´ŗ
[ O¶%
;RSŗŽM¹Ñ/345
%š"œ1ôǶñòŖ¯œŗ
Аn
ĎłŃs(ľòœM¹Å—%ĎłŃŲ’}´¬̝§Ć;RS&ôǶtu¯Ŗ
´ŗ %&M¹Žn ´%Ȧ¸ǘ&«"°ţÖº&NMsµûŖ´ŗ
ş
b M¹
ş
B~| ƪƫĀāM¹
ş
‚G45
ş
;RSÑ/M¹
ş
;,Ã-ĸM¹
Œò»&ƾƟvM¹Ž´ƚ2
;RS¤FñòŖ´ŗ
,D%dÓñòŖ´ŗ
b
b
^ ÂÚF<§Ć¿˴¯2
M¹&ŷĆn
ŧ&
b
<h:commandButton value="Click me!" action="#{helloWorld.sayHello}"/>
B~| ĀāM¹&ŷƎn B~| KE-dÓŖœŽ‚OKdÓ%±dñòŖ´ŗ
<start-page name="hello" view-id="/hello.jsp">
<transition to="hello">
<action expression="#{helloWorld.sayHello}"/>
</transition>
</start-page>
b M¹ĝ B~| M¹&ȨãÖ°2Žˆ˲M<śé%ŔƃÖŨ¬Œ}s%Þ¬&%n
ŒŒ%Ž «›2dÓñò¬Ɛ& ) ȑˏ&M¹Ö°2ƃ2°ÞŖ´ŗ
[ ~"K;<%
‚G45Ž‚&Dĕ™ƣ­Ƕ²´¬M¹%´ŗ
‚G45Ž
WEB-INF/pages.xml
%ƎƏ¯Ŗ´ŗ
Ğd&
b
l
“¯2‚G45dÓ´¬Œ}s%ÞŖ´ŗ
<pages>
©C©
hg
M¹nMNENnèéÐ=
<page view-id="/hello.jsp" action="#{helloWorld.sayHello}"/>
</pages>
µ¬°Žn
*
ðM<L<š›2âNwʄ´¬´ƚ2&l
Ɠd´¬Œ}Ŕ%ÞŖ´ŗ
€
<pages>
<page view-id="/hello/*" action="#{helloWorld.sayHello}"/>
</pages>
e [Y[ _[
YJ m m C_fņ _[[ [[ [[ m f
ņ e [fY
e
fY
e
*m YJ m b e m f[[ņ _[[
m e CJ [ CJ C_
bmņ m C_ m <page> [ Y [
~ b
[ YJŅ ņ _ Y
m e
[à e [ f
e_ö [ö ]`]ö J YJ b ZY[6
TODO: translate struts action into page action
fe
G?-
Ɯ}ýũn
ž**~
ó
“´¬D-R-%ÔƴvÐ=¯œ°ŷĆvŠīļưĮ%´ŗ
G?-Ç
|[Y[ [ YJ à ` Y
e J m <action> J6
<pages>
<page view-id="/hello.jsp">
<action execute="#{helloWorld.sayHello}" if="#{not validation.failed}"/>
<action execute="#{hitCount.increment}"/>
</page>
</pages>
~àL¿P
b e
G?- ÆO¶‡ɍħÇ ŽĐG45đ ÆÂÚF<§ĆÇ }ĐâHÂNđ
ÆŪūƜ§ĆÇ
&ƝēLEä¯Ŗ´ŗ
‚G45ŔâHÂNsŲ’ºŔ¯òŖĿŻŗ
ó^*
G?-Ž–FG¤Gtuv&%n
‚âHÂNŽʥçsı1¬G?-âHÂN}¯2ȽÞțñòŖ´
Æb
O¶‡Ūū}Žɂv¬Ŕ&Çŗ
Ő YJ Y _m _m m
z è [ YC C[ `J m Y Ė Y `
e [ `B
<pages>
<page view-id="/hello.jsp" action="#{helloWorld.sayHello}">
<param name="firstName" value="#{person.firstName}"/>
<param name="lastName" value="#{person.lastName}"/>
©C©
hh
M¹nMNENnèéÐ=
</page>
</pages>
*m <param> [ `
[ņ B [ö C[ `J e b Y6
ş
]m fe
Æó^*Ç Ė e m C_ ņ m C[ e m
Ė Y m [ `B
ņ e YeJ YYY àY f
C
ş
#à <s:link> <s:button> Y[à [ m Ė Y *m C[ e
m Y `à C[J m C[ `J J m Ym
Æ_m m <s:link> Ç
ş
#à CJ [ _m <redirect/> m C_ Y[à [ m f
Ė Y *m C[ e m Y `à C[J m C[
`J m e m Cö YY[
Ym
ş
*m C[ Y[à YYJ _m à b e ` e m YJ _m
m JC C_ *m m C_ Y `mC [ö PAGEf
Y Z
C`[ e e
Ė
*m [ `m [[ m m m_C _ J e à m YJ /
hello.jsp Æ e /hello.jsp `
ö /hello.jspÇņ m C[ e m [ ` f
e m C[ `J Ÿ`Ÿņ _m m e C Æ
m Cf Ç
y è e B m name ` Y
e m m Ė Y YYJ J
m PAGE Z Æ ė YY [ YYàÇ
<pages>
<page view-id="/hello.jsp" action="#{helloWorld.sayHello}">
<param name="firstName" />
<param name="lastName" />
</page>
</pages>
~YJ e YJ Y Y
[[à e[ e à _ `[ [f[à f
f[ ¢IA€ YJ Ő Ÿ`Ÿ _m
m C_ à _ YC[à ÆJ _m YJ m C `Çņ _m
m à à _ J
ş
#à <s:link> <s:button> Y[à YYJ m Ė Y e m Yf
[ YJ Y e m C_
ş
*m C[ Y[à YYJ _m à b e ` e m YJ _m
m JC C_ Æ*m m C_ Y `mC [ö PAGEf
Y Z
C`[ e e
Ė
*m [[ Yà Y[Zņ àė Y``[à _J e m Z
[[à _m m ee #
[[àņ m Cà [ à ŸJ Ÿ e[à _m öJ m m ee ~J Y m ©C©
hk
M¹nMNENnèéÐ=
[J _à YYJ fe
Ė *mà Y
[[à [ e
Y`[ [ö m _m `öö`[ [ YJņ _m _ _[ [ö `
`[ _ YY[
m[ `m ~* ó^* Ė _m m ~J Y [ YC [J e Ė Y m C_
e ö m Æ ›
Ő Y
eà b C e Y[Z [ YY6
<pages>
<page view-id="/calculator.jsp" action="#{calculator.calculate}">
<param name="x" value="#{calculator.lhs}"/>
<param name="y" value="#{calculator.rhs}"/>
<param name="op" converterId="com.my.calculator.OperatorConverter" value="#{calculator.op}"/>
</page>
</pages>
#[C[à6
<pages>
<page view-id="/calculator.jsp" action="#{calculator.calculate}">
<param name="x" value="#{calculator.lhs}"/>
<param name="y" value="#{calculator.rhs}"/>
<param name="op" converter="#{operatorConverter}" value="#{calculator.op}"/>
</page>
</pages>
b C[ņ required="true" à [ ` 6
<pages>
<page view-id="/blog.xhtml">
<param name="date"
value="#{blog.date}"
validatorId="com.my.blog.PastDate"
required="true"/>
</page>
</pages>
#[C[à6
<pages>
<page view-id="/blog.xhtml">
<param name="date"
value="#{blog.date}"
validator="#{pastDateValidator}"
required="true"/>
</page>
</pages>
^C `ņ [f` ž` C[ [[à Jč C[
]m àY C C[ e[ņ J[`[ FacesMessage m FacesContext
égƒ;<%
345%Ž
©C©
faces-config.xml
%dÓñò¬Ƒƒ&
b
ko
M¹nMNENnèéÐ=
êl†45±Ƴš£%ÞŖ´ŗ
êl†45±ƳŽ̡˴vĂȃsµûŖ´ŗ
¯º¯n
ş
ĕMDG´¬ŷƎG?-âHÂNƓd%ÞŖĿŻŗ
ş
±Ƴº»“”&ôªĝĄąŽ%ÞŖĿŻŗ
ş
±ƳŽG45ÂÚF<&þûƜ&Ȣȣ«›2/p¯Ŗ´ŗ
¿Ȣȣ´¬Œ}Ž%ÞŖĿŻŗ
b
ÖŖûn
˟Ƭ&
^ ñ»ƺƻv&Ž×ĆĿ Æ
mÇ &K‚FGs pages.xml } faces-config.xml
&çÁ̢¯2¯Ŗ"Œ}%´ŗ Œ&K‚FGŽ pages.xml ˬńĆ¯œēs«°%¯Ƌ"ŗ
Œ& b êl†45±ƳŽn
<navigation-rule>
<from-view-id>/editDocument.xhtml</from-view-id>
<navigation-case>
<from-action>#{documentEditor.update}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/viewDocument.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
ŧ&«"ɆÞƣ´Œ}s%ÞŖ´ŗ
<page view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule if-outcome="success">
<redirect view-id="/viewDocument.xhtml"/>
</rule>
</navigation>
</page>
_[ ` C e _ ė mC Y[[ DocumentEditor Y _m
JfC[ C[ Æm b Ç [ _6
<page view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}"
evaluate="#{documentEditor.errors.size}">
<rule if-outcome="0">
<redirect view-id="/viewDocument.xhtml"/>
</rule>
</navigation>
</page>
ŖœŽnŧ&«"´»ɆţŒ}s%ÞŖ´ŗ
<page view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule if="#{documentEditor.errors.empty}">
<redirect view-id="/viewDocument.xhtml"/>
</rule>
</navigation>
©C©
k
M¹nMNENnèéÐ=
</page>
š0&¾¿ŽŶj&±Ƴ«›2š£ñò¬«" &ƜƔd´¬Ɯ§ĆȢȣ¯Ŗ´ŗ
̐ŽƉ&KŽ
ȳɀ¯n
!òɇòtuĬ&µ¬±Ƴ“¯2Ɯ§ĆȢȣ¯Ŗ´ŗ
ĸ®s³ø¯œ»…Ǐn
ŒòŽnŧ&«"¯Ŗ´ŗ
ǹǰ&“”ĄąñĿœ°ŷĆsź}ŻŠ%¯Ƌ"ŗ
<page view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule if="#{documentEditor.errors.empty}">
<end-conversation/>
<redirect view-id="/viewDocument.xhtml"/>
</rule>
</navigation>
</page>
# _ėC C à `Ė Ė _ė ö_ _m
m _ f
] Y m Ė Y _m
m [ ö m C_
`öö`[6
<page view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule if="#{documentEditor.errors.empty}">
<end-conversation/>
<redirect view-id="/viewDocument.xhtml">
<param name="documentId" value="#{documentEditor.documentId}"/>
</redirect>
</rule>
</navigation>
</page>
ù[[ Y
[ b *m [[ Y Ÿf
Y[à m YJŸ *m e[[_J CJ [ m à f[[ ņ ` m
[[ 6
<page view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<rule>
<render view-id="/viewDocument.xhtml"/>
</rule>
</navigation>
</page>
e à _ Ye CJ _m [[ ņ m e[[_J e f
6
<page view-id="/editDocument.xhtml">
<navigation from-action="#{documentEditor.update}">
<render view-id="/viewDocument.xhtml"/>
</navigation>
©C©
k)
M¹nMNENnèéÐ=
</page>
*m C_f à ` JC b ^ ZY6
<page view-id="/editDocument.xhtml">
<navigation>
<rule if-outcome="success">
<redirect view-id="/#{userAgent}/displayDocument.xhtml"/>
</rule>
</navigation>
</page>
égƒ;<%h~"K;<%hàL¿P.aÒ¡á¾â¬šQßO#
‚G45ĝ‚âHÂNsǕɎµ¬n
ŖœŽſêl†45±ƳƾɎÕ›2°¬ŷĆn
ƎƏԃ&OáMÁĉ¯œ°Œ}%¯Ƌ"ŗ
l
/calc/calculator.jsp
Õց‚&G45ĝâHÂNŽ
calc/calculator.page.xml
}°"Ò­&Ú-dÓ´¬Œ}s%ÞŖ´ŗ Œ&ŷĆ&’ȀŽ <page> ’Ȁ%n
l ŽˇƓdñòŖ´ŗ
<page action="#{calculator.calculate}">
<param name="x" value="#{calculator.lhs}"/>
<param name="y" value="#{calculator.rhs}"/>
<param name="op" converter="#{operatorConverter}" value="#{calculator.op}"/>
</page>
[1 |Æ Æ
;RSÍĽŽʹ°&ÂÚF<ƭʻŦŨ%ĝû}ûs%ÞŖ´ŗ
-,O;RSŽ
`C½`C`[
âN'Ɗ´¬Œ}´»%ÞŖ´ŗ
¯º¯n
;RSsʹ°ÂÚF<ƣƤƭʻ}Þ«û̝§ĆvēĔ%ĝû}û%Þ¬«"´¬œ
1Žn Ž;RSÑ/M¹ƿǀ¯Ŗ´ŗ
M¹-ê Æ`CÇ components.xml %Ɠd¯Ŗ´ŗ
<components>
<event type="hello">
<action execute="#{helloListener.sayHelloBack}"/>
<action execute="#{logger.logHello}"/>
</event>
</components>
ŒŒ% C àY Žſv¬˟Ƭ&Ġ„dz%´ŗ
M¹sǶ²´¬}n
!&M¹£9:ñòœG45Ž
Ɨǹ¯œËŽ%ƭìƗñòŖ´ŗ
;RSŽŠ&«"M¹Ƕ(´¬&%¯Ƌ"ºʙ
ŽŒ&œ1×ØÙØ;RSƿǀ¯Ŗ´ŗ
components.xml
@Name("helloWorld")
public class HelloWorld {
public void sayHello() {
©C©
k+
M¹nMNENnèéÐ=
FacesMessages.instance().add("Hello World!");
Events.instance().raiseEvent("hello");
}
}
µ¬°Žn ï,45š"Œ}Ŕtu%´ŗ
@Name("helloWorld")
public class HelloWorld {
@RaiseEvent("hello")
public void sayHello() {
FacesMessages.instance().add("Hello World!");
}
}
Œ&M¹ǀ̣ˬŽM¹Ȋ̤ˬvŻ»Ä¸¯2°v°Œ}ơƬ¯2ţŦñ°ŗ
Œò%Ŗ›œţǀ̣ˬ}ĸŋʂsv°«"M¹-ê'Ɗ´¬Œ}stuvûŖ´
ŗ
@Name("helloListener")
public class HelloListener {
public void sayHelloBack() {
FacesMessages.instance().add("Hello to you too!");
}
}
$W&
components.xml
dÓñò¬ÂÚF<˜M—@™ŽȊ̤ĨˬM¹&¤Fș(°Ŗ´ŗ
components.xml
OáMq°ţûʗ¯œţv°ŷĆn
Ĥľûï,45š"Œ}s%ÞŖ´ŗ
@Name("helloListener")
public class HelloListener {
@Observer("hello")
public void sayHelloBack() {
FacesMessages.instance().add("Hello to you too!");
}
}
ŒŒ%M¹Ċ–‚PGŋ¯2Ŗ›œţƏ̥¯2°v°Œ}̦ƺ̧ţēŔ°»›¯Ɔ¬
Œ}%¯Ƌ"ŗ
%Žn
M¹ǀ̣ˬ}-êç%ƪƫʋʌ´¬M¹Ċ–‚PGŽŲ’ŽµûŖĿŻŗ ƪƫŽ
;,Ã-$ƀÕñòn
;RSç%ƹíñòŖ´ŗ
¯º¯vs»n
Š"¯2ŔM¹Ċ–‚PGț¯œ°ŷƎn ŧ&«"("Œ}s%ÞŖ´ŗ
@Name("helloWorld")
public class HelloWorld {
private String name;
public void sayHello() {
FacesMessages.instance().add("Hello World, my name is #0.", name);
Events.instance().raiseEvent("hello", name);
}
}
@Name("helloListener")
public class HelloListener {
@Observer("hello")
public void sayHelloBack(String name) {
FacesMessages.instance().add("Hello #0!", name);
}
}
©C©
kQ
M¹nMNENnèéÐ=
[2 B%3À4
ÁµO¶%
ŽĞğvȑˏ&OD‡ðGńĆ'ǹ´¬œ1345sĮ£%Þ¬×ØÙØM¹
dÓ¯Ŗ´ŗ !&M¹}Žŧ&«"vŔ&%´ŗ
ş
org.jboss.seam.validationFailed
ő [[ _m b C[ e[
ş
org.jboss.seam.noConversation
ş
org.jboss.seam.preSetVariable.<name>
ş
org.jboss.seam.postSetVariable.<name>
ş
org.jboss.seam.preRemoveVariable.<name>
ő [[ _m m [J J C [J J C Ė
ő [[ _m m Z C`[ õ÷ ő [[ _m m Z C`[ õ÷ ő [[ _m m Z C`[ õ÷ f
ş
org.jboss.seam.postRemoveVariable.<name>
ő [[ _m m Z C`[ õ÷ ş
org.jboss.seam.preDestroyContext.<SCOPE>
ő [[ `e m õ¢~^÷ Z f
à
ş
org.jboss.seam.postDestroyContext.<SCOPE>
ő [[ e m õ¢~^÷ Z f
à
ş
org.jboss.seam.beginConversation
ő [[ _mC [JfJ C `J
ş
org.jboss.seam.endConversation
ş
org.jboss.seam.conversationTimeoutő
ş
org.jboss.seam.beginPageflow.<name>
ş
org.jboss.seam.endPageflow.<name>
ş
org.jboss.seam.createProcess.<name>
ş
org.jboss.seam.endProcess.<name>
ş
org.jboss.seam.initProcess.<name>
ő [[ _mC [JfJ C [[ _m C *m f
C Y Y
ő [[ _m m YJe[_ õ÷ `J
ő [[ _m m YJe[_ õ÷ ő [[ _m m Y
õ÷ ő [[ _m m Y
õ÷ ő [[ _m m Y
õ÷ _m
m C
ş
org.jboss.seam.initTask.<name>
ő [[ _m m ö õ÷ _m m
C
ş
org.jboss.seam.startTask.<name>
ş
org.jboss.seam.endTask.<name>
ş
org.jboss.seam.postCreate.<name>
©C©
ő [[ _m m ö õ÷ ő [[ _m m ö õ÷ ő [[ _m m Y õ÷ k\
M¹nMNENnèéÐ=
ş
org.jboss.seam.preDestroy.<name>
ő [[ _m m Y õ÷ à
ş
org.jboss.seam.beforePhase
ş
org.jboss.seam.afterPhase
ş
org.jboss.seam.postInitialization
ő [[ `e m e b Ym
ő [[ e m e b Ym
ő [[ _m m [č Y [[
Y
ş
org.jboss.seam.postAuthenticate.<name>
ş
org.jboss.seam.preAuthenticate.<name>
ş
org.jboss.seam.notLoggedIn
ő [[ e m
ő [[ `e YJ m
ő [[ m m
m
Ė
ş
org.jboss.seam.rememberMe
ő _m à m ö
ş
org.jboss.seam.exceptionHandled.<type>
ő [[ _m Jm Z
Y m[ `à
ş
org.jboss.seam.exceptionHandled
ő [[ _m Jm Z
Y m[ `à ş
org.jboss.seam.exceptionNotHandled
ő [[ _m m _ m[ e Jm
Z
Y
ş
org.jboss.seam.afterTransactionSuccess
ő [[ _m m #YY[
b_ö
ş
ő [[ _m m #YY[
b_ö _m
m J à [[ <name>
org.jboss.seam.afterTransactionSuccess.<name>
Y à `C à e m C B m _à mà `C à
m YfC C
[1 O%PI&P
^
+o
ŽEF45
;RS“¯2ƑƒŠvMNENŗɒŪ¯Ŗ¯œŗ
MNENǣǤ´¬Žn
}°"ï,45sÝǤñòœÂÚF<&Ý°œGH-VW¯2n
“¯2MNEN&GH-ÒƓd´¬
&ï,45ÝŨ¬Ų’sµûŖ´ŗ
@AroundInvoke
!&
@Interceptors
public class LoggedInInterceptor {
@AroundInvoke
public Object checkLoggedIn(InvocationContext invocation) throws Exception {
boolean isLoggedIn = Contexts.getSessionContext().get("loggedIn")!=null;
if (isLoggedIn) {
//the user is already logged in
return invocation.proceed();
}
else {
©C©
ka
M¹nMNENnèéÐ=
//the user is not logged in, fwd to login page
return "login";
}
}
}
* YY[à m Y ` _m
m [ņ _ f
m ` @Interceptors(LoggedInInterceptor.class) *m _m J[à
`[ Y m Y e_ö ^+ `à [[_J à @Interceptors f e [ [C[ Y Æm @Target(TYPE)Ç ZY[ņ _ _[ @LoggedIn ņ e[[_6
@Target(TYPE)
@Retention(RUNTIME)
@Interceptors(LoggedInInterceptor.class)
public @interface LoggedIn {}
Œ"¯2n
Œ&MNENǃ£´¬&G45-ê
ï,45ŦŨÝǤ´òũ«ţvûŖ¯œŗ
@LoggedIn
@Stateless
@Name("changePasswordAction")
@LoggedIn
@Interceptors(SeamInterceptor.class)
public class ChangePasswordAction implements ChangePassword {
...
public String changePassword() { ... }
}
e Y J Y Æ [[à Çņ à @Interceptor à Y [ Y
eà Y[ e Y
@Interceptor(around={BijectionInterceptor.class,
ValidationInterceptor.class,
ConversationInterceptor.class},
within=RemoveInterceptor.class)
public class LoggedInInterceptor
{
...
}
ĐGHMˬđMNENÕÖŒ}Ŕ%ÞŖ´ŗ
&°Ŵò&×ØÙØķu}%ŔŊ£´¬Œ}s%ÞŖ´ŗ
^+
@Interceptor(type=CLIENT)
public class LoggedInInterceptor
{
...
}
^
MNENŽ-,O%n
MNE´¬“ʎ}v¬;RS}͏HMOMGű°Ŗ´ŗ
ƪƫɗÕ´¬Ų’sv°MNEN&ŷĆn %Ž @Interceptor(stateless=true)
Ɠd´¬Œ}%âO¶¤-šǃäs%Þ¬«"vûŖ´ŗ
©C©
kg
M¹nMNENnèéÐ=
&ķu&Ų̈̄Ž×ØÙØ
MNEN&ȡĆ}¯2'Ɗñò2°2n
­&è&«"vMNENŔġŖòŖ´ŗ
;RSï,45ÝǤ¯2Œò»&MNENǂzŠƓd´¬Ų’Žµ
ûŖĿŻŗ MNEtuvŹ ;RS£š0º»×ØÙŖò2°Ŗ´ŗ
MNENŽ
^+
;RSŔš"Œ}s%ÞŖ´ŗ
ŦŨ%vţ
C
^ Žn MNE45 Æ@AroundInvoke š›œÇ l‚S-ÂÚF<ŦŨ%vţn
HMOMGÂÚF< @PostConstructn @PreDestroyn @PrePassivate !¯2 @PostActive
“¯2ŔdÓ¯Ŗ´ŗ
Žn
;RS}MNEN“´¬Œò»´ƚ2&HMOMGÂÚF< ^+ ŦŨ%vţ
C
;RS“¯2ŔR¯Ŗ´
ÆC
;RS}›2ƬȘ&v° @PreDestroy ŽƸÞŖ´Çŗ
[2 æç'“D±©
b ŽèéÐ=ŋ¯2ŽˀţźŠĂȃsµûŖ´ŗ Œ&ƺƻ&ĥÁŠvʗʘ̩}¯2n ŽèéGH-ï,45ÝŨ¬º
å| OáMèéGH-ƎƏ´¬Œ}%èé}v¬ĞdGH-Ð=´¬ēĔdÓ´¬Œ}s%
ÞŖ´ŗ
Œ&ķuŽn
ƓdñòœèésH8G45K˜FG&˔˕v¬ƚÞºǻºƓd´¬& ^ +o
Ƒƒ& @ApplicationException ï,45}w̪šľò¬Œ}sƬ̫ñò2°2°Ŗ´ŗ
[2 æçê¨ë
L%?K;<%
&l‚S-ÂÚF<«›2èés-Kñò¬}n
!&èéŽǹǰ&H8G45ƣnjK˜FGsŲ’}¯2̬ÝŨ¬ºŠ"ºĂă
%Þ¬«"ǂŤv±Ƴ
^
ŽdÓ¯2°Ŗ´ŗ
4-,‡èé
ŽļH8G45K˜FG}vûn
345èé
Ž—O¶%ŽK˜FG}ŽvûŖĿŻs
@ApplicationException(rollback=true)
sƓdñò¬}K˜FG}vûŖ´ŗ Æ345èé}Žn PFG&Ý°œèén
ŖœŽ
@ApplicationException
ï,45sÝ°œPFG&v°èé%´ŗ
4-,‡èé}Žn
@ApplicationException
ï,45sÝ°2°ŴPFGŔÝ°2°v°èé%´ŗÇ
K˜FG£H8G45̬ÝŨ¬&}n
'ęK˜FG("&}ŽɂvûŖ´ŗ
èé±ƳŽH8G45K˜FGsŲ’%µ¬}̬sÝŨ»ò¬Œ}ŦŨ¯ºƏ̥¯
2°ŖĿŻsn
èés-KñòœŶ%Ŕ!òŽG,@–&ŖŖ%µ¬tuĬsµ¬}°"Œ}ơƬ¯2ţŦ
ñ°ŗ
Ž
^
+o
;RS“¯2Ŕǃ£¯Ŗ´ŗ
èé&K˜FG±Ƴ
¯º¯n
Œò»&±ƳŽ
èésÃĭFñò¬Œ}vţ
;RSDž%&Øǃ£ñò¬Ŗ´ŗ
%Žn
;RSDž&éĥʋʌ¯n
ñ»
b
©C©
C
kh
M¹nMNENnèéÐ=
Dž&éʋʌ¯œ»Š"v¬%¯Ƌ"ºŗ
̭ʻ»ûŻ&H8G45Ċ¯œŖŖ%ʇǞ´¬&ŽçDZ°v&%n
;RSDž%ÃĭFñòv°}
ŽG,@–H8G45ŲŴK˜FG¯Ŗ´ŗ
èésǶ²¯
[21 æçÏD'ì퍱©
&èéÐ=í¬Žn
web.xml
¤-N}v¬–DFO@NsƎƏñò2°¬Œ}Ťť´¬Ų’sµûŖ´ŗ
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>*.seam</url-pattern>
</filter-mapping>
Ȧš£&èé̜<HķuñĿ¬ŷƎn web.xml & b
[
ents.xml & —˜F™Å<Ŕȳ¬Ų’sµûŖ´ŗ
ôǶÅ<ë«ì
compon-
[22 æçÏD¬9"î3;<%'˜¡±©
ŧ&èéŽ ;RSDž&éĥʋʌ´¬}ŲŴ ž**~ QoQ ?HvûŖ´ŗ
-Kñò2Ŕ´ʲŽǹǰ&H8G45K˜FG¯ŖĿŻsn
Ɛ&
;RS«›2èésÃĭFñòv°}Œ&H8G45ŽK˜FGñòŖ´
ŗ
@HttpError(errorCode=404)
public class ApplicationException extends Exception { ... }
Œ&èéŽ ;RSDž&éĥʋʌ´¬}ŲŴ–Hœ8ĕMDGvûŖ´ŗ
Ŗœn
ǹǰ&“”ŔĄąñĿŖ´ŗ
Œò«ûǹǰ&H8G45ʽÎK˜FGñĿ¬Œ}vûŖ´ŗ
@Redirect(viewId="/failure.xhtml", end=true)
@ApplicationException(rollback=true)
public class UnrecoverableApplicationException extends RuntimeException { ... }
Ž
b
HMOMG&Dĕ™OPƛŀǶ²¯œè鐓¯2Ž/p¯v°&%ơƬ¯2ţŦ
ñ°ŗ
@Redirect
Ő [ ^ Y
eà m viewId Œ&èéŽ
;RSDž&éĥʋʌ´¬}ŲŴ78ǵ&ÂFE‚ÝŨ2ĕMDGñòŖ´ŗ
Ŗœn ǹǰ&H8G45ŔʽÎK˜FGñĿŖ´ŗ
@Redirect(viewId="/error.xhtml", message="Unexpected error")
public class SystemException extends RuntimeException { ... }
©C©
kk
M¹nMNENnèéÐ=
[2S æçÏD ãzŸ '˜¡±©
ȗȘ՛2°¬èéGH-´ƚ2“¯2ï,45ÝǤ´¬Œ}Ž%Þv°&%n Ž pages.xml %Œ&ķuƓd%Þ¬«"¯2°Ŗ´ŗ
<pages>
<exception class="javax.persistence.EntityNotFoundException">
<http-error error-code="404"/>
</exception>
<exception class="javax.persistence.PersistenceException">
<end-conversation/>
<redirect view-id="/error.xhtml">
<message>Database access failed</message>
</redirect>
</exception>
<exception>
<end-conversation/>
<redirect view-id="/error.xhtml">
<message>Unexpected failure</message>
</redirect>
</exception>
</pages>
šŶ& <exception> ƎƏŽGH-Ɠd¯2°v°&%n
%Ɠdñò2°¬Ŕ&śé´ƚ2&èéÃĭF¯Ŗ´ŗ
ï,45ŖœŽ
pages.xml
Ő [ ^ Y
eà m view-id ^ «›2ÃĭF¯œèéM-N-GE-´¬Œ}s%ÞŖ´ŗ
Ž!ò“”;,Ã-ǞÞŖ´ŗèé&ÂFE‚GE-´¬èŽŧ&Ļûŗ
...
throw new AuthorizationException("You are not allowed to do this!");
<pages>
<exception class="org.jboss.seam.security.AuthorizationException">
<end-conversation/>
<redirect view-id="/error.xhtml">
<message severity="WARN">#{handledException.message}</message>
</redirect>
</exception>
</pages>
m[ m Z
Y m _ [[à m[ `à Æ_YYÇ Z
Y [ C[`[ņ org.jboss.seam.handledException
Z
Y
m[
*m
org.jboss.seam.exception
[2[ Ä
e à J ~#6
<exception class="javax.persistence.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message>Not found</message>
</redirect>
©C©
oo
M¹nMNENnèéÐ=
</exception>
<exception class="javax.persistence.OptimisticLockException">
<end-conversation/>
<redirect view-id="/error.xhtml">
<message>Another user changed the same data, please try again</message>
</redirect>
</exception>
e à J m #YY[
b_ö6
<exception class="org.jboss.seam.framework.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message>Not found</message>
</redirect>
</exception>
e à J à6
<exception class="org.jboss.seam.security.AuthorizationException">
<redirect>
<message>You don't have permission to do this</message>
</redirect>
</exception>
<exception class="org.jboss.seam.security.NotLoggedInException">
<redirect view-id="/login.xhtml">
<message>Please log in first</message>
</redirect>
</exception>
#ņ e b6
<exception class="javax.faces.application.ViewExpiredException">
<redirect view-id="/error.xhtml">
<message>Your session has timed out, please try again</message>
</redirect>
</exception>
# ViewExpiredException e m Y `
ö YJ m m Zf
Y no-conversation-view-id conversation-required JC à e J [
C ZY e à C
©C©
o
^ ‘wïK4~4.“D
ˆɽ%Žn !ȅ!ȅ &“”Å—Ö°2Ȩã=>¯2°ţŒ}¯Ŗ´ŗ
Ɂ&ŽŖûŽn + Ö&ȶ°ÖÞs̮Ć¯œ§¨n Г”đ&‘ʝ}v›œŒ}%´ŗ
ş
ðG-- }°"ƉŠn ŒòŽ )oo) ɪlG̯̰̱
&K‚PG%ȶ°ÖÞŖ¯œŗ
Œ&K‚PG%nɟŽ
&$ðG--•='ƊĿǾ¬ǁvţvûŖ¯œŗ)
Ƃ}Njûĺ¯œ°}Žȶľv°«"vǐǑ%¯œŗ
ÆĊ-HÇ
ş
̲ˋŠE¤,@G-%/p´¬345H8G45}°"ȶ°ÖސǤýn
-,D-vÃ,Gĭ¹-}´¬·¸&OD‡ðG%ŽȁȂñòœij;,
Ã-&îɓŠv•=Ž'ǹ%Þv°Œ}'ʞ¯œɁ'%¯œŗ ƞ` ‡Ž LazyInitializationException “´¬īǖŽ̳Þ̄Þ2°Ŗ¯œ¯n 'ꐎŒòŽ ž`
ƺƻsµ¬&%Žvţn Ģ¯ȅ YJ OD‡ðGĝ )^^ ëŨ¬űƦ& [
e
ÆÇ
âNvŠ-,D-Ã,Gĭ%Rñò¬ˌ˫ȃdŠvij;,Ã-Å
—ƺƻsµ›œ&%´ŗÇ
ş
ðGOKN-G}°"ȶ°ÖÞ
Œ"¯œȶ°ÖÞńw¯OD‡ðG%LjūvRƿǀ´¬Œ}%n
ś­«û´›Þû¯œ;<%«û̴º%îɓŠv345l<%Þ¬âðOvŞ
³‘ʝǁŖ¯œŗ
^ .‘•#
ŒòŖ%ƃœèŽnśŜ&±Ƴű"īļſȩv“”Å—Į£¯Ŗ´ŗ
ş
b
G?-HMOMG%µ¬n
G?-Ɯ&ǃ£n
KE-&ƌ…Ĭ¥ƍn
ŗƜ&ĸ®n
345&ƭìƗ¯n
D-R-&Dĕ™&ŚOPƛ&Ĉçn
ļG,@–v“”;,Ã-sµûŖ´ŗ
ş
b
G?-HMOMG%µ¬l&̵˵OPƛ&Ąľû%n
Ž!òŖ%&ɐĈ“”;,Ã-&̵˵ ØŖ´ŗ
¸ǰ¯vŨòũn
Ž®¯°,RH&“”;,Ã-²³¯Ŗ´ŗ
ş
@Begin
ş
@End
ş
b G?-HMOMG%µ¬D-R-&Dĕ™&OPƛ&Ąľû%n ŽɐĈ“”;,Ã-&qrV̶´¬ºn
,RH“”;,Ã-&qrȒȓ¯Ŗ´ŗ
ÂÚF<sƗ2ţ¬}n ,RH&“”;,Ã-ŽɐĈ“”̀‰¯Ŗ´ŗ
ÂÚF<sƗ2ţ¬}n
Š&«"vɐĈ“”;,Ã-%Ŕ,RH&“”ʶ‰ñòŖ´ŗ
©C©
o)
“”}ðG--&•=
ş
Š&«"v e
G?- Æb R-˜FGÇ %Ŕ“”;,Ã-ʋʌ¯Ŗ´ŗ
—O¶%Žn
fe
G?-
Æèýũn
ó^*
G?-Ç
Ž“”;,Ã-ʋʌ¯ŖĿŻsn ŒòÖ°2&ȨãŽŜVȺȻ¯2ţŦñ°ŗ
ş
b
G?-HMOMGsĕMDG«›2̷̸ñò¬ŷĆn
Ž̹˼Šǹǰ&“”;,Ã-ƀ¸̥ì̵˵¯Ŗ´ŗ
ő
!&“”s
(beforeRedirect=true) %·Ąąñò2°v°ȃûŗ
Y[à YYJ m C Z
ZÇ b Y`
ö e
fe
Ė Æ ó^* Ė e ZY[Ç _[[ _[[ ` Y
_ Yà C
m `mC
@End
Æ
[J m Yà Cf
à ė àmJ Y
[ņ YYJ m C Z
*m [[à f ` [_à f
fe
G?-ŹȔ “”ʋʌñĿœ°ŷĆn G?-âHÂN}¯2 “” € ǂzŠ;<ä´¬Ų’sµûŖ´ŗ
<a href="main.jsf?conversationId=#{conversation.id}">Continue</a>
b &«"´¬ŷƐŽśŜ&«"¯Ŗ´ŗ
<h:outputLink value="main.jsf">
<f:param name="conversationId" value="#{conversation.id}"/>
<h:outputText value="Continue"/>
</h:outputLink>
N™HM–Hš£´¬ŷĆn śŜŽɰȣ%´ŗ
<h:outputLink value="main.jsf">
<s:conversationId/>
<h:outputText value="Continue"/>
</h:outputLink>
R-˜FG£&“”;,Ã-&ʋʌȳœ°ŷƎn ÍƟ&,GŎFGsšýŖ´ŗ
<h:commandLink action="main" value="Exit">
<f:param name="conversationPropagation" value="none"/>
</h:commandLink>
N™HM–Hš£´¬ŷĆn śŜŽɰȣ%´ŗ
<h:commandLink action="main" value="Exit">
<s:conversationPropagation type="none"/>
</h:commandLink>
“”;,Ã-&ʋʌȳ¬Œ}}n
“”Ąą´¬Œ}}ŽŹţɂv¬Œ}%´&%ơƬ¯2ţŦñ°ŗ
G?-âHÂN ŖœŽ <s:conversationPropagation> N™Žn
“”&ôª}Ąąnµ¬°ŽS-ñòœ“”&ôªŔš£´¬Œ}s%ÞŖ´ŗ
conversationPropagation
<h:commandLink action="main" value="Exit">
<s:conversationPropagation type="end"/>
</h:commandLink>
<h:commandLink action="main" value="Select Child">
©C©
o+
“”}ðG--&•=
<s:conversationPropagation type="nested"/>
</h:commandLink>
<h:commandLink action="main" value="Select Hotel">
<s:conversationPropagation type="begin"/>
</h:commandLink>
<h:commandLink action="main" value="Select Hotel">
<s:conversationPropagation type="join"/>
</h:commandLink>
Œ&“”Å—Žn
¤œ@<œɕpŋ¯2Ţļ/p´¬345&ŞȷrƱ¯2ţòŖ´ŗ
ƾţ&345}›2Ų’vŔ&ŽŒòŦŨ%´ŗ
Ôƴv345&vºŽśŜ&ǣǤ’Ü&Ɲēµ¬°ŽŠnj»ºŲ’}´¬Ŕ&sµ
ûŖ´ŗ
ş
“”Žn
ŌjŠ'(¯œûÍΐ'(´¬Œ}Ŕµ¬ƾţ&ďñvſÌ&78MNHG45Ŕ
ġŖòŖ´ŗ
«ûďñ°S-ñòœ“”Žſǯ&“”ƪƫEFsµûn
Ŗœéˬ&“”ƪƫǵ&GE-ŔµûŖ´ŗ
ş
78ŽÍ–Hœ8&œ@<œq%°ţÖŔ&“”úûʺý¬Œ}s%ÞŖ´ŗ
Œ&ķusðG--•=}ƭũò¬Ŕ&%´ŗ
^1 U4
ðñš‘
S-ñòœ“”Ž·¸&“”&-;q%
@@Begin(nested=true)
}¤GñòœÂÚF<ƭìƗ´Œ}«›2p³ñòŖ´ŗ
S-ñòœ“”Ž!ò¼ȧ&“”;,Ã-՛2°2n
Ŗœn
éˬ&“”&;,Ã-ǵ&ıIJûdž£GE-Ŕ՛2°Ŗ´
Æéˬ&“”&;,Ã-ȃıĢŒ}Ž%Þ¬snɆÞÙ؎%Þv°Ç
ŗ
ŧ
@End
sƗ2ţ¬}n
S-ñòœ“”ŽȒȓñò2éˬ&“”s“”-NFGĐ~~đ´¬Œ}«›2Ʋô¯Ŗ´ŗ
“”Ž˟Ƭ&șñS-´¬Œ}s%ÞŖ´ŗ
Ğd&78G,@l,@
ÆðG--•=ĝþ¬ÿNÇ
qˬ&“”sĄą´¬­éˬ&“”sôªñĿ¬Œ}s%ÞŖ´ŗ
͏éˬ&“”ƙ´¬Ôƒ&ÏdzS-“”ÕÖŒ}s%ÞŖ´ŗ
S-ñòœ“”sĄą´¬­éˬ&“”sĄą´¬}n
ŽS-ñòœ“”;,Ã-éˬ&;,Ã-}ƹ´ƚ2Ȓȓ¯Ŗ´ŗ
«ûn
Œ&ŷĆn
“”Žɨjtuvƪƫ}ƃv´Œ}Ŕ%ÞŖ´ŗ
S-ñòœ“”«ûn
78MNHG45ëŨ¬ƟǔvRMë°2345Žwɖ¯œɨjtu
vƪƫʦ»ý¬Œ}s%Þ¬«"vûŖ´ŗ
ű›2n
þ¬ÿNʈ´Œ}ĝðG--•=“¯2Ţ¯°/pƀƍ¯Ŗ´ŗ
*€6
þ¬ÿNʈ¯œŷƐn
Š&«"¯2S-ñòœ“”sƄŢsǶ²¯v°«"̑Ł´¬ºz´èŗ
©C©
oQ
“”}ðG--&•=
Ļļn
ǹǰS-ñò2°¬“”&˺}v¬“”;RSs¸ǰ´¬ŷĆn
Œ&S-ñò2°¬“”ŽÍM-N-š£¯Ŗ´ŗ}ސŽn
˺}v¬“”q¸ǰ´¬;RSM-N-s!&X}v¬“”º»Žƃývţv¬«
"n S-ñò¬!òɇò&“”qƐǔ&M-N-՜Ŀ¬}ưĮvŒ}sµûŖ´ŗ
;RS @PerNestedConversation ï,45ÝŨ¬}Œò("Œ}s%ÞŖ´ŗ
^2 ò] !KF4
'˜™9‘'󧱩
‚s fe
G?- Æèn ž**~ ó^* G?-Ç ǐȍ%GE-ñò¬ŷĆn b
Ž./ñò¬G45-êŹţdÓ¯ŖĿŻŗ
78s!&‚–FG¤G´¬nµ¬°Ž
<h:outputLink>
º»!&‚(ÞȥţŷĆvŠǶ²¯Ŗ´ŗ
‚sGE-ñòœ»ƣnj“”ôª¯œ°ŷĆsµûŖ´ŗ
G45ÂÚF<sv°œ1n
G45
ï,45ÝŨ¬}°"ƯĻ&ēĔ%Žƺƻ>Ɣ´¬Œ}s%ÞŖĿŻŗ
b
@Begin
Œ&‚sƪƫ;,Ã-ȃOPF´¬Ų’sµ¬ŷĆn
ñ»v¬ƺƻsǶ²¯Ŗ´ŗ
´%n)
Ö&ƺƻ>ƔēĔƃ2ÞŖ¯œŗ
;RS!&ƪƫsƀÕñò¬ŷĆn @Create ÂÚF<%!&ƪƫOPF%ÞŖ´ŗ
ƀÕñò2°vŨòũn
;,Ã-ȃ“¯2
@Factory
ÂÚF<dÓ´¬Œ}s%ÞŖ´ŗ
Œò»&Ċ45s"Ŗţ°ºv°ŷĆn %Ž pages.xml OáM ‚G45
dÓ´¬Œ}s%ÞŖ´ŗ
<pages>
<page view-id="/messageList.jsp" action="#{messageManager.list}"/>
...
</pages>
‚sDĕ™ñò¬«"}´¬}ގļn
D-R-&Dĕ™OPƛ&Ɉɉ%Œ&G45ÂÚF<sƭìƗñòŖ´ŗ
‚G45s
[[
śé&§¨ĺ´ŷĆn
Žǃúv
b
̥ì
êl†45&±ƳÐ=´¬&%n
Ŗ›œţɂv¬‚sDĕ™ñ¬Œ}v¬ºŔ¯òŖĿŻŗ
‚&Dĕ™­(°œ°Œ}s“”&ôªŦŨv»n
lMG45ÂÚF<ŧ&«"š£%ÞŖ´ŗ
<pages>
<page view-id="/messageList.jsp" action="#{conversation.begin}"/>
...
</pages>
Ŗœn
Œ&lMG45Ž b ;Kº»ŔƭìƗ´Œ}s%Þn
š›2“”Ąą´¬Œ}s%ÞŖ´ŗ
ÍƟ
#{conversation.end}
·¸&“”‚5M´¬µ¬°ŽS-ñò¬“”ôª´¬n
‚OKŖœŽĴFG“”ôª´¬œ1ñ»ĂăsŲ’vŷƎn
<begin-conversation> ?Dš£¯2ţŦñ°ŗ
©C©
o\
“”}ðG--&•=
<pages>
<page view-id="/messageList.jsp">
<begin-conversation nested="true" pageflow="AddItem"/>
<page>
...
</pages>
Ŗœn <end-conversation> ?DÂŔµûŖ´ŗ
<pages>
<page view-id="/home.jsp">
<end-conversation/>
<page>
...
</pages>
ŽƉ&ƺƻ>Ɣ´¬Žn ǹǰ \ Ö&Ċ45º»ǚǛ%ÞŖ´ŗ
ş
@Create
ş
@Factory
ş
‚G45ÂÚF< @Begin ï,45ǣǤ´¬
ş
pages.xml
ş
#{conversation.begin}
^S
ÂÚF< @Begin ï,45ǣǤ´¬
ÂÚF< @Begin ï,45ǣǤ´¬
% <begin-conversation> š£´¬
<s:link>
w
‚G45ÂÚF<}¯2š£´¬
<s:button>
.˜­·š
b
;¤<GŽļ
C
Y
%O¶‡–ĴF(°Ŗ´ŗ
Œò«ûœP––Hœ8&Đ®¯°œ@<œ%ôţđŖœŽĐ®¯°N–%ôţđķu/p
ñĿvţ¯2¯Ŗ°Ŗ´ŗ
D&
b
%Œ&ķusŲ’vŷƎn
<h:outputLink>
š£´¬Ų’sµûŖ´ŗ œŦ¯n <h:outputLink> ŽƢ’vĂȃs ) ÖµûŖ´ŗ
ş
b ŽG45-ê <h:outputLink> ÖvɅ¬ēĔƿǀ¯2°ŖĿŻŗ
ş
'ęO¶‡–ĴFsv°œ1n b ŽǚǛñòœ DataModel &dzʋʌ¯ŖĿŻŗ
Ž ŽƉ&ƺƻ>Ɣ“¯2Ž ‚G45}°"‘ʝƿǀ¯2°Ŗ´sn ŒòŽ
)
ŽƉ&ƺƻÖ°2ŽŖ›œţǍǎnjŖĿŻŗ
ŒòÖ°2ŽG?-âHÂNț´}°"
I^*e[
ēĔš›2˜ˬµ¬ǚǛĊ–‚PGƲƺ°ĆľĿ("Œ}%ʗʘ%ÞŖ¯œŗ
–K™345vŠ&ŷƐŽn 'ęŒòsšǃ&ɻʮ}vûŖ´ŗ
I^*e[
-NMŽ˜ˬ&ƪƫŲ’}¯v°œ1–FG¤GķuR¯Ŗ´ŗ
–FG¤GŽµŖûŲ’v°vŠŒòśé&ŷƎn @DataModel ë«ì @DataModelSelection
š£´¬}īļưĮ%̹˼ŠvûŖ´ŗ
Œ&ķuǴ›2ñ»“”ʋʌ&•=«ûžȈä´¬œ1n
N™ƿǀ¯2°Ŗ´ŗ
Ž
<s:link>
b
Œ&GŽ b l € ŦŨƓd´¬Œ}s%ÞŖ´ŗ
©C©
oa
“”}ðG--&•=
<s:link view="/login.xhtml" value="Login"/>
µ¬°Žn
G45ÂÚF<Ɠd´¬Œ}s%ÞŖ´
G45&§¨ŽšĄŠv‚Ťd´¬Çŗ
ÆŒ&ŷĆn
<s:link action="#{login.logout}" value="Logout"/>
b l € }G45ÂÚF<&ƝēƓd´¬}n
śé&§¨ĺñv°ȃûĐlđsš£ñòŖ´ŗ
<s:link view="/loggedOut.xhtml"
G45ÂÚF<s
[[
action="#{login.logout}" value="Logout"/>
GŽ <h:dataTable> q%š£´¬ DataModel &ǚǛdz¼/Šʋʌ¯Ŗ´ŗ
<s:link view="/hotel.xhtml" action="#{hotelSearch.selectHotel}" value="#{hotel.name}"/>
·¸&“”&-;Ȥ¯2ëţŒ}s%ÞŖ´ŗ
<s:link view="/main.xhtml" propagation="none"/>
“”ôªn Ąąn ŖœŽS-´¬Œ}s%ÞŖ´ŗ
<s:link action="#{issueEditor.viewComment}" propagation="nest"/>
Gs“”ôª´¬}n š£ñò¬‚KƓd´¬Œ}Ŕ%ÞŖ´ŗ
<s:link action="#{documentEditor.getDocument}" propagation="begin"
pageflow="EditDocument"/>
B~| N-G-š£´¬ŷĆ& taskInstance ƙĬ%´ŗ
<s:link action="#{documentApproval.approveOrReject}" taskInstance="#{task}"/>
Æ$V&èŽ €€ -—Å345ȺȻ¯2ţŦñ°ŗÇ
šŶn ÿN}¯2Dĕ™ñò¬ĐGđsŲ’vŷƎ <s:button> š£¯Ŗ´ŗ
<s:button action="#{login.logout}" value="Logout"/>
^[ °ô.¿JI
/p“¯2³ø¯œº̺̻¯œº78z´ÂFE‚Ěz´¬&ŽīļwʕŠ%´
ŗ
ŒòŽn
b
FacesMessage
š"}ưĮ%´ŗ
Ȥʝvs»n
³ø&G45Ž–Hœ8ĕMDG’´¬Œ}sƾţn b ŽĕMDGŹȔ e
&ÂFE‚Žʋʌ¯ŖĿŻŗ
Œ&œ1D
b
%³ø&ÂFE‚Ěz´¬&ŽºvûȞǖvûŖ´ŗ
lM&“”-;
;RS%µ¬
sŒ&ƺƻ>Ɣ¯2ţòŖ´ŗ
ĕMDGO@NM-¯2ëţŲ’sµûŖ´ŗÇ
facesMessages
Æ
@Name("editDocumentAction")
©C©
og
“”}ðG--&•=
@Stateless
public class EditDocumentBean implements EditDocument {
@In EntityManager em;
@In Document document;
@In FacesMessages facesMessages;
public String update() {
em.merge(document);
facesMessages.add("Document updated");
}
}
facesMessages
ǣǤñò¬ÂFE‚Ž´ƚ2´ʲŧ&OP-%µ¬D-R-Dĕ™OPƛ%ǹǰ
&“”“¯2š£ñòŖ´ŗ
ŒòŽ
sĕMDGŹȔwΊv“”;,Ã-ɗÕ´¬&%ɐĈ'(&“”sv°ŷĆ%Ŕķ
u¯Ŗ´ŗ
b ^ ¿ e
ÂFE‚¤ġŖĿ¬Œ}Ŕ%ÞŖ´ŗ
facesMessages.add("Document #{document.title} was updated");
œ}ýũn Ļļ&ēĔ%ÂFE‚Ěz´¬Œ}s%ÞŖ´ŗ
<h:messages globalOnly="true"/>
^^ õ Æ ]m _öJ _m C m [ _m Y `B
ņ à ` `[ m [ ` öà e m `B
e m ņ ŸJŸ Cf
6
ş
^à ZJ C
` e[ ZJ C e m Ė m Y _
*ö m ZY[6
ů Ő `àņ m[e _à mJm YàJ e à B _ ¢m
Y e à Y à àė J Jm m f à à
Yà [ ` à ė ` m Ő [[à m `_ __ eJ m ù_ à m Yà e
m Ű
]m [ C [[à à mC m B m ZJ f
Cņ Y
ö Y _m mà [e ee f B mC m B m Yàb
C _m m m C ş
A e[à AI b m e CJ`[ m
mà Æ CJ `à J m [Ç Je[ AI Æ[ö m ]ö f ė eà mJ `à Ç b
YY[
e[à AI [ Yņ e ©C©
oh
“”}ðG--&•=
]m [ Cņ _m à `[J à m[ `öJ à Æņ e
ņ
_mC
à
YY
Ç
à
J
AI [ö
http://seam-hotels/book.seam?hotel=BestWesternAntwerpen Æe ņ _mC Y
hotel Y à [ ` ĖÇ _m AI I_ [à f
e m mY6½½fm[½`ö½]#_Y
|
m `Ņ
^^  Æ
ù[ C e pages.xml6
<conversation name="PlaceBid"
parameter-name="auctionId"
parameter-value="#{auction.auctionId}"/>
*m e mJ e m `C e m m C m ņ m PlaceBid *m Ė[à e m Y
[ Cņ `à m page e eà C Y
Y *m Z `ņ parameter-name e m Ė Y m _[[ m
[ C ņ Y[
e m e[ C Y m Zf
Y[ņ m parameter-name auctionId *m m e C Yf
[ö cid=123 YYJ m AI e à YJņ _[[ auctionId=765432 f
*m [ ` m `C eJņ parameter-valueņ e ^ ZY
C[ m C[ e m [ ` öà m C m ZY[ņ m C _[[ ` m Yà öà C[ e m auction [à Y
ùZņ _ e _m
m YJ _[[ Y
Y m C *m `à
Y
eàJ m conversation ` e page e6
<page view-id="/bid.xhtml" conversation="PlaceBid" login-required="true">
<navigation from-action="#{bidAction.confirmBid}">
<rule if-outcome="success">
<redirect view-id="/auction.xhtml">
<param name="id" value="#{bidAction.bid.auction.auctionId}"/>
</redirect>
</rule>
</navigation>
</page>
^^1 j Æ
]m Jņ J ņ [ C m ` e Y
e Y
eàJ m [ C ė `à [öJ m e[[_J
YJ e6
<page view-id="/auction.xhtml">
<param name="id" value="#{auctionDetail.selectedAuctionId}"/>
©C©
ok
“”}ðG--&•=
<navigation from-action="#{bidAction.placeBid}">
<redirect view-id="/bid.xhtml"/>
</navigation>
</page>
b mņ _ m CöJ m #{bidAction.placeBid} e C_
Æ`à m _àņ [[ m ZY[ ö e m à ZY[ Çņ m _ _[[
` /bid.xhtmlņ _m
mņ _ _ YC[àņ eJ _m m [
C PlaceBid *m [ e m [ö [ö m6
@Begin(join = true)
public void placeBid()
]m C Y
e m <page/> [ņ m C Y e CJ [ņ e m m m [à `
Cö *m Y`[ _m J ZJ Cņ ` `e m m Cö *me à Yf
eà m C _m m Cö  _à e J m `à J
m s:conversationName J6
<h:commandButton id="placeBidWithAmount" styleClass="placeBid" action="#{bidAction.placeBid}">
<s:conversationName value="PlaceBid"/>
</h:commandButton>
#m [C Y
eà m conversationName ` _m J m s:link
s:button6
<s:link value="Place Bid" action="#{bidAction.placeBid}" conversationName="PlaceBid"/>
^b ïK4~4.“D
ðG--•=Žn
Ö&œ@<œ&ŀ%“”Đúûʺý¬đuū%´ŗ
ŽðG--•=
C
;<&D¹%ŸŹ̹˼Š¯Ŗ´ŗ
ðG--•=tu´¬œ1nŲ’v´ƚ2ŽśŜ&Ļû%´ŗ
ş
!òɇò&l
€
Æb
ŖœŽ
êl†45š£´¬ŷĆÇ
ŖœŽ‚ï<
ÆB~€ ‚OKÇ
Ȩã&,Ã-Ūū¯Ŗ´ŗ
Œ&Ȩã,Ã-ŽðG--úûüý«›278ĚzñòŖ´ŗ
ş
‚&ŀ
Öś$&ƑƒðG--úûüý
~
ŖœŽ
e
[
&įİġŖĿŖ´ŗ
Ƒƒ&įݎ<KFĕœÂŎn
“”&-n
–DF<GH‡ Æ`
`Ç ˴¯2ðG--•=R¯Ŗ´ŗ
^b ïK4~4“Dw _ égƒ;<%
b ŖœŽ êl†45š£´¬ŷĆn Ž“”&ǹǰ& view-id
̵˵¯2!&“”úûüýŖ´ŗ
ðG--&VWŠv,Ã-Ž
pages.xml
}ƭũò¬OáM%dÓñòn ŽŒ&OáMs WEB-INF —@DGq& faces-config.xml &´ʲŧTǞñò2°¬Œ}Ĉȏ¯Ŗ´ŗ
©C©
o
“”}ðG--&•=
<pages>
<page view-id="/main.xhtml">
<description>Search hotels: #{hotelBooking.searchString}</description>
</page>
<page view-id="/hotel.xhtml">
<description>View hotel: #{hotel.name}</description>
</page>
<page view-id="/book.xhtml">
<description>Book hotel: #{hotel.name}</description>
</page>
<page view-id="/confirm.xhtml">
<description>Confirm: #{booking.description}</description>
</page>
</pages>
Œ&OáMsĈȏ´¬ŷǧvţ2Ŕ
345ŽŢļ/pj(¯Ŗ´ŗ
/p¯v°ķuŽðG--&úûüýķu&Ø%´ŗ
^b1 ïK4~4“Dw xy}Ÿ ~QM
B~€ ‚OKdӚ"ŷĆn
Žǹǰ&
&KE-ƪƫ̵˵´¬Œ}«›2“”úûüýŖ´ŗ ͏ view-id ǹǰ&
ż2ɂv¬Ȩã՜Ŀ¬Œ}s%Þ¬œ1ŒòŽ«ûǜǝvŗvûŖ´ŗ
Ȩã,Ã-Ž <page> ï<%dÓñòŖ´ŗ
B~|
<page>
<pageflow-definition name="shopping">
<start-state name="start">
<transition to="browse"/>
</start-state>
<page name="browse" view-id="/browse.xhtml">
<description>DVD Search: #{search.searchPattern}</description>
<transition to="browse"/>
<transition name="checkout" to="checkout"/>
</page>
<page name="checkout" view-id="/checkout.xhtml">
<description>Purchase: $#{cart.total}</description>
<transition to="checkout"/>
<transition name="complete" to="complete"/>
</page>
<page name="complete" view-id="/complete.xhtml">
<end-conversation />
</page>
</pageflow-definition>
^b2 ‘ö÷øù
ŧ&įİ
~
ŖœŽ
e
[
&‚ġŖĿ2n
ǹǰ&“”ŖœŽ!&ĩ°Ŵò&345&‚Ŕúûüý»ò¬<KFĕœÂ
ŎIJǁ¯Ŗ´ŗ
<h:selectOneMenu value="#{switcher.conversationIdOrOutcome}">
<f:selectItem itemLabel="Find Issues" itemValue="findIssue"/>
<f:selectItem itemLabel="Create Issue" itemValue="editIssue"/>
<f:selectItems value="#{switcher.selectItems}"/>
</h:selectOneMenu>
<h:commandButton action="#{switcher.select}" value="Switch"/>
©C©
“”}ðG--&•=
Œ&è%Žn
78®¯°“”ôªñĿ¬
Ś“”&œ1&M,‡ġĢÂŎsµûŖ´ŗ
)
Ö&ǣǤM,‡Ǥý2n
[à C _m Y ÆY
e pages.xmlÇ _[[ ` [ m
Yf_ ^bS ‘rs
“”wxŽ“”úûüýīļ«ţʛ2°Ŗ´sn Ě¾¿%Ězñò¬NJsɂvûŖ´ŗ
<h:dataTable value="#{conversationList}" var="entry"
rendered="#{not empty conversationList}">
<h:column>
<f:facet name="header">Workspace</f:facet>
<h:commandLink action="#{entry.select}" value="#{entry.description}"/>
<h:outputText value="[current]" rendered="#{entry.current}"/>
</h:column>
<h:column>
<f:facet name="header">Activity</f:facet>
<h:outputText value="#{entry.startDatetime}">
<f:convertDateTime type="time" pattern="hh:mm a"/>
</h:outputText>
<h:outputText value=" - "/>
<h:outputText value="#{entry.lastDatetime}">
<f:convertDateTime type="time" pattern="hh:mm a"/>
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<h:commandButton action="#{entry.select}" value="#{msg.Switch}"/>
<h:commandButton action="#{entry.destroy}" value="#{msg.Destroy}"/>
</h:column>
</h:dataTable>
̃»ţn
ƾţ&ēsǯ¼&345Ć"«"L-N¤Mƛʜ˂´¬Ŧȅ"}ȶ°Ŗ´ŗ
[à C _m Y _[[ ` [ m [
©C©
)
“”}ðG--&•=
“”wx«û78sðG--Ȓ̼´¬Œ}s%Þ¬&%ƮƬ¯2ţŦñ°ŗ
^b[ ”HJCKL„ ÃÅ
–DF<GH‡Žn
S-ñòœ“”Å—š"345%ǍǎnjŖ´ŗ
–DF<GH‡Žn ǹǰ&“”-NFGq&“”ǵ&G&wxvûŖ´ŗ
<ui:repeat value="#{conversationStack}" var="entry">
<h:outputText value=" | "/>
<h:commandLink value="#{entry.description}" action="#{entry.select}"/>
</ui:repeat
^c
B%TU%
‘ B%TU%
.–O%•G%—
w
_
Ƣ’%ŽµûŖĿŻsn
b
;RSǵ&˜M—@™&ƀՐŽš£%Þv°}°"Ăȃs“”¡;RS
ŽµûŖ´ŗ
ÆwʕŠŽn
345Ȏ=º»l“´¬Lj°Ä¸ŋʂp›2¯Ŗ"œ1n
ɶ“ŠŲ’%v°ȃûwʕŠŽŒ& b &ķuŽš£¯v°«"¯œēs«°%¯Ƌ"ŗÇ
Y`
ö
G?-%n
“”;,Ã-s̵˵ñò¬­n
l&̵˵OPƛŀ;RS&˜M—@™Žĸ®ñòŖ´ŗ
Œòʗʘ´¬Žn
M¹-;;RSš›2;RS˜M—@™‰Ț¯n
!òŲ’}´¬“”-;;RSM‚PG¯Ŗ´ŗ
@Name("grid")
@Scope(ScopeType.EVENT)
public class Grid
{
private HtmlPanelGrid htmlPanelGrid;
// getters and setters
...
}
@Name("gridEditor")
@Scope(ScopeType.CONVERSATION)
public class GridEditor
{
@In(required=false)
private Grid grid;
...
}
#[C[àņ à m b Y mJm m Y[
uiComponent
m[ *m e[[_J ZY[ getRowIndex()e m UIData Y _m
m `
ö
m `[ J ņ Y m _ `6
©C©
+
“”}ðG--&•=
<h:dataTable id="lineItemTable" var="lineItem" value="#{orderHome.lineItems}">
<h:column>
Row: #{uiComponent['lineItemTable'].rowIndex}
</h:column>
...
</h:dataTable>
b A Y C[`[ _m m [ e m Y
^f Æ # J[ e [[ Y ` e ććć ž _
_[[ m _m
m à _[[ à ő f
J C[ Y e ##å Ė ]ė JJ m Y m
#BZ [ [`à m[ YC [ C JJ m [ ő _ė[[ [ö m Y I
mb
JC à
¢C[ Y ė [[_ [ me Ė m
Ė Y
m [[à *m [[_ m Ė ` Z
f
em ž_Cņ Y[ Ė ė m J ő e[àņ e m ņ e
ņ öJ Cà [J Y[ņ J C C J _mC
m [ J Ė ` ÆY[ e €[ e C
öÇņ
ņ [àņ ##å e YC Ė
ö Y m ņ J m e [J ė e[
*me Ė m C e Y e Æm Ė
Ç̽ e ė Y
m C ņ Yà C Y J m [ m ö_ _mė JJ ė me Cà
Y e[ m C _m ##å CŅ
] `[ e[ e m Ė Æ Ç Yf
Z[6
<core:manager concurrent-request-timeout="500" />
e _ėC Ÿà
mŸ ##å Ė f m [ [[ m C m C m ņ m Y e m YJ ` m [ *m YY
m
J _m m ##å Ė [Jm_Jm Æm m [[ Y[ J [
f
[J m e [ e `Ç _m e _ Y[Z Yć
b mCà Y _ m[ [à à
m ÆY[[ `Ç YY
m ő m [f
##å Ė m Cņ _m
m ` Z
à
mf
[à m C Æ m m Y m [ Ç̽ m [ m
Y[[ m C e Y *m e[ _m à mC [JfJ e
_m
m Y m Cà Z
Æà ė _ ` YY Y[
ņ Ç
ž_ m[ _ J C[ ##å YY[
ć
][[ eņ à _mm à _ m Y[ Ÿà
mŸ Ė
©C©
Q
“”}ðG--&•=
_mm à _ J Y[[fà[ YY
m
e à J e Ÿà
mŸ YY
mņ m à ö e m_ [J
à ##å Ė _[[ ö Y[ f m m m m Ė
ć e ņ à Y``[à _ [ m Ė e m mf
Æ `CÇ ùZ à Y``[à _ Ė m [ YC
e[J m C _m Ė e m C e ÆJ öàYņ `[ e
Y e[Ç Y e m [ Yà à m[ f
Ė [à m [ ]m _öJ à Ė [àņ e
m m
C à [ ` Ė m C b[[àņ m [ [`à à YC Y ` em Y[
Ė
eC e m Ő ` e[ _m m Y [ e[J e m C _m Ė e m C `[ ` m em
Ė
AJ Y[[fà[ J Ė [ efJ Ő B ö à m
@Asynchronous Y[[J C[6
int total;
// This method is called when an event occurs on the client
// It takes a really long time to execute
@Asynchronous
public void calculateTotal() {
total = someReallyComplicatedCalculation();
}
// This method is called as the result of the poll
// It's very quick to execute
public int getTotal() {
return total;
}
^f j_ +xÄ
I
mb
#BZ m ##å [`à [à _m ņ YC [[ m
[ `C6
ş
eventsQueue
ő YC Ė _m
m C Y[
#[[ C Ė f
Ė m C [[à *m e[ e m Ė m Cf
ö Z
ÆJ mCà Yņ CJ e e
[_ Ç m C ė e[
ş
ignoreDupResponses
ő J m Y Y
`à m Ė e ėf
[ė Ė [à m Ė J€YIY̾ŸŸ [ m
m Y
J e m Ė m C ő B YC à Y
m [ *m Y m[ ` _m _m ė C [[_ [Y[
Ė ` ş
requestDelay
ő e m Æ Ç m m Ė _[[ ` m Ė
©C©
\
“”}ðG--&•=
e m Ė m ` Y
`à e m m Ė _[[ ` ÆJ[ e _mm Y m ` CÇ Æe m [ C m ĖÇ
*m Y m[ ` _m _m ė C [[_ [Y[
Ė ` Ő ` m m [à à Æ `f
_m m Ė Ç [J m m _[[ ö Zf
ş
<a:poll reRender="total" interval="1000" />
ő ~[[ m Cņ ©C©
a
b ~QMwgU4&MI4
B~| ŽnC ^ ĝ ^^ ʼnŇ&œ1&l‚S-KE-•=?‚%´ŗ B~|
Žnl‚S-KE-ĝn78MNHG45n
ȏnjƪƫn
—4‚5nN-Gn]^‚vŠn
ï<&̫¿}¯2Ěǹtu¯Ŗ´ŗ
̫¿Žnžſ%}2ŔıØĝ´° B~€ }ƭũò¬ å| Ěǹš£¯2dÓñò2ëûn ^
[Y
H™MĮ£¯2nʼȡn™HO@FG«¬ɀ̒ästu%´ŗ
B~€ ŽȁȂtuvƏ˛%µûn
]^
345&‚OKdÓ´¬Œ}º»nʟ¡ŠvðGOK&•=n#
ʼnҐëŨ¬l-&Ċ3-D45Ŗ%ǃż¯Ŗ´ŗ
345Ž B~| ) Ö&ɂv¬ƺƻš£¯Ŗ´ŗ
ş
Ôƴv78MNHG45ġĢ‚OKdÓ¯Ŗ´ŗ
B~€ KE-dӎn“”&œ1&‚OKdÓ¯Ŗ´ŗ
;˜E45Žn4™78}&̕“Š̷Ĉv“”&MNHG45%µ¬}
Ǫý»òŖ´ŗ
ş
l‚S-KE-̿̀ŠdÓ¯Ŗ´ŗ
l‚S-KE-Žnԃ78&ԃ&“”&̟̠ġĢºŔ¯òŖĿŻŗ !&ƪƫŽ B~|
—N¹-&ŀ%ijŠv&%nɐĈŠ%µ¬}Ǫý»òŖ´ŗ
ԃ78&G,@l,@&łŃŽn
4™78}&MNHG45Ö°2/pVW´¬«ûŴ›}Ôƴvƺƻ%´ŗ
!Œ%nB~|
ŽÔƒ&Ï(v'(â-ij"«"vN-G•=&œ1&̈̉ñòœķuƿǀ¯Ŗ´ŗ
Œò»
)
Ö&Ŕ&́̚¯v°%ţŦñ°ŗ
!ò»ŽºvûDZ"D¹µ¬°ŽˡƂ%/p¯Ŗ´ŗ ‚OKn“”n !¯2nN-G
´ƚ2Ž4™78}&
Ö&MNHG45ȺȻ¯Ŗ´ŗ
l‚S-KE-Ž°ţÖŔ&N-GŖœˢŖ´ŗ
ñ»nB~|
&
)
Ö&345Žƣ˄¯2°Ŗ´
Æʹ°ǯǎ¯2°¬Œ}Ç
ŗ
!ò»w̪š"Œ}Ŕnǯǎ¯2š"Œ}Ŕnšľv°Œ}Ŕ%ÞŖ´ŗ
š"œ1nB~€ ǘ¬Ų’ŽµûŖĿŻŗ
b
µ¬°Žn
êl†45±Ƴš›2n‚OKdÓ´¬Œ}͂̓vŷĆn
µ¬°Žn345sKE-Ñ/}°"«û—NÑ/&ŷĆn
ë!»ţB~|
ŽƄ’%¯Ƌ"ŗ
¯º¯nǂŤv̫¿Ěǹ%78MNHG45Ǫý¬Œ}sn
«ûȱȲv345&ŞȷǍǎÖŒ}Ž=>%ÞŖ´ŗ
b -.~QM
Žn‚OKdÓ´¬ ) Ö&ēĔsµûŖ´ŗ
ş
bµ¬°Ž êl†45±Ƴ&Į£ f -,D-vêl†45ŗ
ş
B~€ &Į£ f -,Ovêl†45ŗ
žſv345%Žn-,D-vêl†45ŗ%ɧÁ%´ŗ
©C©
g
‚OK}l‚S-KE-
}2ŔÔƴv345Žnŷǧż2Ɲēš£¯Ŗ´ŗ
!òɇò&ŗŽn!òɇò&LjØŔˊØŔµûŖ´ŗ
b 1 Õ.égƒ;<%•#
-,D-vŗŽn
w×&Ò­&Ý°œȎ=ŠvM¹&§¨
Æ
Ç
º»
ƣƤn§¨}¯2²¬l&¤FșdÓ¯Ŗ´ŗ
êl†45±ƳŽnŠ&‚sM¹&Ú-%µ›œº}°"Œ}śén
345«›2ƀÕñòœŠ&«"vƪƫŔŹţȾ¯ŖĿŻŗ
ŒòŽnG45-êÂÚF<s‚OKƔ1vŨòũv»v°Œ}sµ¬Œ}ƬȘ
¯2°Ŗ´ŗ vȖv»n!ò»ŦŨs345&ǹǰ&ƪƫGE-%Þ¬º»%´ŗ
ŒòŽ b êl†45±Ƴš£¯œ‚OK&è%´ŗ
<navigation-rule>
<from-view-id>/numberGuess.jsp</from-view-id>
<navigation-case>
<from-outcome>guess</from-outcome>
<to-view-id>/numberGuess.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>win</from-outcome>
<to-view-id>/win.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>lose</from-outcome>
<to-view-id>/lose.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
ŒòŽ êl†45±Ƴš£¯œ‚OK&è%´ŗ
<page view-id="/numberGuess.jsp">
<navigation>
<rule if-outcome="guess">
<redirect view-id="/numberGuess.jsp"/>
</rule>
<rule if-outcome="win">
<redirect view-id="/win.jsp"/>
</rule>
<rule if-outcome="lose">
<redirect view-id="/lose.jsp"/>
</rule>
</navigation>
</page>
êl†45±Ƴsɏɐ˼ˢ¬}Ǫý¬v»ũn
G45-êÂÚF<º»ƣƤnl€ĺ´Œ}stu%´ŗ
public String guess() {
if (guess==randomNumber) return "/win.jsp";
if (++guessCount==maxGuesses) return "/lose.jsp";
return null;
©C©
h
‚OK}l‚S-KE-
}
ŒòŽnĕMDG&§¨%µ¬Œ}ƮƬţŦñ°ŗ
ĕMDGŀš£´¬âHÂNƓd´¬Œ}Ŕtu%´ŗ
public String search() {
return "/searchResults.jsp?searchPattern=#{searchAction.searchPattern}";
}
-,OvŗŽn
Ò­&Ý°œȎ=Šv345&ƪƫç%.Œ¬Āā&×ØĆľĿdÓ¯Ŗ´ŗ
Œ&ŗ%ŽnB~€ ‚OKdÓŀnŠ&«"v78MNHG45&OKĚǹŔtu%µûn
MNHG45&OKŹţǘ»v°G45-êÂÚF<ɆţŒ}Ŕtu%´ŗ
ŒòŽ B~€ š£¯œ‚OKdÓ&è%´ŗ
<pageflow-definition name="numberGuess">
<start-page name="displayGuess" view-id="/numberGuess.jsp">
<redirect/>
<transition name="guess" to="evaluateGuess">
<action expression="#{numberGuess.guess}" />
</transition>
</start-page>
<decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
<transition name="true" to="win"/>
<transition name="false" to="evaluateRemainingGuesses"/>
</decision>
<decision name="evaluateRemainingGuesses" expression="#{numberGuess.lastGuess}">
<transition name="true" to="lose"/>
<transition name="false" to="displayGuess"/>
</decision>
<page name="win" view-id="/win.jsp">
<redirect/>
<end-conversation />
</page>
<page name="lose" view-id="/lose.jsp">
<redirect/>
<end-conversation />
</page>
</pageflow-definition>
©C©
k
‚OK}l‚S-KE-
ŒŒ%n´ʲȾʔţ ) Ö&Œ}sµûŖ´ŗ
ş
b½ êl†45±ƳŽn«û žſ%´ŗ Ưº¯nŒòŽn̈́̏}v¬
;<s«ûÔƴä%µ¬}°"Ɂ'µ°Ŗ°¯2°Ŗ´ŗÇ
ş
B~€ Žn~
ĝ
C
ʽʾn78MNHG45&=>s%ÞŖ´ŗ
C
;<ƃ¬Ų’svţn
!òǤý2n-,OŗŽnŔ›}
͊
%´ŗ
ŚȎ=Švƪƫ
Ɓ‚OK&Ś-,FÇ
“¯2ĩ&ƪƫĀātuvÍñòœ×ØĆľĿsµûŖ´ŗ
-,D-ŗŽn<‹FGv
ŗ%´ŗ
!òŽn345%Žvţn
ǢȜŠĂ&v°n78sŧ(ޜ°}ŒȅƔ1¬OO¶‡êl†45ǃ¯2
°Ŗ´ŗ
-,O
½
-,D-êl†45&ɔįŽn
ʟ¡ŠvÅĕ
½
ÅĕD-MNHG45&Ǫýē}}2Ŕ«ţʛ2°Ŗ´ŗ
ñ2n345Åĕvɸ¬ɹ°º»ʗʘ´¬Œ}Žn
“”ÕÖ
Ö&Ơv=ȍ%´sn
345Žn
ĻļnſȩvƬȘ%&Åĕ%ŽµûŖĿŻŗ
¯º¯n
345Žn
Ğdv“”D¹%nÅĕtu%µûn¯ũ¯ũ!"%´ŗ
Åĕvɸ¬ɹ°Žn
tuvȃûʗʘ¯œŔ&}¯2ǘ»ò2°Ŗ´ŗ
78s¯œ°Œ}&ËŽŒͅ´¬Œ}Žn}2ŔȞǖ%´ŗ
¯º¯n-,Oŗ&¸ǰƬÓsµ¬&Ž̦"͇͆ŽµûŖĿŻŗ
) Ö&ŗ&šǕ&DZ°Žn þ¬ÿN&ɸ¬ɹ°%´ŗ
b1 w ú©ûP%
©C©
)o
‚OK}l‚S-KE-
b
µ¬°Ž
êl†45±Ƴsš£ñò2°¬ŷĆn
Žn78þ¬nŕĢnĸ®ÿN&¼ȍvêl†45tu¯Ŗ´ŗ
ŒòsǶ²¯œ}Þn
qĥŠv“”ƪƫ&wɖĬƀÕ´¬Œ}Žn
345&˯˟%´ŗ ĝ ]`]ö &«"v“”Å—R¯v° ]^
345OD‡ðGn !¯2n^ -,D-EF45 ĝ YJ ef
_ö
&«"v-,D-;RSŗ&×ØĆľĿ&ǐǑŽn
ƾţ&ôǶĨŒò´¬Œ}Žnź}ŻŠƄtu%µ¬Œ}͈ý2°Ŗ¯œŗ
¯º¯n
&;,Ã-%&ǐǑº»n
-,OEF45
͉ÝŨ»òœǂŤv“”Å—sµ¬}Œȅ%Žn
!òŽ'ę}2Ŕžſ%´ŗ
Ļļn!òŽnG45-êÂÚF<&š0n
no-conversation-view-id
ï,45}
[[
PFG&š£×ĆľĿ¬ȰƂžſ%´ŗ
ɟœnjŽnOO¶‡êl†45&RŽn
źȉ°ÖŔ’ƕñò¬Ŕ&}Ǫý2°Ŗ´ŗ
Œ&ŷĆnno-conversation-view-id&ƎƏŽ
“”ŀ&Dĕ™ñòœ‚º»&G?-&ŷĆn
ɂv¬‚ĕMDG¯2n!&“”Ž¸ǰ¯2°v°Œ}
ʋý¬Œ}vûŖ´ŗ
pages.xml%(°Ŗ´ŗ
<page view-id="/checkout.xhtml"
no-conversation-view-id="/main.xhtml"/>
wēn-,Oŗ%Žn
þ¬ÿNʈ´Œ}Žn­&ƪƫǵ&ƖdÓvĀā}¯2ŀįñòŖ´ŗ
vȖv»n-,OŗŽn
ǹǰ&ƪƫº»&Āā&×ØĆľĿLjĂ¯Ŗ´ŗ
-,Oŗ%Žnþ¬ÿNŽn—O¶%ȳî%´ŗ
Ž̹˼Šþ¬ÿN&š£¥ǘ¯n
­&
Ÿɩ°Ÿ
‚º»&G45s'(ñò¬&–KFG¯n
!¯2nſȩnŸǹǰ&Ÿ
‚ĕMDG¯Ŗ´ŗ
Æ!¯2ne
ÂFE‚Ěz¯Ŗ´ŗÇ
ŒòĞȬ}Ǫý¬ºnµ¬°Žn-,Oŗ&Í}Ǫý¬ºŽn
345ôǶĨ}¯2&ɀNJŧ͊%´ŗ
78}¯2ŽnŒ&ĞȬŽMHMHñĿ»ò¬ºŔ¯òŖĿŻŗ
Ğd&‚º»&
back="enabled" cd«ûn þ¬ÿNêl†45tu}´¬Œ}Ŕ%ÞŖ´ŗ
<page name="checkout"
view-id="/checkout.xhtml"
back="enabled">
<redirect/>
<transition to="checkout"/>
<transition name="complete" to="complete"/>
</page>
ŒòŽncheckout ƪƫ º»ś­&Š&ƪƫ %Ŕþ¬ÿN%&Āāstu%´ŗ
ŔnjȅŻn‚OK&Dĕ™ñòœ‚º»&G?-&ŷĆŔn
ɂv¬‚ĕMDG¯2n!&‚OK%&“”Ž¸ǰ¯2°v°Œ}
dÓ¯vŨòũvûŖĿŻŗŒ&ŷĆnno-conversation-view-id
&ƎƏŽn‚OKdÓ%(°Ŗ´6
<page name="checkout"
view-id="/checkout.xhtml"
back="enabled"
no-conversation-view-id="/main.xhtml">
©C©
)
‚OK}l‚S-KE-
<redirect/>
<transition to="checkout"/>
<transition name="complete" to="complete"/>
</page>
'ęnŠnj»&êl†45ŗŔn!ò͋ñľ¯°ŷǧsµûŖ´ŗ
°ÖnŠnj»&ŗs͋ñľ¯°ºŽn´ʲ=>%Þ¬«"vûŖ´ŗ
b1 xy}Ÿ ~QM.˜¡
b1 ~QM.`a
&
B~|
‚OKdÓ&ŷǧƓz´¬Ų’sµûŖ´ŗ
cdƓd´¬Œ}s%ÞŖ´ŗ
ŋŌ&;RSM-¯n
Œ&
components.xml

<bpm:jbpm>
<bpm:pageflow-definitions>
<value>pageflow.jpdl.xml</value>
</bpm:pageflow-definitions>
</bpm:jbpm>
š0&(% B~| cd¯2nŧ B~€ ¹-&‚OKƓd¯2°Ŗ´ŗ
b11 ~QM.ó§
@Beginn
µ¬°Ž
ï,45š£¯2KE-dÓ&Ò­Ɠd´¬Œ}«›2
¹-&‚OK ŸôªŸ ¯Ŗ´ŗ
@BeginTask
@StartTask
B~€ @Begin(pageflow="numberguess")
public void begin() { ... }
Ŕ¯ţŽnYJZ[š£¯2‚OKôª%ÞŖ´ŗ
<page>
<begin-conversation pageflow="numberguess"/>
</page>
OPƛ&琁‚OKôª´¬ŷĆn ő èýũ @Factory ŖœŽ
@Create
ÂÚF<&Ĉç
ő
ɟǸŽ·Dĕ™ñò2°¬‚°¬}ǪýŖ´ŗ
!¯2n
$V&&«"n
‚OK&š0&ï<}¯2
<start-page>
ï<š£¯Ŗ´ŗ
RENDER_RESPONSE
¯º¯n‚OKsG45-êƭìƗ¯&§¨}¯2ôªñò¬ŷĆn
G45-ê&§¨
Æ
Ç
ŽnDĕ™ñò¬š0&‚Ɣd¯Ŗ´ŗ
Œ&ŷĆn‚OK&š0&ï<}¯2 <start-state> š£¯n !òɇò&tuv§¨
Æ
Ç &œ1ĀāƎƏ¯Ŗ´ŗ
<pageflow-definition name="viewEditDocument">
<start-state name="start">
<transition name="documentFound" to="displayDocument"/>
©C©
))
‚OK}l‚S-KE-
<transition name="documentNotFound" to="notFound"/>
</start-state>
<page name="displayDocument" view-id="/document.jsp">
<transition name="edit" to="editDocument"/>
<transition name="done" to="main"/>
</page>
...
<page name="notFound" view-id="/404.jsp">
<end-conversation/>
</page>
</pageflow-definition>
b12 ~îCwüý
Ś <page> ï<Žn4-,‡s78Ūūȏ›2°¬ƪƫĚ¯Ŗ´ŗ
<page name="displayGuess" view-id="/numberGuess.jsp">
<redirect/>
<transition name="guess" to="evaluateGuess">
<action expression="#{numberGuess.guess}" />
</transition>
</page>
Ž b l€%´ŗ <redirect/> ’ȀŽn b êl†45±Ƴ& <redirect/>
}͏p£n
ÖŖûn–Hœ8&ĸ®ÿN&ƺƻ>Ɣ´¬œ1n
Yfmf
(°Ŗ´ŗ Æ Žn –Hœ8&ĕMDG͌ý2“”;,Ã-ʋʌ¯Ŗ´ŗ
ű›2n%ŽnI`à I[ -NM& Ÿe[mŸ &‘ʝŽƄ’%´ŗÇ
view-id
ĀāҎnnumberGuess.jsp
ë°2n
ÿN
µ¬°ŽnGGFG´¬Œ}«›2./ñòœ b §¨ Æ
Ç &Ò­%´ŗ
<h:commandButton type="submit" value="Guess" action="guess"/>
ĀāsnŒ&ÿNGFG´¬Œ}«›2./ñò¬}ސn
numberGuess
;RS&
guess
()
ÂÚF<}ƭìƗ´Œ}«›2n
B~|
ŽnĀā&G45./¯Ŗ´ŗ
B~€ ë°2G45Ɠd´¬œ1šľ¬4NFG-Žn b ^ ¿}«ţʛ2°¬Œ}n
!¯2nĀā&G45̜<HŽn njƋ"Šǹǰ& ;,Ã-ëŨ¬ ;RS&ÂÚF<%µ¬Œ}ơƬ¯2ţŦñ°ŗ
ű›2nb
M¹&œ1·Õ›2°¬Ŕ&}nnjƋ"ŠÍ
B~|
M¹&ŗÕnjŖ´ŗ
Æwɖ¯œ˔Ƴ Æ*m  ʭ e ee Y
Y[ÇÇ
[[%&
&ŷĆ
Æèýũnaction
sdÓñò2°v°;¤<ÿNÇn
Ŕ¯nÒ­&v°Āāsµ¬v»ũn
ŽĀā´¬œ1&4™êɍûŖ´ŗ
µ¬°ŽnŔ¯n´ƚ2&ĀāsÒ­ÕÖv»ũnſȩ‚ƲĚz¯Ŗ´ŗ
ű›2n‚OKǙ¯ſȩä%ÞnŒ&ÿNŽ
<h:commandButton type="submit" value="Guess"/>
śŜ&Ò­&v°Āā%&G45'(¯Ŗ´ŗ
<page name="displayGuess" view-id="/numberGuess.jsp">
©C©
)+
‚OK}l‚S-KE-
<redirect/>
<transition to="evaluateGuess">
<action expression="#{numberGuess.guess}" />
</transition>
</page>
ÿNG45ÂÚF<ƭũĿ¬Œ}Ŕtu%´ŗ
sĀāƔd¯Ŗ´ŗ
Œ&ŷĆnG45§¨
Æ
Ç
<h:commandButton type="submit" value="Guess" action="#{numberGuess.guess}"/>
<page name="displayGuess" view-id="/numberGuess.jsp">
<transition name="correctGuess" to="win"/>
<transition name="incorrectGuess" to="evaluateGuess"/>
</page>
¯º¯nŒòŽ˽&̗°-NMŦ}ǪýŖ´ŗ
vȖv»nOKĂă&˯˟‚OKdÓ&éˬ&ĩ&;RSā/¯2°¬º»
%´ŗ ‚OKŋŌ´¬Œ}!ò¼ȧȡŀ´¬Œ}Žn«ûƷ°Œ}%´ŗ
b1S QM.þÿ
Ļļn‚OKdÓ´¬}ÞnB~€ ï<sŲ’%´ŗ
«ûLjūvķuŽ°ûŖĿŻsn
<decision>
<decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
<transition name="true" to="win"/>
<transition name="false" to="evaluateRemainingGuesses"/>
</decision>
—4‚5Ž ;,Ã-ŀ%Ž b ^ ¿«›2ȢȣñòŖ´ŗ
b1[ QM.Āā
<end-conversation>nŖœŽn@End
š£¯2“”Ąą¯Ŗ´ŗ Æ'ęntıĬ&œ1nƝē
&š£ȿ1Ŗ´ŗÇ
<page name="win" view-id="/win.jsp">
<redirect/>
<end-conversation/>
</page>
Ċ45}¯2ntransition ÒƓd¯2nN-GĄą´¬Œ}s%ÞŖ´ŗ Œ&ŷĆn
Žl‚S-KE-ë°2ǹǰ&N-GĄą&ħ˾ɍ¬%¯Ƌ"ŗ
<page name="win" view-id="/win.jsp">
<redirect/>
<end-task transition="success"/>
</page>
b1^ ~QM.Ă° ăăă
ԃ&‚OK&Ć³ĝn
Ö&‚OKs'(ŀŔ"
Ö&‚OKwÎȐŁñĿ¬Œ}stu%´ŗ
©C©
)Q
‚OK}l‚S-KEï<Žéˬ&‚OKwÎȐŁñĿn Ò­ÝÞ&‚OK&'(ôªñĿŖ´ŗ
<process-state name="cheat">
<sub-process name="cheat"/>
<transition to="displayGuess"/>
</process-state>
qˬ&OKŽ
<start-state>
ï<«û'(ôª¯Ŗ´ŗ
ï<ǷǸ¯œ}Þn
qˬ&OK&'(ŽĄą¯Ŗ´ŗ
’Ȁ«›2dÓñò¬Āā%éˬ&OK&'(sƲôñòŖ´ŗ
!òs
<end-state>
<process-state>
b2 -.gU4&MI4“D
l‚S-KE-ŽnŦò
Æ_mÇ
sN-G'(´¬Œ}s%Þ¬ºn
°Ö
Æ_mÇ
N-G'(´ƚÞº}°"ǂŤvű›2n
78nµ¬°ŽnÚOœP&4-,‡«›2'(ñòvŨòũv»v°ǂŤvN-G&ȡ
Ć%´ŗ
B~|M,G™D45Žn78N-G-Ěz¯n!ò»&N-G•=´¬Œ}
rƱ¯Ŗ´ŗ ŽŖœ BUSINESS_PROCESS ;,Ã-ŀ&l‚S-KE-ŋŌ´¬n
ƪƫ345ƀ•ñĿn B~| ȃǐȍ%!&ƪƫijäñĿŖ´ŗ
&Ĥľûn<task-node>
ï<ÕÖśén
žſvl‚S-KE-dӎ‚OKdÓ}źȉ͏%µ¬«"ƃýŖ´ŗ
Æwɖ¯œ˔Ƴ Æ*m  ʭ e ee Y
Y[ÇÇ ɐĈç&l‚S-KE-ë°2n
ȏnjƪƫŽn4-,‡sn78sK™M¯nN-G'(´¬&ȏ›2°¬}Œȅ%´ŗ
<page>
<process-definition name="todo">
<start-state name="start">
<transition to="todo"/>
</start-state>
<task-node name="todo">
<task name="todo" description="#{todoList.description}">
<assignment actor-id="#{actor.id}"/>
</task>
<transition to="done"/>
</task-node>
<end-state name="done"/>
</process-definition>
©C©
)\
‚OK}l‚S-KE-
͏K‚PG&ŀnB~€ l‚S-KE-dÓ}n
B~€ ‚OKdÓÕÖŒ}Žtu%´ŗ !"%µòũn) Ö&ŋʂŽ l‚S-KE-ŀ&
<task>Ž ‚OK <process-definition>ŹȔ}wʄ¯Ŗ´ŗ
bS xy}Ÿ gU4&MI4aÒ.˜¡
bS &MI4aÒ.`a
B~| cd¯n!&B~|l‚S-KE-dÓ&ŷǧƓz´¬Ų’sµûŖ´ŗ
<bpm:jbpm>
<bpm:process-definitions>
<value>todo.jpdl.xml</value>
</bpm:process-definitions>
</bpm:jbpm>
B~|
KE-Ž345sƲ./¯2ŔijŠ%´ŗ
͍£ʼnŇ%
š£´¬ŷƐ345./´¬œìKE-dÓcd¯œţŽv°%¯Ƌ"ŗ
!&œ1n͍£ʼnŇ%Ž
&éˬ
B~|
&œ1&—KMÐ=ŽƄ’%´ŗ
ÖŖûn345&—KMΐ
components.xml
º»KE-dÓM-´¬ŦŨ%´ŗ
bS1 "KP}.7Ąâ
°Ö%ŔǹǰK™M¯2°¬78ǘ›2°¬Ų’sµûŖ´ŗ B~| Žn
} JY
«›2n78ɼƐ¯Ŗ´ŗ
actor
}ƭũò¬×ØÙØ
;RSš£´¬Œ}«ûn ǹǰ& Ɠd¯Ŗ´ŗ
@In Actor actor;
public String login() {
...
©C©
)a
‚OK}l‚S-KE-
actor.setId( user.getUserName() );
actor.getGroupActorIds().addAll( user.getGroupNames() );
...
}
bS2 gU4&MI4.7Ąâ
l‚S-KE-M-N-0Ĉä´¬œ1Žn
ï,45š£¯Ŗ´ŗ
@CreateProcess
@CreateProcess(definition="todo")
public void createTodo() { ... }
Ŗœn YJZ[š£¯2l‚S-KE-&0ĈäŔ(ýŖ´6
<page>
<create-process definition="todo" />
</page>
bSS P4Ką÷‚9
KE-sN-Gï<ǷǸ¯œ}ÞN-GM-N-s²³ñòŖ´ŗ
Œò»Ž78ŖœŽ78™ĉû…2vŨòũvûŖĿŻŗ
Žn̜<;—@™´¬Œ}Ŕn ;RS͎͏´¬Œ}Ŕ%ÞŖ´ŗ
<task name="todo" description="#{todoList.description}">
<assignment actor-id="#{actor.id}"/>
</task>
Œ&ŷĆn
N-Gĉû…2¬Œ}Ŕ%ÞŖ´ŗ
ſȩǹǰ&78N-Gĉû…2Ŗ´ŗ
<task name="todo" description="#{todoList.description}">
<assignment pooled-actors="employees"/>
</task>
bS[ P4K!4
°ţÖº&×ØÙØ
;RS«ûN-G-&ĚzsrƱv›2°Ŗ´ŗ
pooledTaskInstanceList
Žn
78s¼Á¼ȧĉû…2¬Œ}s%Þ¬ñòœN-G&-%´ŗ
<h:dataTable value="#{pooledTaskInstanceList}" var="task">
<h:column>
<f:facet name="header">Description</f:facet>
<h:outputText value="#{task.description}"/>
</h:column>
<h:column>
<s:link action="#{pooledTask.assignToCurrentActor}" value="Assign" taskInstance="#{task}"/>
</h:column>
</h:dataTable>
<s:link>
&ĤľûƯĻ& b <h:commandLink> Ŕš£tu%µ¬Œ}ƮƬ¯2ţŦñ°ŗ
<h:commandLink action="#{pooledTask.assignToCurrentActor}">
©C©
)g
‚OK}l‚S-KE-
<f:param name="taskId" value="#{task.id}"/>
</h:commandLink>
;RSŽn
pooledTask
ſȩN-Gǹǰ&78ĉû…2¬×ØÙØ;RS%´ŗ
;RSŽn
taskInstanceListForType
ǹǰ&78ĉû…2»òœĞdNM&N-GġŻ%°Ŗ´ŗ
<h:dataTable value="#{taskInstanceListForType['todo']}" var="task">
<h:column>
<f:facet name="header">Description</f:facet>
<h:outputText value="#{task.description}"/>
</h:column>
<h:column>
<s:link action="#{todoList.start}" value="Start Work" taskInstance="#{task}"/>
</h:column>
</h:dataTable>
bS^ P4K./0
N-G&pŘôªñĿ¬œ1n-êÂÚF<n
@BeginTaskš£¯Ŗ´ŗ
@StartTask
µ¬°Ž
@StartTask
public String start() { ... }
Ŗœn N-G&'( YJZ[ š£¯2ª1¬Œ}Ŕ%ÞŖ´6
<page>
<start-task />
</page>
Œò»&ï,45Žn
l‚S-KE-ŹȔŋ¯2ƬȘÕÖn
Ğğvȑˏ&“”ôª¯Ŗ´ŗ
Œ&“”«¬Ð=Žl‚S-KE-;,Ã-&ŀ%ƀÕ´¬ƪƫGE-%ÞŖ´ŗ
@EndTask
š£¯2“”Ąą´¬ŷĆn ŽN-G&ŸąMɍħ¯Ŗ´ŗ
@EndTask(transition="completed")
public String completed() { ... }
Ŗœn YJZ[Ŕš£%ÞŖ´6
<page>
<end-task transition="completed" />
</page>
YJZ[
 ^ ¿ š£¯2ĀāƓd´¬Œ}Ŕtu%´ŗ
Œ&ÎNJ%n
B~|
Žl‚S-KE-dÓȽɨˢn'(j(¯Ŗ´ŗ
Æ«ûÔƴvKE-ë°2Žn
KE-'(sƲô´¬­Ÿą´¬Ų’sµ¬N-Gsµ¬ºŔ¯òŖĿŻŗÇ
Ôƴvl‚S-KE-&•='ǹ´¬Śȑ&ƁƂvķu&ŹȔŠv‘’Ö°2Ž
©C©
B~|
)h
‚OK}l‚S-KE-
<ÃÂȺȻ¯2ţŦñ°ŗ
©C©
)k
c wƔRK ć!H;<é#¢JĈ%—
Ž ^ +o %ɒŪñò¬ C ~
#~ ë«ì ž`+ & ) Ö&šŔwʕŠv
C
£ijÃ,Gĭ“¯2˘̟vRƿǀ¯Ŗ´ŗ
ǫí&ƪƫ•=Ã,Gĭ«ûn
°ºv¬œP–345OD‡ðGº»ŔƁƂv I| ńĆ'ǹ¯Ŗ´ŗ
c ‹Œ8
Žn Ǯ͐Ĥ& C 345Ã,Gĭ&ʟ¡%µ¬-,D-Ĭ͑Ģ
ž`
‡&OH-D45º»²ŖòŖ¯œŗ
&ƪƫ•=Ã,GĭŽ˵ǔn
ijĬŋ´¬ƺƻ&>ƔƉŠ}¯2cȸñòŖ¯œ
ő
А̲ˋŠvH8G45&Ð=ŋŌ´¬ƺƻŗ
-3H–vĊHM345Žļ̲ˋŠvH8G45š£¯Ŗ´ŗ
ĎďD¹
ƗN¹-ċ*#Ç
&H8G45Žn
345sÏdz¯2°¬ˌǙƒ&GHMʸ&ØR´¬«"cȸñò2°v
°ȃûn
78&M,HG45-â¯ŖĿŻŗ
¯º¯n
ƉŠ}´¬źȉ´ƚ2&p؎ŖŴ78“´¬—N&ĚzŋŌ¯n
ŧǙ¯ʒò2͏—N&ĸ®ŋŌ¯2ÞŖ´ŗ
Œ&œ1n
ž`
Ž̲ˋŠvH8G45-⯜ij;,Ã-}°"ƉŠ“ż´¬«"cȸñòŖ
¯œŗ
Ȥʝvs»n
ĝ
^
+o
«ûś­&Đ-,D-đ}ƭũò¬Ã,GĭŽ̲ˋŠvH8G45Ěz´¬
œ1&޳‘ʝsµûŖĿŻ%¯œŗ
Œ&œ1n
ĤľûĎďvH8G45“¯2-;ñò¬ij;,Ã-ƿǀ¯2°Ŗ¯œŗ
…Ǐn 78}›2Žƺƻsƾţvûn ̃͒& LazyInitializationException }¯2 žf
`
ŋ´¬78º»&͓ȟŽšƾ}vûŖ¯œŗ
ŒŒ%Ų’v&Ž345Dž%̲ˋŠH8G45Ěz´¬Ş³‘ʝv&%´ŗ
^
+o
ŽŒ&ƺƻťɼ¯n
%-,Ov;RS
;RS&͔Ƶ“¯2-;ñò¬ȁȂij;,Ã-
Æ-,OEF45
`Ç
}°"ƉŠɒŪ¯Ŗ´ŗ
ŒòŽƺƻŋ¯2ŸŹvÚ45%ŽµûŖĿŻs Æ!ò¼ȔŽưĮv޳}v¬Ç n )
Ö&ƺƻsµûŖ´ŗ
ş
-,OEF45
&͔ƵŽœP–Dž%;<ǐȍ«ûɻpŘ%•=ñòvŨòũvûŖĿŻ
ÆŒòŽĎǠvƺƻ%µû'ꐎºvûȞǖ%µ¬Œ}sľºûŖ´Çŗ
`
ş
͏̲ˋŠH8G45q&-,O;RSç%&ij;,Ã-&ʋʌŽ
tu%´sžſ%ŽµûŖĿŻŗ
Žn
“”̥쓔“¯2-;ñò¬-,OEF45
`
;RSƿǀ´¬Œ}«û
ŽƉ&ƺƻ>Ɣ¯Ŗ´ŗ
©C©
+o
}Ċ–‚PGċD45ê¤Fș
Æź}ŻŠ&“”Ž'ꐎ—NDž%̲ˋŠH8G45Ěz¯Ŗ´ŗÇ
ij;,Ã-&ʋʌŲ’}¯v°«"vƾţ&4v345
Æ
–FٗÅvŠÇ
ŽŒò%ɧÁ%´ŗ
Ś“”q%͕ţp£¯µ›2°¬;RSƾţ՛2°¬«"vŔ"Ǚ¯Ôƴv3
45&ŷĆn
;RSʸŹȔǵ&ij;,Ã-&ʋʌŽƢ’vƺƻ}vûŖ´ŗ
Œ&œ1n
Ž
^
+o
&ij;,Ã-•=ŗȁȂ¯2“”-;&ȁȂij;,Ã-ƿǀ¯2°Ŗ´
ŗ
c1 “D
L%?K;<%
^ EF45 ` ŽƎƏ¡H8G45•=Ğɐ}¯2°Ŗ´ŗ ^ ;,êŽ `
sƭìƗñò¬}̹˼ŠH8G45./¯n
ƭƗ¯sĄą´¬}H8G45ŔĄąñĿ¬Œ}stu%´ŗ
b
G45-ê}¯2/p´¬EF45
`
ÂÚF<VW´¬ŷĆn
!&G45ŋŌ´¬´ƚ2&pŘ
Ö&H8G45%("Œ}s%Þn
G45&Ð=sŸą¯œ»ŲŴ;ĴFŖœŽK˜FGñò¬«"´¬Œ}s%ÞŖ´
ŗ
ŒòŽȀ͖»¯°ķu%µûn
°ţÖº&
345Ų’}ñò¬Ŕ&ŽŒòŦŨ%´ŗ
œŦ¯n
Œ&ēĔŽƺƻs
ÖµûŖ´ŗ
345Žſw&ÂÚF<;º»EF45
ǵ&G?-“¯2Ź—NGE-(ľv°tuĬsµûŖ´ŗ
`
ş
Œ&G?-Ž°ţÖº&̝§Ć;RS«¬Ð=Ų’}´¬ŷĆsµûŖ´ŗ
!òɇò&;RSs _` Džº»͗ƐƭìƗñòŖ´ŗ %ŽG?-Ȧ}
_` Džº» ^ ;RSǵ&;sԃµ¬&Ž«ţƃ»ò¬Œ}%´ŗ
ş
l&Dĕ™ŽŋŌ&ʒʓOPFsŲ’vŷĆsµûŖ´ŗ
G?-Ȧ}&H8G45ƒsƾţv¬}n
š£¯2°¬345sƾţ&ÏdzG?-Ð=¯2°¬ę!òŦŨƾţ&Ďď%
͗Ɛ&ƺƻɡɢ´¬tuĬsƁţvûŖ´ŗ
ɆÞÙØ/pŽ´ƚ2n
ŲŴn
͏H8G45q%.Œ»vŨòũv»v°º»%´ŗ
ž` 78ŽŒ&ƺƻʗʘ´¬œ1
Œ&âNŽĻļn
G?-ŹȔ-â´¬ſwH8G45}¯2'ƊñòŖ´ŗ
Œ&'Ɗ%Ž°ţÖº&ƺƻsµûŖ´ŗ
Ŕ›}ŔșĶ}v¬ƺƻŽn
H8G45;ĴF´¬Ŗ%!òs³øv&ºŠ"ºŹţŤť%Þv°Œ}%´
ő
œŦ¯n
Đlq&ĊEF45đH8G45s;ĴFñò¬«"v¬}n
lŽŸŹDĕ™ñò¬&%n
Dĕ™ñò¬D-R-Ž´%GHMOHF4ñò2°¬ŷĆsµûŖ´ŗ
78&H8G45s³ø¯vº›œŒ}78ǘ»Ŀ¬ŽŠ"¯œ»«°%¯
Ƌ"ºŗ
ŽH8G45͗Ɛ&ƺƻ}ŋŌOPF&ƺƻ&Ɲē>Ɣ¯vs»n
Đlq&ĊEF45đ%ƺƻʗʘ¯Ŗ´ŗ >ƔĔŽ ) ֐ÁŨ»òŖ´ŗ
©C©
+
}Ċ–‚PGċD45ê¤Fș
ş
H8G45“¯2-;ñò¬&%Žvţn
“”“¯2-;ñò¬ȁȂij;,Ã-š£´¬
ş
G?-“¯2
)
Ö&H8G45š£´¬n
ŽƉŽÅ—Ɯ&ĸ®OPƛ&ôªº»345ƭìƗ¯OPƛ&ĄľûŖ%-â
¯n ) ŽƉŽD-R-&Dĕ™OPƛ-â´¬
ŧ&EG45%Žn “”-;&ij;,Ã-&cdēĔÖ°2ɾǂ¯2°ÞŖ´sn
ŖŴš0 H8G45•=í¬ēĔɾǂ¯2ëţŲ’sµûŖ´ŗ H8G45•=v¯%“”-;&ij;,Ã-š£´¬Œ}s%Þn Ŗœ •=ij;,Ã-š£¯2°v°ŷĆ%Ŕ
H8G45•=Į£´¬}ưĮvŒ}sµ¬&%ƮƬ¯2ë°2ţŦñ°ŗ
œŦ¯n
Œ& ) Ö&ķuŽŌɺ¯2/p´¬«"cȸñò2°¬œ1n Ŋ£´¬ēsšǃ%´ŗ
J e[ C e àė J ^ +o fJ Yf
Z Y
[[à e[ e à C ^^ \ Cf
ņ à m _m à _[ fJ Y
Z
c1 } | J `[ `à e[ e [[ b Ė e à _ `[ m eņ à components.xml6
<core:init transaction-management-enabled="false"/>
<transaction:no-transaction />
c11  
YC J `
e `JJņ Jņ [[J
`
öņ à
mčJ _m à e[ *# f
Y m J _m ¢ |J YJ
^ e à
_öJ C ^^ \ Cņ à m[ [[ m ^ à
mč f
Y components.xml6
<transaction:ejb-transaction />
ž_Cņ e à _öJ ^^ \ ņ _[[ à m f
à
mč m ž_Cņ e `[ m à
mč ņ à à e à eJ e m e[[_J6
ş
~# I^AI¢^͘ ¢# _m m javax.persistence.EntityTransaction e
ş
ž` J _m m org.hibernate.Transaction e
ş
YJ
ş
^ZY[
[à `[ J _m
org.springframework.transaction.PlatformTransactionManager e
©C©
J
m
+)
}Ċ–‚PGċD45ê¤Fș
¢eJ ~# I^AI¢^͘ ¢# J `à J m e[[_J à f
YZ[ _m #{em} m e m persistence:managed-persistence-context Yf
e à J Y
Z entityManagerņ à Y [C m entity-manager ` Æ fJ Y
Z Ç
<transaction:entity-transaction entity-manager="#{em}"/>
* eJ ž` J [ m e[[_J à YZ[
_m
#{hibernateSession}
m
e
m
YB
ė
persistence:managed-hibernate-session Y e à J m` sessionņ à Y [C m session ` Æ fJ Y
f
Z Ç
<transaction:hibernate-transaction session="#{hibernateSession}"/>
* ZY[
[à `[ J [ m e[[_J à Yf
Z[6
<transaction:no-transaction />
b eJJ YJ J J YJ ~[e*
|Jf
c12 ĉĊ
*
à
mč YC [[`
ö e [ C m beforeCompletion() afterCompletion() à e[ņ ė _ àf
mč Y _m
m Ė ZY[
e m Y _m
J à
mč [[`
ö [à Z
e
C ^^ \ C m <transaction:ejb-transaction/> Y m[ ` ` f
[ components.xml m à
mč [[`
ö [à
[[ e m e ė ö_[J
c2 “D.deB%3À4
C
^^
\
ʼnŇ&é%š£¯2°¬ŷĆn
;,ꐫ¬ij;,Ã-&HMOMG&•=ŽĈȏ%ÞŖĿŻŗ
^^
\
ʼnŇ%µ›2Ŕn
ſw&“”&̟̠q%Ōɺ´¬ƾţ&̝§Ć;RSÕÖÔƴv345sµ¬
ºŔ¯òŴn
Œ&ŷƐŽ;RSç%&ij;,Ã-&ʋʌsžſ%Žvţ?HsǶ²¯ĝ´°
ŷĆsµûŖ´ŗ
°Ŵò&ŷĆ%Žn ;RS% J Y
Z Æ~# £Ç ŖœŽ J
ƞ`
£Ç
&°Ŵòºš£´¬Ų’sµûŖ´ŗ
•=ij;,Ã-ŽſȩlM& ;RS%“”;,Ã-% EntityManager ŖœŽ Session &M-N-•=¯Ŗ´ŗ @In %M‚PG´¬Œ}s%ÞŖ´ŗ
•=&ij;,Ã-ŽGH-NäñòœʼnŇ%īļîɓŠ%´ŗ
©C©
^
+o
++
}Ċ–‚PGċD45ê¤Fș
&ƞƟŽ;,ꐫ¬;,ê•=ȁȂij;,Ã-&š£ɋt¯v°šǃä
Ž'(´¬Œ}s%ÞŖ´ŗ
ï<ç&ij;,Ã-&ƪƫÔɮ´¬Œ}vţȁȂij;,Ã-&̹˼ŠvOP
Ċ˜R¯Ŗ´ŗ
ÆŒ&ƃ˼Ȧñò2¯Ŗ›œNJÖ°2Žn
ŧʗ&
^
ƞƟ&l‚5%˃Ţ¯œ°}Ǫý2°Ŗ´ŗÇ
c2 y+ - “D.deB%3À4
'˜¡±©
•=ij;,Ã-&cdŽžſ%´ŗ components.xml qŧ&«"VW¯Ŗ´ŗ
<persistence:managed-persistence-context name="bookingDatabase"
auto-create="true"
persistence-unit-jndi-name="java:/EntityManagerFactories/bookingData"/>
Œ&cd«û“”-;& bookingDatabase }°"Ò­& ;RSsp³ñòn
ù€ Ò java:/EntityManagerFactories/bookingData ÕÖij7ŎF ÆEntityManagerFactory
M-N-Ç & EntityManager M-N-&͔Ƶ•=¯Ŗ´ŗ
…Ǐn EntityManagerFactory s ù€ ˜œ<ñòœŒ}Ťť´¬Ų’sµûŖ´ŗ %Žn ŧ&Kâ,@cd persistence.xml ǣǤ´¬}Ťť("Œ}s%ÞŖ´ŗ
<property name="jboss.entity.manager.factory.jndi.name"
value="java:/EntityManagerFactories/bookingData"/>
Œò%ŧš£¯2M‚PGñò¬ EntityManager s%ÞŖ´ŗ
@In EntityManager bookingDatabase;
e à J ^+ ö à [ m @TransactionAttribute(REQUIRES_NEW)
m m Y
Z m[ė ` YYJ m [[ m `B
ž_C m fJ Y
Z YYJ à Yf
_m m Cņ _[[ ` YYJ m ö REQUIRES_NEW *mf
eņ e à ö m REQUIRES_NEW m à m[ m à J J
©~
¢Z
c21 “D. œ IJ;<%'˜¡±©
•= ž` EF45ŔÍƟcomponents.xml %ŧ&«"VW´¬Œ}s%ÞŖ´ŗ
<persistence:hibernate-session-factory name="hibernateSessionFactory"/>
<persistence:managed-hibernate-session name="bookingDatabase"
auto-create="true"
session-factory-jndi-name="java:/bookingSessionFactory"/>
java:/bookingSessionFactory
Ž
hibernate.cfg.xml
%Ɠdñò¬EF45OáGҐ¯Ŗ´ŗ
<session-factory name="java:/bookingSessionFactory">
<property name="transaction.flush_before_completion">true</property>
<property name="connection.release_mode">after_statement</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManage
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</proper
<property name="connection.datasource">java:/bookingDatasource</property>
©C©
+Q
}Ċ–‚PGċD45ê¤Fș
...
</session-factory>
ŽEF45OHF4¯v°&%n
hibernate.transaction.flush_before_completion
ļí2EF45s
*#
H8G45&;ĴF«ûʐ¼/ŠOHF4ñò¬«"¯vŨòũv»v°&%ơ
Ƭ¯2ţŦñ°ŗ
Œò%n ŧ&;<š›2
Session s%ÞŖ´ŗ
C
;RSM‚PGñò¬•=
ž`
@In Session bookingDatabase;
c22 “D.deB%3À4
wċČq‘
Ǻ͙š£¯œûn ŚG?-&Ɉɉ%—NƲK<¯œûn LazyInitializaĝ
NonUniqueObjectException
}‰͚¯vţ}Ŕn
“”-;ñò¬ij;,Ã-«û˜“¯2ԃ&G?--â´¬̲
ˋŠvH8G45K™H‡´¬Œ}s%Þ¬«"vûŖ´ŗ
merge()
tionException
̲ˋŠH8G45•=%Ž̲ˋŠKFG%H8G45&͛ɣ}wɖĬ'ǹ%Þ¬&
%n
ž`
}
^
+o
°ŴòŔ
@Version
ï,45ƿǀ´¬Œ}%̲ˋŠKFG&š£rƱ¯2°Ŗ´ŗ
—O¶%Žn
ij;,Ã-ŽŚH8G45&Ąľû%OHF4ñòŖ´
ƗN¹-}ÍĈñò¬Çŗ
ŒòsƉŠ&/p%µ¬ŷĆŔµûŖ´sn
´ƚ2&ÈĸŽÂŐƀÕñò“”sŢļĄą¯œ}ސ&ؗN¹-ɆÞÙŖò¬/
pĈȏ´¬Œ}&ēsƾ°%¯Ƌ"ŗ Œò«ûɬĎďv“”tu¯Ŗ´ŗ ^ +o
?Ã-â™&ŀ&
n
n
à`
śé&Ğd&˜«›2ɐĈŠvƃĻ¯Ǫ͜ŪòŴ̷͝ŠvƔdsvñò2¯Ŗ›œœ
1n
^
+o
ijš£¯œĎďv“”&'Ɗ("4%š£ǃ¯œRN–vēĔsǹǰµûŖĿ
Żŗ
œŦ¯n
ž`
%ŽƞƟ«ûdÓñò¬
FlushModeType
“´¬¹ĕȁȂ}¯2Œ&ķuƿǀ¯2°Ŗ´ŗ
Ŗœn
ĩ&¹ĕŔÞÍƟ&ȁȂƿǀ´¬Ŧȅ"Œ}Ĉȏ¯2°Ŗ´ŗ
%Ž“”&ôªÎ FlushModeType.MANUAL Ɠd´¬Œ}s%ÞŖ´ŗ ǹǰŽ ž`
sij'ǹ´¬Ş³’Ȁ%µ¬ŷƐ&Øķu¯Ŗ´sn
ĩ&Íɰ¹ĕ«¬ȁȂŔR´¬Œd%´ŗ
@In EntityManager em; //a Seam-managed persistence context
@Begin(flushMode=MANUAL)
public void beginClaimWizard() {
claim = em.find(Claim.class, claimId);
}
ù_ņ m claim `B
J `à m Y
Z e m m f
C ] ö mJ m [6
public void addPartyToClaim() {
Party party = ....;
claim.addParty(party);
©C©
+\
}Ċ–‚PGċD45ê¤Fș
}
œŦ¯n
Œò»&ÈĸŽǂzŠOHF4sǶ²´¬«"LjĂ´¬Ŗ%Ž—N¹-“¯2OHF4
ñòŖĿŻŗ
@End
public void commitClaim() {
em.flush();
}
e ņ à [ m flushMode MANUAL e YJZ[ņ e ZY[ CJf
[6
<begin-conversation flush-mode="MANUAL" />
cS y+ č•!ƒ
Ď'˜¡±©
MNOP-«û getDelegate() ÂÚF<˴¯2¹ĕǫí& #~
GE-´¬Œ}s%ÞŖ´ŗ ŲǏŠn ž` sšŔŋȌ&Ɓ°¹ĕ}vûn
org.hibernate.Session
sšŔLjū}v¬—†MNOP-vûŖ´ŗ
Œòśéš£´¬&sũºũº¯ţv¬źŠ%´ŗ ͞ƃȳ¯«°&% ¯2Ø2ţŦñ°ŗ
EntityManager
œŦ¯n
ž`
ŖœŽ!òśé&Ŕ&°Ŵòš£´¬ºȃ»Ŵn
°ŴòŽ
;RS%—†š£¯œţv¬ŷĆsţ¬%¯Ƌ"ŗ śŜ!&wèz¯Ŗ´ŗ
@In EntityManager entityManager;
@Create
public void init() {
( (Session) entityManager.getDelegate() ).enableFilter("currentVersions");
}
àY
Ž
C
Ə˛&ŀ%ŔçDZ°vţ͟ƴvŞĠv¬œ1n
%Þ¬ȃûʘŨ¬&swʕŠ%´ŗ
—†%IJǁ´¬Ɛ&ēĔŧz¯Ŗ´ŗ
ŖŴn
śŜ&( components.xml ǣǤ¯Ŗ´ŗ
<factory name="session"
scope="STATELESS"
auto-create="true"
value="#{entityManager.delegate}"/>
Œò%EF45ƣƤM‚PG%Þ¬«"vûŖ´ŗ
@In Session session;
@Create
public void init() {
session.enableFilter("currentVersions");
}
c[ ]|ďŸºœďŸ - ]Ÿ '˜¡±©Đđ
©C©
+a
}Ċ–‚PGċD45ê¤Fș
•=&ij;,Ã-š£´¬ŷĆĝ
@PersistenceContext
š›2;,ê•=&ij;,Ã-M‚PG´¬ŷĆn
Ž
EntityManager
ŖœŽ
Session
Ċ–‚PGKÃ4¯Ŗ´ŗ
Œò«ûn
^ ¿G?Ġ„dzq%ɦŹ͠Öš£´¬Œ}s%Þ¬«"vûŖ´ŗ
œ}ýũn
ŧƃ2ţŦñ°ŗ
User user = em.createQuery("from User where username=#{user.username}")
.getSingleResult();
$V&èŽn śŜ&è}ÍɰvûŖ´ŗ
User user = em.createQuery("from User where username=:username")
.setParameter("username", user.getUsername())
.getSingleResult();
…Ǐn ŧ&«"Žɶ“VW¯v°%ţŦñ°ŗ
User user = em.createQuery("from User where username=" + user.getUsername()) //BAD!
.getSingleResult();
Æîɓs̗ţn Ē M‚PG45ʧʨ“¯2ˉˊ}vûŖ´ŗÇ
c^ œ QG#P'˜¡±©
ž`
ǫí&͡®vķus
e[
vûŖ´ŗ
O@N«û—N¹-q&—NĚzĂȃʫý¬Œ}s%Þ¬«"vûŖ´ŗ
O@NÖ°2Ž
ž`
&<ÃÂ%Ȩãɾǂñò2°Ŗ´ŗ
ŒŒ%Žn
O@N
345ńĆ´¬žſvēĔVȆ¯2ëţ&s«°Ŧȅ"}ȶ°Ŗ´ŗ А #YY[
b_ö %"Ŗţ/p´¬ēĔɾǂ¯Ŗ´ŗ
•=&ij;,Ã-Žn
EntityManager
ĝ
ž`
Session
sŽ12p³ñòœ}ސíîñò¬«"dÓñòœO@N&wxsµ¬ŷĆsµûŖ´ŗ
ƅǏn ž` sij'ǹ´¬Ş³’Ȁ%µ¬ŷƐ&ؚ£%ÞŖ´ŗÇ
<persistence:filter name="regionFilter">
<persistence:name>region</persistence:name>
<persistence:parameters>
<key>regionCode</key>
<value>#{region.code}</value>
</persistence:parameters>
</persistence:filter>
<persistence:filter name="currentFilter">
<persistence:name>current</persistence:name>
<persistence:parameters>
<key>date</key>
<value>#{currentDate}</value>
</persistence:parameters>
</persistence:filter>
<persistence:managed-persistence-context name="personDatabase"
persistence-unit-jndi-name="java:/EntityManagerFactories/personDatabase">
<core:filters>
<value>#{regionFilter}</value>
<value>#{currentFilter}</value>
</core:filters>
</persistence:managed-persistence-context>
©C©
+g
f -. _ Q³„–!•;<%
D& b ë°2˜—45 Æ¥ƍÇ Žl%dÓñòŖ´ŗ
<h:form>
<h:messages/>
<div>
Country:
<h:inputText value="#{location.country}" required="true">
<my:validateCountry/>
</h:inputText>
</div>
<div>
Zip code:
<h:inputText value="#{location.zip}" required="true">
<my:validateZip/>
</h:inputText>
</div>
<h:commandButton/>
</h:form>
'ꐎn
—Nŗ&wĥ%µûn
Ŗœ—N¹--ä&dÓŹȔľœ›2¸ǰ´¬Ăź}ŻŠ&Đ¥ƍđsLjĂ'(´
¬œ1n Œ&ēĔŽĻļn €IŐ DZDz¯2¯Ŗ°Ŗ´ŗ Ž ž` [
š›2dÓñò¬Å—¹-&͐“´¬Rƿǀ¯2°Ŗ´ŗ
Location
GH-%ÍdÓ´¬}Œȅº»ª12ØŖ´ŗ
public class Location {
private String country;
private String zip;
@NotNull
@Length(max=30)
public String getCountry() { return country; }
public void setCountry(String c) { country = c; }
@NotNull
@Length(max=6)
@Pattern("^\d*$")
public String getZip() { return zip; }
public void setZip(String z) { zip = z; }
}
œ¯º$Vsޅ%´sn
'ꐎ
ž`
lM&Ŕ&šľŴL-N‡v͚"ēs-¤ºŔ¯òŖĿŻŗ
[
public class Location {
private String country;
private String zip;
@NotNull
@Country
public String getCountry() { return country; }
public void setCountry(String c) { country = c; }
@NotNull
@ZipCode
public String getZip() { return zip; }
public void setZip(String z) { zip = z; }
}
©C©
+h
%& b O¶‡˜—45
°Ŵò&ēĔ}¬¯2Ŕn
‚q%š£ñò¬˜—45&NMƓd´¬Ų’svţvûŖ´ŗ
b
Ĥľûn
<s:validate>
š›2ŗĊ–‚PG%dÓñò¬Ă“¯2˜—45("Œ}s%ÞŖ´ŗ
<h:form>
<h:messages/>
<div>
Country:
<h:inputText value="#{location.country}" required="true">
<s:validate/>
</h:inputText>
</div>
<div>
Zip code:
<h:inputText value="#{location.zip}" required="true">
<s:validate/>
</h:inputText>
</div>
<h:commandButton/>
</h:form>
ơV6 Œ&ŗ% @NotNull Ɠd¯2Ŕ;KƗǹñĿ¬&
sŲ’vţv¬}°"ľŨ%ŽµûŖĿŻŗŒòŽ
¥ƍÃ,Gĭ&ȃň«¬Ŕ&%´ŗ
Œ&ēĔŽÅ—$&ÍdÓ¯n
—8MĬÉò2°¬ŗŗ
l%ÍDZDz
Ěz
required="true"
b
¯Ŗ´
ő
¯º¯n š0&è}Ǣƚ2!òźŠɏɐĬs͕ɑñò2°¬ľŨ%Žv°&%n <s:validateAll>
š›2ØŖ´ŗ
<h:form>
<h:messages/>
<s:validateAll>
<div>
Country:
<h:inputText value="#{location.country}" required="true"/>
</div>
<div>
Zip code:
<h:inputText value="#{location.zip}" required="true"/>
</div>
<h:commandButton/>
</s:validateAll>
</h:form>
Œ&N™Žſȩ
<s:validate>
O¶‡q%&ŚŪūǣǤ¯Ŗ´ŗ
O¶‡sǕÞţv¬ŷƎn Ūū&ɻçºvûȇţŒ}s%Þ¬Œ}vûŖ´ŗ
ŒŒ%n
©C©
+k
%& b O¶‡˜—45
¥ƍs̺̻¯œŷƐ78“¯2O@<˜FGĚzñĿ¬œ1Ǭ»ºɻ˪œvŨò
ũvûŖĿŻŗ
ǹǰn
´ƚ2&ÂFE‚ŽO¶‡&Ɉɉ%Ěz¯2°Ŗ´ŗ
'ę(°œ°&Žn ?HÝŨ2O@<&}vûÂFE‚Ěz ÆD b
%tuÇn
O@<}H¹̜MHMñĿ2
ÆŒòŽƄtuÇn
Ö°%O@<&}vûǬºM‚ĚzñĿ¬ ÆŒòŔƄtuÇ Œ}%´ŗ Ŗœn
ŲųɁƈ&ŚO@<ŽH¹&}vû͢&Ý°œ-N-GĚzñĿœ°}¯Ŗ´ŗ
O¶‡&ŚO@<“¯2ºvûƾţ&ķuŲ’}¯2°Ŗ´ŗ
O¶‡µ¬´ƚ2&O@<!òɇò“¯2M‚nÂFE‚nŪūO@<&D
Mœĝ̜MHMƓd¯œ°}Žȶľv°%¯Ƌ"º»n
Ĥľû
e
[
,D%wʕŠvDMœƓd¯Ŗ´ŗ
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib">
<div>
<s:label styleClass="#{invalid?'error':''}">
<ui:insert name="label"/>
<s:span styleClass="required" rendered="#{required}">*</s:span>
</s:label>
<span class="#{invalid?'error':''}">
<h:graphicImage value="/img/error.gif" rendered="#{invalid}"/>
<s:validateAll>
<ui:insert/>
</s:validateAll>
</span>
<s:message styleClass="error"/>
</div>
</ui:composition>
<s:decorate>
š›2ŚO¶‡O@<Œ&,DġŖĿ¬Œ}s%ÞŖ´ŗ
<h:form>
<h:messages globalOnly="true"/>
<s:decorate template="edit.xhtml">
<ui:define name="label">Country:</ui:define>
<h:inputText value="#{location.country}" required="true"/>
</s:decorate>
<s:decorate template="edit.xhtml">
<ui:define name="label">Zip code:</ui:define>
<h:inputText value="#{location.zip}" required="true"/>
</s:decorate>
<h:commandButton/>
</h:form>
šŶn
78sO¶‡q(›œûƦœû´¬&ż2
š›2¥ƍÂFE‚ĚzñĿ¬Œ}s%ÞŖ´ŗ
I
mb
#BZ
<h:form>
©C©
Qo
%& b O¶‡˜—45
<h:messages globalOnly="true"/>
<s:decorate id="countryDecoration" template="edit.xhtml">
<ui:define name="label">Country:</ui:define>
<h:inputText value="#{location.country}" required="true">
<a:support event="onblur" reRender="countryDecoration" bypassUpdates="true"/>
</h:inputText>
</s:decorate>
<s:decorate id="zipDecoration" template="edit.xhtml">
<ui:define name="label">Zip code:</ui:define>
<h:inputText value="#{location.zip}" required="true">
<a:support event="onblur" reRender="zipDecoration" bypassUpdates="true"/>
</h:inputText>
</s:decorate>
<h:commandButton/>
</h:form>
‚$&Ƣ’v;KǂzŠv € dÓ´¬Œ}ŽƩŖ¯°-NM%´ŗ А A
£&¼/,-
[
vŠ&ŏÃFš£¯2(°œ°v»ũ¯œ°v»ũvë&Œ}ŗ
ǂzŠv
€
ʫýv°ŷĆnb
Ž!ò»²³¯Ŗ´sn‚$&ǬºÈĸ¯œv»ũ²³ñò¬ƜŔÈĸñòŖ´ŗ
<h:form id="form">
<h:messages globalOnly="true"/>
<s:decorate id="countryDecoration" template="edit.xhtml">
<ui:define name="label">Country:</ui:define>
<h:inputText id="country" value="#{location.country}" required="true">
<a:support event="onblur" reRender="countryDecoration" bypassUpdates="true"/>
</h:inputText>
</s:decorate>
<s:decorate id="zipDecoration" template="edit.xhtml">
<ui:define name="label">Zip code:</ui:define>
<h:inputText id="zip" value="#{location.zip}" required="true">
<a:support event="onblur" reRender="zipDecoration" bypassUpdates="true"/>
</h:inputText>
</s:decorate>
<h:commandButton/>
</h:form>
˜—45s̺̻¯œ}Þɂv›œÂFE‚Ěz¯œ°%´ºʙ
ÂFE‚˜<
Æ
ÂFE‚ŀ&
¿ĝlȦ}&ÂFE‚˜<&«"Éò2°¬
Ç
Ž
[«›2Į£tu%´ŗ
^ ž`
public class Location {
private String name;
private String zip;
// Getters and setters for name
@NotNull
@Length(max=6)
@ZipCode(message="#{messages['location.zipCode.invalid']}")
public String getZip() { return zip; }
public void setZip(String z) { zip = z; }
}
©C©
Q
%& b O¶‡˜—45
location.zipCode.invalid = The zip code is not valid for #{location.name}
©C©
Q)
i òÆĉ 
 Y
e I#€ ÆIY #YY[
€C[YÇ Y`[à ]m[ àà _m I#€ņ J [ m Y
à
[JJ A[ f
[àņ mJ à
[JJ _ Ė mJ Y[[à ee C[Yf
Y[e Æ C[Y Y[e _m e #~ J m à
_[ [J _ à [ [J
à C Ŭ
ŭ #~ àņ _m
m _[ ` [
öà
`
à _[ ` e
m YYà #~ à_àÇ €à
[JJ
`[ Y e m C [ |
mņ óCà ŬmY6½½JCà
mJŭ Yf
[ `ö m YY
m [
_ m à
[JJ _[ _m m C ^^ _[ `à [[à f
JJ `m à
[JJ [ m YY[
C[Y
m ` [ e m öņ _m Z _
mJ ]J à
Yf
Z
[à [ö _J J[ Y Ő m ņ m
#~ņ m CàmJ
i òÆĉ óCà J[ à
[JJ ` m C [JJ ` _m [ ef
Y `à ~àmņ I`à [[[ö *m Jm e óCà _e[6
ş
C àZ YY óCà6 C óCà ņ öJ m [J
C Cà m
ş
óCà `B
C `B
ņ óCà [ C [6 óCà Jf
m[à _m ZJ C [` e_ö
*€6 _ Ė
ö CC_ e m óCà àZ f
i1 \ òÆĉ
*m m à ` óCà `B
C `B
ņ à Cf
[[à _ à Yņ à [ e _m _mņ óCà Y[à Ő [ Z óCà [ C [ m YY[
i1 \ òÆĉ # à m[ mC `à _ņ mC[à óCà
`C e YY ž ZY[ e JCà YY[
i1 ]ĉ
@Entity
@Name("hotel")
class Hotel implements Serializable
©C©
Q+
óCà J
{
@Id @GeneratedValue
Long id
@Length(max=50) @NotNull
String name
@Length(max=100) @NotNull
String address
@Length(max=40) @NotNull
String city
@Length(min=2, max=10) @NotNull
String state
@Length(min=4, max=6) @NotNull
String zip
@Length(min=2, max=40) @NotNull
String country
@Column(precision=6, scale=2)
BigDecimal price
@Override
String toString()
{
return "Hotel(${name},${address},${city},${zip})"
}
}
óCà C[à YY m e YY ÆJ½Çņ m ZY[
[à _ C` J 6 m YC ZY[ņ m m[ [
` e C hotel.getCity()ņ m J `J J `à
m óCà Y[ *m àY e à
J ö m à Cà Yà J
m6 óCà ÆàÇ YY J
 JC
ee
e m m à [mY mC `[f àY e f
à m J^à ` e m YYY @*ToMany e Y[à J J
àY e [ö Collection<Entity> b m ņ
à
_ė
`
`[
`e
e
m
Cà
e[
¢mY
ņ
345OD‡ðG à *m J _ m YY e J
J e óCà ÆóCà ) m e _JÇ
i11 ]J Y óCà _à ee m C6 ö m [ Y
@Scope(ScopeType.SESSION)
@Name("bookingList")
class BookingListAction implements Serializable
{
@In EntityManager em
@In User user
@DataModel List<Booking> bookings
@DataModelSelection Booking booking
@Logger Log log
@Factory public void getBookings()
{
bookings = em.createQuery('''
©C©
QQ
óCà J
select b from Booking b
where b.user.username = :username
order by b.checkinDate''')
.setParameter("username", user.username)
.getResultList()
}
public void cancel()
{
log.info("Cancel booking: #{bookingList.booking.id} for #{user.username}")
Booking cancelled = em.find(Booking.class, booking.id)
if (cancelled != null) em.remove( cancelled )
getBookings()
FacesMessages.instance().add("Booking cancelled for confirmation number #{bookingList.booking.
}
}
i11 |
J m Y J _m óCà Ő _ óCà fJ
`
ö YB
_m à [ e
Ė ]m _J óCà
àņ Y[à Y[
à .groovy e[ src/model AYJ[àņ _m _J f
ņ Y[à Y[
à .groovy e[ src/action
i2 }ĉ
€Y[àJ óCà [ Cà m [ö Y[àJ C [ ÆYJ[àņ _ Y[à _m +f[ Y Y
e
YY [f[JJ
Y e_öÇ
à Y[àņ m m `[àņ C[Y ņ Y[à
C Y [ _m mCJ m YY[
ņ CJ [
e m C[Y ½ à
[ *m YY YC e óCà
Y _m m .groovy e[ Y[à
i2 }ĉ òÆĉ # óCà [ C [ņ _m `à
Y B [ö C [ *
Y[àņ óCà àņ óCà ` óCà Yņ Y[
Y à # YY
m m groovyc ö 
Y[ņ óCà [ _à ee m C [ m YY[
C _[[
m Ė[[à ù m m [[_ [ Z e óCà C i21 õÆ Æĉ ĉ Æ C[à YY m Y[à e .groovy e[ Æ _m Y[Ç [ mY[à ÆC[Y [àÇ *m `[ Cà e ½
à
[ * Y JCà Y[àņ e[[_ m eJ ććć Y[à à
óCà Æ.groovy e[Ç m WEB-INF/dev à *m óCà Y _[[
` Y
ö Y [[à _m m YY[
Æ `C[à m
©C©
Q\
óCà J
YY[
C mÇ
_ m m C JCà e[ Y[à ee m [ m Jf
[ mY[à6
ş
*m Y ` C óCà *mà ` ^+ `
ş
^ ` mY[à
ş
*m mfY[à`[ Y _[[ ` C`[ à [ Y[à e
WEB-INF/dev
ş
`J ` `[
i22 |
fJ Y[à YY óCà e[ Y[à Y[ *m [
m C .groovy e[ Y[à C[Y Æ
Y[f[Ç e à fJ YB
e àY ]#Iņ C óCà [ src/action _[[ [[à
` e m [ m Y[à e à Y
ņ m
óCà e[ _[[ Y[à ` Y[ `e Y[à
Ő _[[ e [C ZY[ e m öJ _ Y[[à óCà Yf
YJ [ m Y[à examples/groovybooking
©C©
Qa
"&!:;<%QH„ïK
ŽĞƐ&MNOP-ĝ-âGH-ȁȂ´¬Œ}vţnȩȪvCGH-ï,
45ÝV´¬Œ}«ûžſ345p³´¬Œ}sƗƦŖ´ŗ ¯º¯ncomponents.xml&cd
ÆžſvŷƐŽÇ
ĝķu&ȁȂ«ûƲĮ£´¬ɁsƗƦ¬·³&;RSƿǀ´¬Œ}«ûnëƔŖû
&K™H‡Ö°2ĸžſp³%Þ¬«"´¬Œ}sƗƦŖ´ŗ
Ž~#ĝž`š›œ—N¹-ǵ&GE-ŋľ
¬ĜˆŠvK™H‡&;<ɎǼɑ´¬Œ}sƗƦŖ´
345OD‡ðGŗ
Œ&OD‡ðGŽ=>ŔrƱ%nȁȂ¯Ʊţžſv°ţÖº&GH-º»Ş³ñò2°Ŗ´ŗ
;<Ɏɑ»¯œûn;<&ƲĮ£tu´¬Đ¤‚FGđŽ!&Ŕ&µûŖ´
ő
Œ&OD‡ðGšľvţ2Ŕ
345p³´¬}ސŽÍƟ&¤‚FGš£¯2°¬&%´ŗ
O%
MĒK;<%
Œ&OD‡ðG&ƿǀ´¬;RSŽn̐Ö&š°ē&°Ŵòº%Į£´¬Œ}sƗƦ
Ŗ´ŗ
%M-N-
cd¯2š£´¬
w֎nĩ&&×ØÙØ;RS%(›2°¬«"ncomponents.xmlēĔ%´ŗ
Ŝ&components.xml&cd
ÆĥÁÇ
%ŽContact?,@,@“´¬ĜˆŠv¢IA€ɕpM-¯2°Ŗ´ŗ
<framework:entity-home name="personHome"
entity-class="eg.Person"
entity-manager="#{personDatabase}">
<framework:id>#{param.personId}</framework:id>
</framework:entity-home>
Ŕ¯nŒòsĐå| K™HĴ™đ͞Ƣ¯2°¬«"ȶý2nƩØĆľvŨòũnĤûķ
uȁȂ¯2("Œ}ŔƗƦŖ´ŗ
@Stateful
@Name("personHome")
public class PersonHome extends EntityHome<Person> implements LocalPersonHome {
@RequestParameter String personId;
@In EntityManager personDatabase;
public Object getId() { return personId; }
public EntityManager getEntityManager() { return personDatabase; }
}
͊̐&ēĔ
Æķu&ȁȂš"Ç
ŽǕÞvÂF}¯2nžſȁȂ¯œûnqͣñòœķuĊ˜HM<´¬Œ}sƗƦŖ
´ŗ
ÆŒ&OD‡ðG&ƿǀ´¬GH-ŽnȁȂĝnL-N‡ä“ż%Þ¬«"nơƬșţp³ñ
ò2°Ŗ´ŗÇ
©C©
Qg
345OD‡ðG
Ŗœn͊ͤ&ÂF}¯2nGH-^&-,OEF45l}´¬Œ}sƗƦŖ´
ŗ ÆŲŴ^´¬Ų’ŽvţnƩØ%nDvCl}´¬Œ}ŔƗƦŖ´ŗÇ #
š£ñò¬ŷĆnQ))ó#µ¬°Ž!òśʶ&˜‚5sŲų%´ŗ
ǹÎNJ%n345OD‡ðGŽn¢IA€
}HibernateEntityHomen!òĒà&ͥ&EntityQuery
HibernateEntityQuery&ͦÖ&;RSƿǀ¯2°Ŗ´ŗ
£EntityHome
}
ž}ĒàŽEF45nM¹n!ò“”-;%ķu´¬«"p³ñò2°Ŗ´ŗ
Š&-;š£´¬ºŽn345&-,ŗÄ¸¯Ŗ´ŗ
345OD‡ðGŽs•=¯2°¬ijĬ;,Ã-%&Ø/p¯Ŗ´
ŗ —O¶%nentityManager}°"Ò­&ijĬ;,Ã-ͧ¯Ŗ´ŗ
1 œĆ”RK
GHÖ°
2Ǫý
2ØŖ
¯Ƌ"
žĊ–‚PGŽnĞd&?,@,@GH-“´¬ijĬɕpƿǀ¯Ŗ´ŗPersonŗ
@Entity
public class Person {
@Id private Long id;
private String firstName;
private String lastName;
private Country nationality;
//getters and setters...
}
;O@ßD45%nŜ&«"personHome;RSdÓ´¬Œ}sƗƦŖ´ŗ
<framework:entity-home name="personHome" entity-class="eg.Person" />
ŖœnķuȁȂ¯2Ŝ&«"nÍƟ&Œ}sƗƦŖ´ŗ
@Name("personHome")
public class PersonHome extends EntityHome<Person> {}
žĊ–‚PGŽpersist()n
Ö&ɕpƿǀ¯Ŗ´ŗ
remove()n
update()
!ò
getInstance()
&
Q
žŽb‚º»nŜ&«"ƣƤĮ£´¬Œ}sƗƦŖ´ŗ
<h1>Create Person</h1>
<h:form>
<div>First name: <h:inputText value="#{personHome.instance.firstName}"/></div>
<div>Last name: <h:inputText value="#{personHome.instance.lastName}"/></div>
<div>
<h:commandButton value="Create Person" action="#{personHome.persist}"/>
</div>
</h:form>
©C©
Qh
345OD‡ðG
Ŝ&«"w(Ǥý2n!
ĻļnPersonŽperson%ȺȻƗƦœēsưĮ%´&%ncomponents.xml&«"¯Ŗ¯Ƌ"ŗ
<factory name="person"
value="#{personHome.instance}"/>
<framework:entity-home name="personHome"
entity-class="eg.Person" />
Æ;O@ßD45š£¯2°¬ŷĆnÇ PersonHome  @Factory ǣǤ¯Ŗ´ŗ
@Name("personHome")
public class PersonHome extends EntityHome<Person> {
@Factory("person")
public Person initPerson() { return getInstance(); }
}
ÆķuȁȂ¯2°¬ŷĆÇ Œò%nŜ&«" b ‚&VWsžſvûŖ´ŗ
<h1>Create Person</h1>
<h:form>
<div>First name: <h:inputText value="#{person.firstName}"/></div>
<div>Last name: <h:inputText value="#{person.lastName}"/></div>
<div>
<h:commandButton value="Create Person" action="#{personHome.persist}"/>
</div>
</h:form>
Œò%nPerson&®¯°?p³´¬Œ}sƗƦ¬«"vûŖ´ŗ
Ž°nŒò%Ź2%´ŗ
ŧnĚznĸ®n!òǼƸķu·¸&—Nͨ¹-&
“ʎ&?Ğd´¬ɼƐXʋý
Person?ɕpǣǤ´¬œ1ŽnPersonHome¬Ų’sµûŖ´ŗ
Ŝ&«"n‚âHÂNš›2nŒò(°Ŗ´ŗ
<pages>
<page view-id="/editPerson.jsp">
<param name="personId" value="#{personHome.id}"/>
</page>
</pages>
ù_ _ m Z Y b YJ6
<h1>
<h:outputText rendered="#{!personHome.managed}" value="Create Person"/>
<h:outputText rendered="#{personHome.managed}" value="Edit Person"/>
</h1>
<h:form>
<div>First name: <h:inputText value="#{person.firstName}"/></div>
<div>Last name: <h:inputText value="#{person.lastName}"/></div>
<div>
<h:commandButton value="Create Person" action="#{personHome.persist}" rendered="#{!personHome.
<h:commandButton value="Update Person" action="#{personHome.update}" rendered="#{personHome.ma
<h:commandButton value="Delete Person" action="#{personHome.remove}" rendered="#{personHome.ma
</div>
</h:form>
p
e
r
©C©
Qk
345OD‡ðG
sonId
G?-âHÂN}¯2ț¯œŷƐŽnĐ~ʼȡđ}¯2‚sĚzñòŖ´ŗ
!&Ęͩ0Ĉä¯2p³¯vŨòũv»v°ŷĆǪý2ØŖ¯Ƌ"ŗŒòŔžſƗ
PersonƦŖ´ŗ ;O@ßD45š"ŷƎͪ
<factory name="person"
value="#{personHome.instance}"/>
<framework:entity-home name="personHome"
entity-class="eg.Person"
new-instance="#{newPerson}"/>
<component name="newPerson"
class="eg.Person">
<property name="nationality">#{country}</property>
</component>
ŖœnķuȁȂ¯2("ŷƎŜ&ƟvûŖ´ŗ
@Name("personHome")
public class PersonHome extends EntityHome<Person> {
@In Country country;
@Factory("person")
public Person initPerson() { return getInstance(); }
protected Person createInstance() {
return new Person(country);
}
}
}°"žĊ–‚PG&•=Ŝ&Ċ–‚PG
ͫȎnCountryĊ–‚PGŽnèýũCountryHome}´¬Œ}ŔƗƦŖ´ŗ
Ú4?45&•=vŠn
«û̈̉ñòœɕp'ǹ´¬&Ŕ
ÂÚF<ǣǤ´¬ŦŨ%ƗƦ¬«"vûŖ´ŗ
PersonHome
@Name("personHome")
public class PersonHome extends EntityHome<Person> {
@In Country country;
@Factory("person")
public Person initPerson() { return getInstance(); }
protected Person createInstance() {
return new Person(country);
}
public void migrate()
{
getInstance().setCountry(country);
update();
}
}
*m ž `B
org.jboss.seam.afterTransactionSuccess C _m Æ [[ persist()ņ update() remove() Ç à `CJ m C _
em Ė _m m [àJ mJ e _ [à _ f
©C©
\o
345OD‡ðG
em Ė _m Y
[ à Yņ Y C _ `f
C m org.jboss.seam.afterTransactionSuccess.<name> C Æ_m <name> m e
m àÇ
žĊ–‚PGŽɕps³ø¯œ}ސ¼/ŠOP-ÂFE‚Ěz¯Ŗ´ŗ
ŒònL-N¤Mƛ´¬ŽnŜ&«";O@ßD45cd¯Ŗ´ŗ
<factory name="person"
value="#{personHome.instance}"/>
<framework:entity-home name="personHome"
entity-class="eg.Person"
new-instance="#{newPerson}">
<framework:created-message>New person #{person.firstName} #{person.lastName} created</framework:cr
<framework:deleted-message>Person #{person.firstName} #{person.lastName} deleted</framework:delete
<framework:updated-message>Person #{person.firstName} #{person.lastName} updated</framework:update
</framework:entity-home>
<component name="newPerson"
class="eg.Person">
<property name="nationality">#{country}</property>
</component>
µ¬°ŽnķuȁȂ¯2Ŝ&«"´¬Œ}ŔƗƦŖ´ŗ
@Name("personHome")
public class PersonHome extends EntityHome<Person> {
@In Country country;
@Factory("person")
public Person initPerson() { return getInstance(); }
protected Person createInstance() {
return new Person(country);
}
protected String getCreatedMessage() { return "New person #{person.firstName} #{person.lastName} c
protected String getUpdatedMessage() { return "Person #{person.firstName} #{person.lastName} updat
protected String getDeletedMessage() { return "Person #{person.firstName} #{person.lastName} delet
}
¯º¯nÂFE‚dӐëŨ¬šƷ&ēĔŽ ƗO¶%
“¯2·ǘ&Ú-˜<dÓ´¬Œ}%¯Ƌ"ŗ
messages
}°"Ò­&Ç
Person_created=New person #{person.firstName} #{person.lastName} created
Person_deleted=Person #{person.firstName} #{person.lastName} deleted
Person_updated=Person #{person.firstName} #{person.lastName} updated
Œ&ēĔšýũnĘę䐓ż´¬Œ}sƗƦŖ´¯n;<ĝ;O@ßD45OáM
}Dǡ,45Dž}úûɣ´Œ}sƗƦŖ´ŗ
šŶ&-,FŽ<s:validateAll>
š›2n‚˜—45ķuǣǤ´¬Œ}%´snŒòŽͬñŻǵ&ͭ
}<s:decorate>ƻ}¯2ëÞŖ¯Ƌ"ŗ
2 ďĉƔRK
&Ź2&M-N-&-sŲ’vŷĆnĒàĊ–‚PGš›2
©C©
\
345OD‡ðG
nŜ&«"´¬Œ}sƗƦŖ´ŗ
<framework:entity-query name="people"
ejbql="select p from Person p"/>
ŖœnŒò ÆŒ&§¨Ç b‚º»š"Œ}sƗƦŖ´ŗ
<h1>List of people</h1>
<h:dataTable value="#{people.resultList}" var="person">
<h:column>
<s:link view="/editPerson.jsp" value="#{person.firstName} #{person.lastName}">
<f:param name="personId" value="#{person.id}"/>
</s:link>
</h:column>
</h:dataTable>
Ɏ&ƾ°‚Ð=´¬ͥ‚™ŔŲ’%¯Ƌ"ŗ
<framework:entity-query name="people"
ejbql="select p from Person p"
order="lastName"
max-results="20"/>
Ěz´¬‚Ɣ1¬ͥ‚âHÂNš°Ŗ´ŗ
<pages>
<page view-id="/searchPerson.jsp">
<param name="firstResult" value="#{people.firstResult}"/>
</page>
</pages>
‚™•=´¬b&;<Žͮͯ͟ƴ%´snɋr̟̠q%´ŗ
<h1>Search for people</h1>
<h:dataTable value="#{people.resultList}" var="person">
<h:column>
<s:link view="/editPerson.jsp" value="#{person.firstName} #{person.lastName}">
<f:param name="personId" value="#{person.id}"/>
</s:link>
</h:column>
</h:dataTable>
<s:link view="/search.xhtml" rendered="#{people.previousExists}" value="First Page">
<f:param name="firstResult" value="0"/>
</s:link>
<s:link view="/search.xhtml" rendered="#{people.previousExists}" value="Previous Page">
<f:param name="firstResult" value="#{people.previousFirstResult}"/>
</s:link>
<s:link view="/search.xhtml" rendered="#{people.nextExists}" value="Next Page">
<f:param name="firstResult" value="#{people.nextFirstResult}"/>
</s:link>
<s:link view="/search.xhtml" rendered="#{people.nextExists}" value="Last Page">
<f:param name="firstResult" value="#{people.lastFirstResult}"/>
</s:link>
'£Šv¥¦-G%ŽnͰûŒŻŦ¥¦§¨ǁ¬œ1nƾţ&¥¦&GHM,7
8Ūū¯2Ŕ»"Ų’sµûŖ´ŗ
Œ&Ƣ’v7-3-R´¬ͥnĒàĊ–‚PGŽĊ45}¯2Ícd´
¬Œ}sƗƦŖ´ŗ
<component name="examplePerson" class="Person"/>
©C©
\)
345OD‡ðG
<framework:entity-query name="people"
ejbql="select p from Person p"
order="lastName"
max-results="20">
<framework:restrictions>
<value>lower(firstName) like lower( concat(#{examplePerson.firstName},'%') )</value>
<value>lower(lastName) like lower( concat(#{examplePerson.lastName},'%') )</value>
</framework:restrictions>
</framework:entity-query>
$V&è%ŽZY[Ċ–‚PG&š£Ö°2ƮƬ¯2ţŦñ°ŗ
<h1>Search for people</h1>
<h:form>
<div>First name: <h:inputText value="#{examplePerson.firstName}"/></div>
<div>Last name: <h:inputText value="#{examplePerson.lastName}"/></div>
<div><h:commandButton value="Search" action="/search.jsp"/></div>
</h:form>
<h:dataTable value="#{people.resultList}" var="person">
<h:column>
<s:link view="/editPerson.jsp" value="#{person.firstName} #{person.lastName}">
<f:param name="personId" value="#{person.id}"/>
</s:link>
</h:column>
</h:dataTable>
*
em
m
Ėà
_m
m [àJ
org.jboss.seam.afterTransactionSuccess C6
mJ
_
`C
m
<event type="org.jboss.seam.afterTransactionSuccess">
<action execute="#{people.refresh}" />
</event>
ņ B em m Ėà _m m Y à Yņ Y C
mJm PersonHome6
<event type="org.jboss.seam.afterTransactionSuccess.Person">
<action execute="#{people.refresh}" />
</event>
Ae[à Ēà `B
ė _ö _[[ _m B e
m Ė f m e YJf
_m m Ė ņ àė[[ mC Y[ à _ m
e [
[J m [ ` e [ Æ`à CJ getCountEjbql()
*m ZY[ m mC [[ m_ `à eJ ž_Cņ `à Zf
Ė[[à Y`[ e Ēà `B
S ƔRK
}n!&–GH
345OD‡ðG&Ċ45êvGH-}¯2nController-}¯2n
EntityControllern
HibernateEntityController
}BusinessProcessControllersµûŖ´ŗ
Œò»&GH-ŽnwʕĮ£ñò¬;RS&ÂÚF<“´¬nǙ¯ưĮvGE-ē
Ĕƿǀ¯2°Ŗ´ŗ
Œò»Žn®¯°78s×ØÙŖòœ̴ͱvķuͧ¥´¬œ1&ƗǶNJƿǀ¯nŖœ
©C©
\+
345OD‡ðG
ͮͯ&;<Ɏ&ǼɑͲͳ¯Ŗ´ŗ
345OD‡ðG%ɆÞ
è}¯2n&IJ&è&RegisterActionƣ´}śŜ&«"vûŖ´ŗ
@Stateless
@Name("register")
public class RegisterAction extends EntityController implements Register
{
@In private User user;
public String register()
{
List existing = createQuery("select u.username from User u where u.username=:username")
.setParameter("username", user.getUsername())
.getResultList();
if ( existing.size()==0 )
{
persist(user);
info("Registered new user #{user.username}");
return "/registered.jspx";
}
else
{
addFacesMessage("User #{user.username} already exists");
return null;
}
}
}
Ȧx&«"nì›ţû´¬«"vɱɲŽvûŖĿŻnnnŗ
©C©
\Q
1 j
ö à [[ I[ ƀ[Ç [` e Y B~|
Y
e
1 ##.7Ąâ
š0&-,FŽn
;,Ã-ȃ%
org.drools.RuleBase
M-N-íîä´¬Œ}%´ŗ
ƾţ&Ñ/¡345%Žn
Žn/Š—KMtu%µ¬Ų’sµûŖ´ŗ
ű›2n&—KM}
%&íîätu}´¬Ú45'Ɗ´¬Ų’sµ¬%¯Ƌ"ŗ
ÆʹƦȯ&
€[
ŽnŒ&ƺƻ>Ɣ´¬˜ƿǀ´¬%¯Ƌ"ŗÇ
,-ƉŠ%n
ŽGH-â-º»˜Švw¿;âM´¬n×ØÙØ;RSƿǀ¯2°Ŗ´
ŗ Œ&;RSŽncomponents.xml «ûM-tu%´ŗ
<drools:rule-base name="policyPricingRules">
<drools:rule-files>
<value>policyPricingRules.drl</value>
</drools:rule-files>
</drools:rule-base>
Œ&;RSŽn.drl
OáMw¿º»;âM¯n
########;,Ã-ŀ
org.drools.RuleBase
ÃĭF4¯Ŗ´ŗ
ԃ&¹-Ñ/¡345M-´¬Ų’Ŕµûǁ¬Œ}Ʈ
Ƭ¯2ţŦñ°ŗ
€[ € Į£´¬&%µòũn€ dÓƓd¯vŨòũvûŖĿŻ6
<drools:rule-base name="policyPricingRules" dsl-file="policyPricing.dsl">
<drools:rule-files>
<value>policyPricingRules.drl</value>
</drools:rule-files>
</drools:rule-base>
[fC YY[
ņ [ ` à
[[à Y[à`[ņ Y
f
YY[
_[[ _ €[ I[#J J m I[ *m
I[#J €[ [ C ÆI|Ç m Y[à [ Y
öJ e [
[ e[ Yà *m I[#JfJ I[ [ eJ`[ components.xml6
<drools:rule-agent name="insuranceRules"
configurationFile="/WEB-INF/deployedrules.properties" />
*m YY e[ YY Y
e
m I[#J ž ZY[
eJ e[ e m €[ ZY[ `
newInstance=true
url=http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme.insurance/fmeyer
localCacheDir=/Users/fernandomeyer/projects/jbossrules/drools-examples/drools-examples-brms/cache
poll=30
name=insuranceconfig
[ Y`[ eJ m Y m Y [àņ `àYJ m
©C©
\\
I[
eJ e[
<drools:rule-agent name="insuranceRules"
url="http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acme.insu
local-cache-dir="/Users/fernandomeyer/projects/jbossrules/drools-examples/drools-ex
poll="30"
configuration-name="insuranceconfig" />
ùZņ _ ö e org.drools.WorkingMemory C[`[ m Cf
Æ^
m WorkingMemory [ e
[J m CÇ
<drools:managed-working-memory name="policyPricingWorkingMemory" auto-create="true" rule-base="#{polic
ù
m _ JC m policyPricingWorkingMemory e
`
ö [ ` C
m ruleBase eJ YYà
11 ’ ] _ B
WorkingMemory à Yņ e
ņ e [6
@In WorkingMemory policyPricingWorkingMemory;
@In Policy policy;
@In Customer customer;
public void pricePolicy() throws FactException
{
policyPricingWorkingMemory.assertObject(policy);
policyPricingWorkingMemory.assertObject(customer);
policyPricingWorkingMemory.fireAllRules();
}
12 xyz &MI4aÒ·¸##˜¡
¹-s
B~|
G45̜<H}¯2nµ¬°Ž—4‚5̜<Hnĉû…2̜<HvŠ}¯2/p´¬
«"ñĿ¬Œ}Ŕtu%´ ő ‚OKŖœŽl‚S-KE-dÓ&Šnj»%Ŕtŗ
<decision name="approval">
<handler class="org.jboss.seam.drools.DroolsDecisionHandler">
<workingMemoryName>orderApprovalRulesWorkingMemory</workingMemoryName>
<assertObjects>
<element>#{customer}</element>
<element>#{order}</element>
<element>#{order.lineItems}</element>
</assertObjects>
</handler>
<transition name="approved" to="ship">
<action class="org.jboss.seam.drools.DroolsActionHandler">
<workingMemoryName>shippingRulesWorkingMemory</workingMemoryName>
<assertObjects>
<element>#{customer}</element>
<element>#{order}</element>
<element>#{order.lineItems}</element>
</assertObjects>
</action>
</transition>
©C©
\a
I[
<transition name="rejected" to="cancelled"/>
</decision>
*m <assertObjects> [ Y
e ^ ZY m `B
[[
e `B
` e
m WorkingMemory
*m [ YY e J €[ e B~| ö J6
<task-node name="review">
<task name="review" description="Review Order">
<assignment handler="org.jboss.seam.drools.DroolsAssignmentHandler">
<workingMemoryName>orderApprovalRulesWorkingMemory</workingMemoryName>
<assertObjects>
<element>#{actor}</element>
<element>#{customer}</element>
<element>#{order}</element>
<element>#{order.lineItems}</element>
</assertObjects>
</assignment>
</task>
<transition name="rejected" to="cancelled"/>
<transition name="approved" to="approved"/>
</task-node>
µ¬Ċ–‚PGŽn%Ž €[ ™K˜}¯2ijľòŖ´ŗ ´vľnjn B~| Assignable
Ž assignable }¯2 n !¯2 Decision Ċ–‚PGŽ decision
}¯2ijľòŖ´ŗ
—4‚5ij"Žn—4‚5&§¨Ɣd´¬œ1n
decision.setOutcome("result") ƭʻŲ’sµûŖ´ŗ ĉû…2'(´¬Žn Assignable
š›2GN€cd´¬Ų’sµûŖ´ŗ
package org.jboss.seam.examples.shop
import org.jboss.seam.drools.Decision
global Decision decision
rule "Approve Order For Loyal Customer"
when
Customer( loyaltyStatus == "GOLD" )
Order( totalAmount <= 10000 )
then
decision.setOutcome("approved");
end
package org.jboss.seam.examples.shop
import org.jbpm.taskmgmt.exe.Assignable
global Assignable assignable
rule "Assign Review For Small Order"
when
Order( totalAmount <= 100 )
then
assignable.setPooledActors( new String[] {"reviewers"} );
end
©C©
\g
2 ĉ
*m à #~ Y[ e m YC m
f
mč e e J `m YJ _m à YB
2 {ÆÆē
à YC _ ee e Y6
ş
Y[e f m YY m
C
Y[ [f` f
à m
ö
ş
C
f m YY [[ m e m Y[e ņ Y[
ee [f` à m
ö J I[
2 \  ĉ ă
*m [[ Y m Ė e à YY[
e à mC [ à
Ėņ e ZY[ e à [à _m YJ _m [JJ ņ _m `[J [ņ m m Y[e _[[ Y`f
`[à ` ee
*m CJ e m Y[e eJņ Je
f
[à [ [` [ņ [[ à eY
e m m mņ à YY[
Ė à m
ö ` Z[ Y[Z ` [ņ m à _[[ Ė m e YC `à m C
21 jè
e J m C
e e àņ m e[[_J B e[ f
Ė ` eJ [ application.xml e à J à Y[e ņ m Ė6
ş
[f
Y[B
ş
[f
B
ş
BB
ş
[fB
ş
C[QB
b _`f` àņ jboss-seam-ui.jar [ ` [ m YY[
ė _
e[
©C©
\h
à
22 } ĉ
à ` à `[ àņ e ZY[ J *m ` `à [[J m m Identity.setSecurityEnabled(false) `[ à m
ö €J m YC à à m
ö `J Ye e m
e[[_J6
ş
^à à
ş
ž` à Y
ş
à Y
ş
~J 2S +
*m m
e YC `à à `[ Y ## ÆC #mf
#mč C
Çņ m YC ` mJm[à eJ`[
#~ e m[J m
ž_Cņ e [ Y[Z m
Ėf
ee m Y[e m e m
m m m Y[Zf
à e ##
2S 
*m Y[e m
m `[f ## [J [ņ SeamLoginModuleņ
_m
m [J m
e à _ Y *m [J [ [à eJ Y e e[ YY[
Y[
à m Ė à [ eJ e[ [[_ à _ m
m J m à [ m YC `à à _ YY[
¢eJJ
m Y[e e e m
Ė m identity Y ` eJ
components.xml6
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:security="http://jboss.com/products/seam/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2
http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.x
<security:identity authenticate-method="#{authenticator.authenticate}"/>
</components>
e à _m m C
à e m [f` Y m
öņ
[[ à [ m €[ Æ I[Ç B à [Ymņ [ eJņ ` [
*m ^ ZY #{authenticator.authenticate} m `J J m m
authenticate m e m authenticator Y _[[ ` m
m ©C©
\k
à
2S1 \ *m authenticate-method YYà Y
e e identity components.xml Y
e _m
m
m _[[ ` `à SeamLoginModule m
*m m ö Yf
ņ ZY
`[ J _mm m
f
e[ *m ė Y_ ` ` e Identity.instance().getUsername() Identity.instance().getPassword()ņ Y
C[à #à [
m m ` e m[ ` J J Identity.instance().addRole()
žė Y[ ZY[ e m
m C Y6
@Name("authenticator")
public class Authenticator {
@In EntityManager entityManager;
public boolean authenticate() {
try
{
User user = (User) entityManager.createQuery(
"from User where username = :username and password = :password")
.setParameter("username", Identity.instance().getUsername())
.setParameter("password", Identity.instance().getPassword())
.getSingleResult();
if (user.getRoles() != null)
{
for (UserRole mr : user.getRoles())
Identity.instance().addRole(mr.getName());
}
return true;
}
catch (NoResultException ex)
{
return false;
}
}
}
m `C ZY[ņ `m User UserRole YY[
fY
e
à ` *m
roles Y YY[ _m m [ m m ` eņ _m
m m[ `
m Set [[ J C[ņ J ŸŸņ ŸŸ m ņ e m
e NoResultException m_ņ m m
m false m m
e[
ĉjÃÅ
*m Identity.addRole() m `mC ee[à YJ _mm m m
e m m
ņ m addRole() m[ [à
` [[ J m m
Y
]m [[ mņ m [ Y[
Yà [ e Yfm
[ 
m
e[ņ m
Yfm
[ m `
Ÿ[Ÿ [ņ [[J Identity.hasRole() e m
[ _[[ m *m e[[_J Ė
J Y m [ e Yf
m
[ e [ `B
m_ [[à m_ e m
m
Y
©C©
ao
à
]m _J m
mņ Y m öY [ e
e à fee
*m `
m J m_ à m f
m
m _[[ ` [[ `à m à #~ņ m à ` Cö [f
Y[ J J[ Ė e mņ à Y
[ m m[ Zf
Y e[ e[ m
m[ ` _ `à Y[J C `C m à ^C em _ m mY e e ` _m
m C `à à
* JC ZY[ņ [ė à m Y e[ [J m `
Y
]
_[
m
`à
_J
C
`C
e
m
org.jboss.seam.security.loginSuccessful Cņ [ö m6
@In UserStats userStats;
@Observer("org.jboss.seam.security.loginSuccessful")
public void updateUserStats()
{
userStats.setLastLoginDate(new Date());
userStats.incrementLoginCount();
}
2S2 \  *m Identity Y YC `m username password YYņ J e m
m
*m YY ` ` [à m f
Y_ e[ [J e 
m YY ņ [[J m
©C©
a
à
m _[[ m
m J m YC [ žė
ZY[ e Y[ [J e6
identity.login()
<div>
<h:outputLabel for="name" value="Username"/>
<h:inputText id="name" value="#{identity.username}"/>
</div>
<div>
<h:outputLabel for="password" value="Password"/>
<h:inputSecret id="password" value="#{identity.password}"/>
</div>
<div>
<h:commandButton value="Login" action="#{identity.login}"/>
</div>
[[àņ [JJJ m `à [[J #{identity.logout} ¢[[J m _[[ [ m à e m [à m
2SS  | ĉ
Yņ m m m à Y eJ m
6
ş
¢eJ m
m components.xml
ş
] m
m
ş
] [J e m m m
2S[ œ ĉ ]Ä
* YC e CJ m e[ YJ Y à ņ
ė m pages.xml eJ à ŸYàŸ YJ *m _ àY e Z
Y m_ `à m à #~ 6
ş
NotLoggedInException
f *m Z
Y m_ e m Y f
YJ _m mà [JJ ş
AuthorizationException
f *m Z
Y [à m_ e m [à [JJ
ņ mà mC Y YJ e _m
m mà mC m à YC[J
m e NotLoggedInExceptionņ m m m [J J YJ m mà [J b AuthorizationExceptionņ à ` e[ m YJ žė ZY[ e pages.xml e[ m `m e m à Z
Y6
<pages>
...
<exception class="org.jboss.seam.security.NotLoggedInException">
<redirect view-id="/login.xhtml">
<message>You must be logged in to perform this action</message>
</redirect>
©C©
a)
à
</exception>
<exception class="org.jboss.seam.security.AuthorizationException">
<end-conversation/>
<redirect view-id="/security_error.xhtml">
<message>You do not have the necessary security privileges to perform this action.</messag
</redirect>
</exception>
</pages>
| _` YY[
Ė C Ym
m[J e [J ņ [ Y
[ e
[à e m[J m Y`[
2S^ Ÿ j
Ő ö m [J _m m
Y
[ C_ Æ _[
C_ Ç e[[_6
<pages login-view-id="/login.xhtml">
<page view-id="/members/*" login-required="true"/>
...
</pages>
Æ*m [ e `[ m m Z
Y m[ m_ `Cņ ` m[
Y``[à ` B
_m Ç
#e m [J ņ _ _ [[à m `
ö _m mà eņ mà à m m Ė [JJJ e à m e[[_J C
[ components.xmlņ Y C_ _m[ [JJ _[[
` `ņ m Y m e[[à [JJJ mà _[[ ` m J[[à Ė C_ņ _m à YJ Y m Z m J[ f
Ė
<event type="org.jboss.seam.security.notLoggedIn">
<action execute="#{redirect.captureCurrentView}"/>
</event>
<event type="org.jboss.seam.security.postAuthenticate">
<action execute="#{redirect.returnToCapturedView}"/>
</event>
ù m [J Y[ Cf
Y mņ ė
m C à authenticate() m
2Sb œy +
#[mJm e [ `[[à àņ YC e f
m
J J m ž**~ ž**~ €J ÆIb¢ )agÇ m * m
e e m
ņ m authentication-filter Y ` `[ Yf
Z[6
©C©
a+
à
<web:authentication-filter url-pattern="*.seam" auth-type="basic"/>
* `[ m e[ e `
m
ņ auth-type basicņ e J f
m
ņ digest e J J m
ņ m key realm [ ` 6
<web:authentication-filter url-pattern="*.seam" auth-type="digest" key="AA3JK34aSDlkj" realm="My App
*m key ` à J C[ *m realm m e m m
[ m
Y m _m mà m
\ } +
e J J m
ņ à m
[ m[ Z m `
[
org.jboss.seam.security.digest.DigestAuthenticatorņ m validatePassword() m C[ m ė Y[ Z Y_ J m J Ė ž ZY[6
public boolean authenticate()
{
try
{
User user = (User) entityManager.createQuery(
"from User where username = :username")
.setParameter("username", identity.getUsername())
.getSingleResult();
return validatePassword(user.getPassword());
}
catch (NoResultException ex)
{
return false;
}
}
2Sc +Æ + _
*m ZY[ e m C
e YC `à m à #~ e f
J Y[Z à Ė
’ ĉ Ĕ ++ 
e à _[ m m Y[e ## eJ YC `à m
à #~ņ à à [J m e[ à ## eJ `à
jaasConfigName YYà components.xml b ZY[ņ e à J m other Y[
à Æ_m
m m UsersRolesLoginModule [J [
#Çņ m m à components.xml _[ [ö [ö m6
f
YCJ # _m
YC `à
<security:identity authenticate-method="#{authenticator.authenticate}"
jaas-config-name="other"/>
©C©
aQ
à
2[ ] z
*m à #~ Y
` e e[ e
J e C àf[
C *m e[[_J `[ [ m J öà m ` C m
J `à Y
eàJ m message.properties e[ * YY m f
Jņ B Y m öà _m Yà C[ m e[
*`[ + à |J ʭà
|J ʭà
€
Y
org.jboss.seam.loginS
*m J Y
_m e[[à [J C m
à #~
uccessful
org.jboss.seam.loginF
ailed
org.jboss.seam.NotLog
gedIn
*m J Y
_m m [J Y
e[ņ m `f
m YC Y_ņ `f
m
e[ m _à
*m J Y
_m Y Ye f
YJ m Ė à m
öņ m
[à m
2^ +Ċ
*m ` e mč e YC `à m à #~ e f
J Yņ Y mņ YJ *m ` m e
m # Y mJ m e à _m à e m C
e
Æ
m [f` YÇ m à components.xml ` eJ YY
m f m ¢eJ `C
2^ ^
m e m mč m YC `à m à #~ `[ Y m
Y e `J J [ ½ Y # [ JYņ àYņ e
m à mC ` J YC[J e YeJ Y
e
_m YY[
# Y m m m YC[J Æ
feeÇ e YeJ J[ņ Y
e
[à Y`[ `[ YY[
J mJ ` Yņ m_C [ ee mJm [C[ e Cf
_m JJ YC[J JY e I[ Y[ņ J e [à m ŸŸņ ŸŸņ Ÿ
Ÿņ ~ e `m ņ Y _m m f
m e name:actionņ e ZY[ customer:deleteņ customer:insert
©C©
a\
à
2^1  ė `à ZJ m Y[ e e mčņ Y àņ J
_m m @Restrict ĕj Y à ` m m m m [ [C[ņ J m
@Restrict e `m m ė [J [ _m
@Restrictņ m m _[[ ö Y
Æ m [ _[[ YY[àÇ e m C
e[ à m
öņ m Z
Y _[[ ` m_
Y m e Identity.checkRestriction() Æ [ I
Ç # @Restrict
B m Y [ [e ĖC[ J @Restrict m e mf
# Yà @Restrict Y[ Y m
ö e componentName:methodName *ö e Zf
Y[ m e[[_J Y m6
@Name("account")
public class AccountAction {
@Restrict public void delete() {
...
}
}
m ZY[ņ m Y[ Y Ė [[ m delete() m account:delete
*m
ĖC[
e
m
_[
`
_
@Restrict("#{s:hasPermission('account','delete',null)}") ù_ [ė [ö m Zf
Y[6
@Restrict @Name("account")
public class AccountAction {
public void insert() {
...
}
@Restrict("#{s:hasRole('admin')}")
public void delete() {
...
}
}
*m ņ m Y [ [e _m @Restrict *m m à
m _m CJ @Restrict Ė Y[
Y m
ö
m e m ZY[ņ m insert() m Ė Y e account:insertņ
_m[ m delete() m Ė m m ` e m admin [
e _ J à emņ [ė m #{s:hasRole()} ZY m `C
ZY[ m s:hasRole s:hasPermission ^ e
ņ _m
m [J m f
YJ[à m e m Identity [ *m e
` _m à
^ ZY mJm m à e m à #~
J ^ ZYņ m C[ e m @Restrict à e
à `B
m Z _m Z *m Z[à e[ _m YeJ Y
m
ö e Y
e
`B
ö m ZY[6
©C©
aa
à
@Name("account")
public class AccountAction {
@In Account selectedAccount;
@Restrict("#{s:hasPermission('account','modify',selectedAccount)}")
public void modify() {
selectedAccount.modify();
}
}
*m J mJ e m ZY[ m e
selectedAccount _m m hasPermission() e
[[ *m C[ e m C`[ _[[ ` [ö Y
e _m m Zņ Y m hasPermission() m Identityņ _m
m
m m e m m m Ė Y e eàJ m
Y
e Account `B
Jm ` `[ Ye à m
ö ņ _m J m
@Restrict m ņ Y[à Identity.checkRestriction() C[
à ZYņ [ö m6
public void deleteCustomer() {
Identity.instance().checkRestriction("#{s:hasPermission('customer','delete',selectedCustomer)}");
}
e m ZY Y
e ė C[ trueņ m
ş
e m [JJ ņ NotLoggedInException Z
Y m_ ş
e m [JJ ņ AuthorizationException Z
Y m_
[ Y`[ [[ m hasRole() hasPermission() m [à e C
6
if (!Identity.instance().hasRole("admin"))
throw new AuthorizationException("Must be admin to perform this action");
if (!Identity.instance().hasPermission("customer", "create", null))
throw new AuthorizationException("You may not create new customers");
2^2 ĉ  e _[[ J e
m m Y _m
Y e _m
m mà ė mC m à YC[J à [[_
[ J e m Ç e YJ )Ç C[ [ņ `
Y m YC[J e m ņ J m Cà ^ ZY m e
Y à
ė ö [ö ZY[ e e
à b e [[ņ [ė Y
m _ mC [J e m m[ [à ` e m [à [JJ
AJ m identity.isLoggedIn() YYàņ _ _ m6
<h:form class="loginForm" rendered="#{not identity.loggedIn}">
©C©
ag
à
e m ė [JJ ņ m m [J e _[[ ` f Cà Jm e_
e ù_ [ė Y m m YJ m _m
m
m[ [à ` `[ m manager [ žė _à m m [
` _6
<h:outputLink action="#{reports.listManagerReports}" rendered="#{s:hasRole('manager')}">
Manager Reports
</h:outputLink>
*m [ Ė Jm e_ e m ` e m manager [ņ
m m Y ö _[[ ` *m rendered ` J[[à ` m [ [eņ J <s:div> <s:span> [
ù_ e mJ Y[Z ė à à mC h:dataTable [ YJ [J
e _m
m à à à _m [ö YJ m ė
YC[J *m s:hasPermission ^ e
[[_ Y `B
Y _m
m
` _mm m m m Ė Y e m `B
žė m_ *`[ _m [ö Jm [ö6
<h:dataTable value="#{clients}" var="cl">
<h:column>
<f:facet name="header">Name</f:facet>
#{cl.name}
</h:column>
<h:column>
<f:facet name="header">City</f:facet>
#{cl.city}
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<s:link value="Modify Client" action="#{clientAction.modify}"
rendered="#{s:hasPermission('client','modify',cl)"/>
<s:link value="Delete Client" action="#{clientAction.delete}"
rendered="#{s:hasPermission('client','delete',cl)"/>
</h:column>
</h:dataTable>
2^S  
~J à Ė m m YY[
J pages.xml e[ņ m_C Zf
[à Y[ eJ Y[à [ <restrict/> [ _m m page [
m à _m e ZY[
Y
e `à m restrict [ņ
Y[ Y e /viewId.xhtml:render _[[ ` m
ö _m m YJ C fe
Æó^*Ç Ėņ Y e /viewId.xhtml:restore _[[ ` Ė
_m à b Y`
ö Æe `Ç J e m YJ m_ņ m Yf
e _[[ ` C[ à ZY žė Y[
e ZY[6
<page view-id="/settings.xhtml">
<restrict/>
</page>
*m YJ m Y[ Y e /settings.xhtml:render Ė e fe
f
Ė Y[ Y e /settings.xhtml:restore e e
Ė
<page view-id="/reports.xhtml">
©C©
ah
à
<restrict>#{s:hasRole('admin')}</restrict>
</page>
m e
fe
Ė m YJ Ė m m ` e m
admin [
2^[  ]
à [ ö Y`[ YY[à à ņ ņ Yf
[ e * [[ e à [ņ @Restrict m [ [e6
@Entity
@Name("customer")
@Restrict
public class Customer {
...
}
e ZY Y
e m @Restrict ņ m e[ à m
ö m
Ye Y m
ö e entityName:actionņ _m entityName m f
Y e m à Æ m e[[àfĖ[e [ e ©ù Y
eÇņ
m action m readņ insertņ update delete
[ Y`[ [à ņ `à Y[
J @Restrict m [C à [e
à
[ m Æ e[[_Ç6
ş
@PostLoad
f ¢[[ e à [ e m ` A m mf
eJ read Y
ş
@PrePersist
ş
@PreUpdate
ş
@PreRemove
f ¢[[ `e _ e m à A m m
eJ insert Y
f ¢[[ `e à Y A m m eJ update
Y
f ¢[[ `e à [ A m m eJ delete
Y
žė ZY[ e m_ à _[ ` eJ Ye à m
ö e
à insert Y ~[ m m m Ė àmJņ m
[à Y mJ J à m_ 6
@PrePersist @Restrict
public void prePersist() {}
# mė ZY[ e à Y [ m m
ö e m m
[[_ _ MemberBlog Æe m Y
ZY[Ç *m à e
_m
m m à m
ö `J [[à m _öJ à
Æ m MemberBlogÇ6
©C©
ak
à
rule InsertMemberBlog
no-loop
activation-group "permissions"
when
check: PermissionCheck(name == "memberBlog", action == "insert", granted == false)
Principal(principalName : name)
MemberBlog(member : member -> (member.getUsername().equals(principalName)))
then
check.grant();
end;
*m [ _[[ J m Y memberBlog:insert e m [à m
Æ
`à m Principal e
Ç m m m ` e _m
m m `[J à
`J *m ŸprincipalName : nameŸ m ` m Principal
e
Æ m Y[
Ç C`[ `J f ` m name YYà e m Principal C`[ [[ principalName `[ `J [[_ m C[ ` e m Y[
ņ m m e[[_J [ _m
m Y m `ė m
Principal b [ņ Y[ e m I[ b[[àņ _ [[ [ [ m J à _m à ~#
YC
]ĉ ĉ ē y+
à m
ö e ^+ à ` Ye _m EntityListener Ő f
[[ m [ `à J m e[[_J META-INF/orm.xml e[6
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xm
version="1.0">
<persistence-unit-metadata>
<persistence-unit-defaults>
<entity-listeners>
<entity-listener class="org.jboss.seam.security.EntitySecurityListener"/>
</entity-listeners>
</persistence-unit-defaults>
</persistence-unit-metadata>
</entity-mappings>
]ĉ ĉ ē œ
e à J ž` SessionFactory eJ C ņ à ė àf
mJ Y
[ à à
2b \ ĉ j
AY m Y m m ` [ e e Yņ ` e `
m_ Y [[à e J *m Y[ m Y
ņ `à
ZY[J m_ Y m
ö Y
ņ m_ Y[ Y m
ö
e YY[
©C©
go
à
2b y {ÆÆē
m_ m à #~ ö_ _mm m m customer:modify Y e Y
e
ć à YC Ė C[ m e J Yf
ņ ` I[ # Y[ e m CJ e J [ J Ç
[č [
e m ` [J
m `m m Yņ )Ç
Y f I[ Cà ee
[Jm e C[J [J ` e f
Y[Z [ C[CJ [Y[ 2b1  à ZY
e RuleBase Y [[ securityRules _m
m C[ Y m
ö *m eJ components.xml e[[_6
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:security="http://jboss.com/products/seam/security"
xmlns:drools="http://jboss.com/products/seam/drools"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2
http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd"
http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.x
<drools:rule-base name="securityRules">
<drools:rule-files>
<value>/META-INF/security.drl</value>
</drools:rule-files>
</drools:rule-base>
</components>

m RuleBase Y eJņ ė _ m à [
2b2  ĉ b m Y à e[ [[ security.drl m /META-INF à e
à YY[
ė B e[ [ e
m e[ ` [[ àmJ à _ņ
Z à [
[J eJ YYY[à components.xml
_m m[ m à [ e[ ć # m J Jm ` J [ ö mJm m I[ ņ m_C J mė Zf
[à Y[ ZY[6
package MyApplicationPermissions;
import org.jboss.seam.security.PermissionCheck;
import org.jboss.seam.security.Role;
rule CanUserDeleteCustomers
when
c: PermissionCheck(name == "customer", action == "delete")
Role(name == "admin")
then
c.grant();
end;
©C©
g
à
ė `ö m _ *m e mJ _ m Y
öJ [ # Y
öJ I[ [[à [[
e [ *m Y
öJ ` àmJ à
_ f ė [ àmJ [ m Y e m [ `
*m Z mJ _ Y[ e Y e m PermissionCheck Role [ *m Y e m [ J m _ė[[ ` e
J m
[ _m [
b[[à _ mC m e m [ ^
m [ _m Y
öJ m[ ` JC Ė Æ[[à `J m YY e m [Ç m [ [[
CanUserDeleteCustomers _[[ ` m
ö _mm [[_ [ öJ m `à e m [ e _ _ I[
mC _m ö_ [e m Æ žÇ Jm m ÆIžÇ *m ž f
e m [ Y e m [ņ [ e _m
m ` f
e e m [ e *m ž Y `à m when *m Iž m
Ė
ņ e m [ m _[[ [à ` e e [[ e m f
m ž *m Iž Y `à m then *m e m [
`à m end; [
e _ [ö m ž e m [ņ _ _ [ m ė Z m
e 6
c: PermissionCheck(name == "customer", action == "delete")
Y[ J[mņ m J m m Z PermissionCheck `B
_m name YYà Ė[ Ÿ
Ÿņ action YYà Ė[ Ÿ[Ÿ _m
m _öJ à ]m m _öJ àć f
Y `B
m f
m Z[ e m Ė `à m [ J ö ` Y m
ö ^
m m hasPermission() m [[ņ Yà PermissionCheck `B
ņ b
ņ m _öJ à *m PermissionCheck
Y Z
[à m Y m `J m
öņ e ZY[ e à [[
hasPermission("account", "create", null) m PermissionCheck `B
_m name Ė[ Ÿ
Ÿ action Ė[ Ÿ
Ÿ _[[ ` m _öJ à e m
e m Y m
ö
_m [ m _öJ àć m mf[C Yà e
J Y m
öņ m [Jf[C `B
m _öJ à m
à m e m e `J m
*m [ à
java.security.Principal `B
m Y e m m
Y
ņ
Y[ org.jboss.seam.security.Role `B
e m e m [ m m `
e [ Y`[ [ [Jf[C e
m _öJ à `à
[[J ((RuleBasedIdentity) RuleBasedIdentity.instance()).getSecurityContext().insert()ņ
YJ m `B
Y
óJ `
ö Y[ ZY[ņ _ [ m m e [ e ž YeZ _m c: *m C`[ `Jņ e `
ö m `B
m m `à m |CJ m [ e žņ _ m6
Role(name == "admin")
©C©
g)
à
*m Y[à m m ` Role `B
_m name e ŸŸ
_m m _öJ à # ņ [ m _öJ à
[Jf[C e
ņ YJ `m Jmņ m [ [[à àf
J Ÿ _[[ e e à m
öJ e m customer:delete Y m ` e m admin [Ÿ
_m m Ė
e m [ eJć ė ö [ö m Iž e m [6
c.grant()
*m Iž e C ņ m CöJ m grant() m e m c
`B
ņ _m
m [à C`[ `J e m PermissionCheck `B
m name action YY e m PermissionCheck `B
ņ m [ granted YYà _m
m [[à false ¢[[J grant() PermissionCheck m granted YYà trueņ _m
m m m Y m
ö _ e[ņ [[_f
J m à _mC m Y m
ö _ e
\ Ė
Y`[ Y[ _[
Y m
ö Æ_m
m [[_ [[ e JC Y Çņ `à J m action e m PermissionCheck à
[ņ [ö m6
rule CanDoAnythingToCustomersIfYouAreAnAdmin
when
c: PermissionCheck(name == "customer")
Role(name == "admin")
then
c.grant();
end;
*m [ [[_ _m m admin [ Ye à e à customer Yf
m
ö
2c Ÿ ĉ
[ `
YY e CJ C YJ C m ž**~ Y
[ *m [à eJ `à Y
eàJ scheme e m YJ pages.xml *m e[[_J ZY[
m_ m_ m C_ /login.xhtml eJ ž**~6
<page view-id="/login.xhtml" scheme="https"/>
*m eJ [[à Z `m s:link s:button b [ņ
_m
m Æ_m Y
eàJ m viewÇ _[[ [ m [ö J m Y
[
m YC ZY[ņ m e[[_J [ö _[[ m ž**~ Y
[ `
/
login.xhtml eJ 6
<s:link view="/login.xhtml" value="Login"/>
_J [à C_ _m J m Y
[ _[[ ©C©
g+
à
m C_ J m Y
[ b ZY[ņ `_J YJ m m
scheme="https" J ž**~ _[[ m YJ J ž**~
[ Y`[ eJ e[ m e [[ YJ *m e[ e à
_m ž**~ e [à e_ YJ e e[ m Y
e m m [
`mC m m m YJ m f
Ė ž**~ņ m ž**~ _[ ` e m CJ _à m
fž**~ YJ Æ]m[ m J e àņ J e Ye
ŅÇ
* e ž**~ m e[ schemeņ m [ pages.xml6
<page view-id="*" scheme="http" />
e ņ e e m YJ à YY[
ž**~ m Ė Y
eà e[ m
Ő à eJ [[à C[ m ž**~ m m
m mJ m [ components.xml6
<core:servlet-session invalidate-on-scheme-change="true"/>
*m Y m[Y ö à à [ C[`[ eeJ e m [öf
J e C e YJ J ž**~ m YJ J ž**~
2f +y
œ+
*mJm [à Y e m à #~ņ YC `[f ¢#~*¢ž# Æ¢f
Y[[à # ~`[
*J [[ ¢Y ž #YÇ [Jm YC Y
e J _m à YY[
2f  +y
œ+ Æ
* J Y Jņ à eJ m I
C[ņ _m
m _[[
YC m ¢Y
m m[[J J à YJ *m Ė m e[[_J à web.xml6
<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
2f1 + +y
œ+ #J ¢#~*¢ž# m[[J e Z[à à žė ZY[6
<h:graphicImage value="/seam/resource/captcha"/>
<h:inputText id="verifyCaptcha" value="#{captcha.response}" required="true">
<s:validate />
</h:inputText>
©C©
gQ
à
<h:message for="verifyCaptcha"/>
*mė [[ m *m graphicImage [ Y[à m ¢#~*¢ž# m[[Jņ m inputText C m ė Y *m Y [[à C[
J m ¢#~*¢ž# _m m e `
2f2  +y
œ+ 
Ő à č m ¢#~*¢ž# [Jm `à CJ m `[f Y6
@Name("org.jboss.seam.captcha")
@Scope(SESSION)
public class HitchhikersCaptcha extends Captcha
{
@Override @Create
public void init()
{
setChallenge("What is the answer to life, the universe and everything?");
setCorrectResponse("42");
}
@Override
public BufferedImage renderChallenge()
{
BufferedImage img = super.renderChallenge();
img.getGraphics().drawOval(5, 3, 60, 14); //add an obscuring decoration
return img;
}
}
2i ĉ ]Æ
*m
e[[_J
`[
`
`
e
C
M¹nMNENnèéÐ=Ç `à à
Æ
¢mY
\ņ
*`[ +) à ^C
^C ʭà
org.jboss.seam.securi
€
Y
I _m [J Y e[
ty.loginSuccessful
org.jboss.seam.securi
I _m [J Y e[
ty.loginFailed
org.jboss.seam.securi
ty.notLoggedIn
org.jboss.seam.securi
ty.notAuthorized
©C©
I _m à m
ö e[ _m m [JJ
I _m à m
ö e[ _m m [JJ m_C ė mC ee
YC[J
g\
à
^C ʭà
org.jboss.seam.securi
€
Y
I B Y m
ty.preAuthenticate
org.jboss.seam.securi
I B e m
ty.postAuthenticate
org.jboss.seam.securi
I e m m [JJ ty.loggedOut
org.jboss.seam.securi
I _m m ė [ mC ` mJ
ty.credentialsUpdated
org.jboss.seam.securi
I _m m àė `| YYà mJ
ty.rememberMe
2 ]ĝ ĉ Jm ` à Z m à Y e à YY[
m
Y
[ à Ė b ZY[ņ Jm ` Ė m
J
¢Yà €Y €ņ [J _m m [ Y_ e Yf
` à Ė m I[à m[ ` Zņ m_ à
m[ ` Z
*m e[[_J ZY[ m_ Z à Y _m [ companyCode
e[ *m [[ Y
e APPLICATION m m Z à J f
[[ Ye
m `[f à
@Name("org.jboss.seam.security.identity")
@Scope(SESSION)
@Install(precedence = APPLICATION)
@BypassInterceptors
@Startup
public class CustomIdentity extends Identity
{
private static final LogProvider log = Logging.getLogProvider(CustomIdentity.class);
private String companyCode;
public String getCompanyCode()
{
return companyCode;
}
public void setCompanyCode(String companyCode)
{
this.companyCode = companyCode;
}
@Override
public String login()
{
©C©
ga
à
log.info("###### CUSTOM LOGIN CALLED ######");
return super.login();
}
}
©C©
gg
S ėĘâw3¢ ÃĊ
Å
ƾƏ˛
A
ÂFE‚ij"×ØÙØ;RS&ƿǀ«ûn
%ŽrƱĘęäñòœ345p³%ÞŖ´ŗ
S M:#
Ś78K™M&EF45Žn
java.util.Locale
M-N-}ŋŌ¯2°Ŗ´ŗ
Æ345%Žn
locale
}°"Ò­&
EF45-;&;RS}¯2ijýŖ´
Ç
Ļļ&ʼnŇ%Žn
K3&œ1&ĞƐvcdŽƄ’%´ŗ %ŽG,@–ŽK3&ƔdŽſȩ b
͎͏¯2°Ŗ´ŗ
ş
ž**~ G?-%Ɠdñò¬K3 ƖHœ8&K3Ç sµûn !¯2nfaces-config.xml
«û“żtuvK3&×ØĆľĿ&ŀ!&K3sµ¬ŷĆn
!&Ŷ&EF45&Ĉçn!&K3š£¯Ŗ´ŗ
ş
!òśé%n—O¶K3s
faces-config.xml
!&Ŷ&EF45&Ĉçn!&K3š£¯Ŗ´ŗ
ş
!òśé%Žn˜&—O¶K3š£¯Ŗ´ŗ
ŧ&
cdKâ,@«¬¤Ŏ%K3&cds
org.jboss.seam.international.localeSelector.languagen
ŀƓdñò2°òũn
tu
org.jboss.seam.international.localeSelector.country
org.jboss.seam.international.localeSelector.variant
%´ŗ
Æ
!¯2
Ç
%ŔnŒò("ƌ…v=ȍŽǪýÝÞŖĿŻŗ
¯º¯n34578MNOP-˴¯2n
78¤Ŏ%K3cdtu}ñĿ¬Œ}Ží£%´ŗ
Ž$V&̇ƛ‡«›2Ɣdñò¬K3Ċ˜HM<´¬×ØÙØķuŔƿǀ¯2°
Ŗ´ŗ ´ƚÞŒ}Žn~ ŖœŽnb
[ ‚&O¶‡śŜ&įİǣǤ´¬ŦŨ%´ŗ
<h:selectOneMenu value="#{localeSelector.language}">
<f:selectItem itemLabel="English" itemValue="en"/>
<f:selectItem itemLabel="Deutsch" itemValue="de"/>
<f:selectItem itemLabel="Francais" itemValue="fr"/>
</h:selectOneMenu>
<h:commandButton action="#{localeSelector.select}" value="#{messages['ChangeLanguage']}"/>
µ¬°Žnfaces-config.xml
śŜš›2ţŦñ°ŗ
“żñòœ´ƚ2&K3&×ØĆľĿsʠ¯Ũòũn
<h:selectOneMenu value="#{localeSelector.localeString}">
<f:selectItems value="#{localeSelector.supportedLocales}"/>
</h:selectOneMenu>
<h:commandButton action="#{localeSelector.select}" value="#{messages['ChangeLanguage']}"/>
Œòš£¯2<KFĕœº»M,‡ǚǛ¯nÿNGFG´òũn
©C©
gh
Ęęä},¤ Æ[č mÇ
!&Ŷ&EF45&Ĉçn } b &K3ŽĊ˜HM<ñòŖ´ŗ
S1 L¶#
b
Žn78MNOP-&H¹ĝɾǂ£,Ã-&Ęęän
<f:loadBundle
/>
š£«›2“ż¯2°Ŗ´ŗ 345%ŔŒ&Ksš£tu%´ŗ
Ɛɝn×ØÙØ& ^ ¿Į£¯œ,DäñòœH¹Ěz´¬œ1n #####
;RSĮ£´¬Œ}Ŕtu%´ŗ
S1 L¶#'aÒ±©
Ž
java.util.ResourceBundle
ƿǀ¯2°Ŗ´
Æ
345%Žorg.jboss.seam.core.resourceBundle}¯2íî
Çŗ
Ɠd¯œÚ-˜<Ļ2ĘęäñòœH¹í¬Ų’sµûŖ´ŗ
—O¶%ŽnÚ-˜<Ž messages &Ò͵v&% messages.propertiesn messages_en.propertiesn
messages_en_AU.properties
vŠ&Ò͵&OáMH¹dÓ´¬Ų’sµûŖ´ŗ
Œò»&OáMŽĻļ
WEBINF/classes —@DGTǞñòŖ´ŗ
ű›2nmessages_en.properties %Žn
Hello=Hello
!¯2nmessages_en_AU.properties %Žn
Hello=G'day
}ƭũò¬ cdKâ,@«›2n
Ú-˜<}¯2ɂv¬Ò­ǚǛ´¬Œ}stu%´ŗ
Ú-˜<Ò&-Ɠd¯2ÂFE‚&¥¦ñĿ¬ ÆșñÉÊÇ Œ}Ŕ%ÞŖ´ŗ
org.jboss.seam.core.resourceBundle.bundleNames
<core:resource-bundle>
<core:bundle-names>
<value>mycompany_messages</value>
<value>standard_messages</value>
</core:bundle-names>
</core:resource-bundle>
Ğd&‚ŦŨÂFE‚dÓ¯œ°&%µòũn
!&bl€}͏ҭ%Ú-˜<Ɠd¯Ŗ´ŗ
}šŶ&ȁȂXƸȋ¯Ŗ´ŗ
ÖŖû
ÂFE‚Ěz¯œ°ŦŨ%µòũn
!&ÂFE‚
ɆÞŖ´ŗ
pages.xml
Œ&}ހ&š0&
/
/welcome/hello.jsp
welcome/hello_en.properties
ǂŤv˜<ÒƓd´¬Œ}Ŕ%ÞŖ´6
<page view-id="/welcome/hello.jsp" bundle="HelloMessages"/>
Θ%
HelloMessages.properties
%š"Œ}s%ÞŖ´ŗ
©C©
dÓñòœÂFE‚
/welcome/hello.jsp
gk
Ęęä},¤ Æ[č mÇ
S11 L¶#'ęu±©
Ŕ¯n&Ú-˜<H¹dÓ¯œv»ũn ´ƚ2&‚ <f:loadBundle ...
/>
NM´¬Œ}vţn
Œò»sš£tu%´ŗ
!&ĤľûnśŜ&«"ſȩNM¯Ŗ´6
<h:outputText value="#{messages['Hello']}"/>
µ¬°Žn
<h:outputText value="#{messages.Hello}"/>
ñ»Ʒ°Œ}nÂFE‚!&Ŕ&Ž ^ ¿ġĢŒ}Ŕtu%´ŗ
Hello=Hello, #{user.firstName} #{user.lastName}
Hello=G'day, #{user.firstName}
;<&ŀÂFE‚š£´¬Œ}Ŕtu%´ŗ
@In private Map<String, String> messages;
@In("#{messages['Hello']}") private String helloMessage;
S12 _ ¿JI
;RSŽ78³øº̺̻ºĚz´¬}2ŔưĮvēĔ%´ŗ
$W¯œķuŽne
J Ŕíî%´ŗ
facesMessages
@Name("hello")
@Stateless
public class HelloBean implements Hello {
@In FacesMessages facesMessages;
public String sayIt() {
facesMessages.addFromResourceBundle("Hello");
}
}
ŒòŽn78&K3ż2nHello,
}ĚzñòŖ´ŗ
Gavin
King
µ¬°Žn
G'day,
Gavin
S2 PO„Ě%
&EF45-;&M-N-n
Ò͵Žorg.jboss.seam.international.timezone }NM‡ěÈĸ´¬ ;RSn
Ò͵Žorg.jboss.seam.international.timezoneSelector
ŔµûŖ´ŗ
—O¶%ŽnNM‡ěŽ˜&NM‡ě%´ŗ
Ŕ¯NM‡ěs
<f:convertDateTime>
š£¯2ǂzŠƓdñòvŨòũ
ƄͶŔ
b
ƞƟ%Ž´ƚ2&ĵÝ}ÎçŽ
A*¢
­ƿ}¯2ëûnA*¢
}¯2ĚzñòŖ´ŗ
ŒòŽˌ˫Ƅưv—O¶&ɸ¬ɹ°%´ŗ
java.util.Timezone
©C©
ho
Ęęä},¤ Æ[č mÇ
ŽŒ&/pĊ˜HM<¯nŹ2&ĵÝ}ÎĶ—O¶%NM‡ě¯Ŗ´
ŗ ñ»ŽnNM‡ěëŨ¬Èʺ°Ö%Ŕ(ý¬«"n <s:convertDateTime>
N™ƿǀ¯Ŗ´ŗ
SS 3¢
345ŽŖœn}2Ŕžſ-ÃÈĸs%ÞŖ´ŗ
,¤#~ŽKLHMǡ45#~}2Ŕʛ2°Ŗ´sn
ŔnjȅŻŒò»ͤÖ&ŋȌɁŽƣ˄¯2ëûn
KLHMǡ45},¤&ƝēR´¬345ŔµûŖ´ŗ
ŖŴnRñò¬,¤&EFcd¯Ŗ´6
<theme:theme-selector cookie-enabled="true">
<theme:available-themes>
<value>default</value>
<value>accessible</value>
<value>printable</value>
</theme:available-themes>
</theme:theme-selector>
š0-ñòœ,¤s—O¶,¤%µ¬Œ}ơƬ¯2ţŦñ°ŗ
,¤Žn,¤}͏ҭ%Kâ,@OáMdÓñòŖ´ŗ èýũn default ,¤Ž
default.properties
wŌ&?}¯2dÓñòŖ´ŗ
èýũndefault.properties
ŽśŜ&«"dÓ¯Ŗ´6
css ../screen.css
template /template.xhtml
Ļļn
,¤Ú-˜<&?Ž
¢
-NMĝǽɚǵ&â-ĝ
,D&Ò­v¬%¯Ƌ"
ÆĻļŽ,Ã-%µ¬KLHMǡ45Ú-˜<}ŽDZ›2Çŗ
e
[
Œò%~ĝe
[‚ë°2Œò»&?šýŖ´ŗ
èýũne
[‚%-NM4ǃ£´¬Ž6
<link href="#{theme.css}" rel="stylesheet" type="text/css" />
µ¬°Žn–—@DG‚dÓs¸ǰ¯2°¬}Þ6
<link href="#{facesContext.externalContext.requestContextPath}#{theme.css}"
rel="stylesheet" type="text/css" />
šŔLjūvš°ē}¯2n e
[%Ž <ui:composition> «›2,Dǃ£%ÞŖ´ŗ
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
template="#{theme.template}">
njƋ"ŠK3EDGN&«"n
78s¼ȍ,¤Èĸ%Þ¬«"n×ØÙØ&,¤EDGNsµûŖ´ŗ
©C©
h
Ęęä},¤ Æ[č mÇ
<h:selectOneMenu value="#{themeSelector.theme}">
<f:selectItems value="#{themeSelector.themes}"/>
</h:selectOneMenu>
<h:commandButton action="#{themeSelector.select}" value="Select Theme"/>
S[ M:#w3¢`a.KJÀ¨©deâ
K3EDGNn,¤EDGNnNM‡ěEDGNŽŹ2n
K3},¤cdGFÐijä´¬Œ}R¯2°Ŗ´ŗ
Kâ,@cd¯2ţŦñ°ŗ
ſ
cookie-enabled
<theme:theme-selector cookie-enabled="true">
<theme:available-themes>
<value>default</value>
<value>accessible</value>
<value>printable</value>
</theme:available-themes>
</theme:theme-selector>
<international:locale-selector cookie-enabled="true"/>
©C©
h)
[ Ä
;HÿD45ͷȫ&œP–M%Žn
O¶H‡ǵ&ƥ͸n_ö‚n`[Jn;ÂvŠĮ£´¬œ1&n
ʥç&œ1&¤GFƏ˛sŲ’vûŖ´ŗ
Ž
*Z}ƭũò¬Ə˛ű›œO¶¤F˱Ø,Ã-Ěz´¬œ1&
<s:formattedText/>
;KsµûŖ´ŗ
*ZŽ#ù* I¹-&âĮ£¯2'Ɗñò2°Ŗ´sn
*ZĮ£´¬µœ›2#ù* IÖ°2&ǘɼŽƄ’v&%ɦȌ¯2ţŦñ°ŗ
[ Q³¢J
.ě…
4vè6
It's easy to make *emphasis*, |monospace|,
~deleted text~, super^scripts^ or _underlines_.
Œò <s:formattedText/> %ĚzñĿ¬}n śŜ&ž*| s²³ñòŖ´6
<p>
It's easy to make <i>emphasis</i>, <tt>monospace</tt>
<del>deleted text</del>, super<sup>scripts</sup> or <u>underlines</u>.
</p>
æ(Ž®¯°âH™HOp³´¬}ސš£¯Ŗ´ŗ Ŗœn+ ŽƃƗ¯š£¯Ŗ´6
+This is a big heading
You /must/ have some text following a heading!
++This is a smaller heading
This is the first paragraph. We can split it across multiple
lines, but we must end it with a blank line.
This is the second paragraph.
Æʮ͹q&ɱ(ŽſȳɀñòŖ´ŗ
®¯°ʮ͹}¯2,Ã-VW¯œ°ŷƎæ(sŲ’vŒ}ʅòv°%ţŦñ°ŗÇ
Œòs§¨& ž*| %´6
<h1>This is a big heading</h1>
<p>
You <i>must</i> have some text following a heading!
</p>
<h2>This is a smaller heading</h2>
<p>
This is the first paragraph. We can split it across multiple
lines, but we must end it with a blank line.
</p>
<p>
This is the second paragraph.
</p>
Ë˞ÝÞ-Ž # Ġ„%p³%ÞŖ´ŗË˞v¯-Ž = Ġ„š°Ŗ´6
An ordered list:
©C©
h+
*Z
#first item
#second item
#and even the /third/ item
An unordered list:
=an item
=another item
<p>
An ordered list:
</p>
<ol>
<li>first item</li>
<li>second item</li>
<li>and even the <i>third</i> item</li>
</ol>
<p>
An unordered list:
</p>
<ul>
<li>an item</li>
<li>another item</li>
</ul>
Ƚ£–KFGŽĕ–GĊ%̠ĢŲ’sµûŖ´6
The other guy said:
"Nyeah nyeah-nee
/nyeah/ nyeah!"
But what do you think he means by "nyeah-nee"?
<p>
The other guy said:
</p>
<q>Nyeah nyeah-nee
<i>nyeah</i> nyeah!</q>
<p>
But what do you think he means by <q>nyeah-nee</q>?
</p>
[1 &M—L„BCĜĝĞğ'Ġġ3À4
*ņ |ņ #
.XY
vŠ&ĞğĠ„ĝn<ņ >ņ & vŠ&ž*| %Į£ñò¬Ġ„Ž \ %?-3¯Ŗ´6
You can write down equations like 2\*3\=6 and HTML tags
like \<body\> using the escape character: \\.
<p>
You can write down equations like 2*3=6 and HTML tags
like &lt;body&gt; using the escape character: \.
</p>
Ŗœn ˜FG,@FG ÆͺÇ š›2;<&–KFG̠ĢŒ}s%ÞŖ´ŗ
©C©
hQ
*Z
My code doesn't work:
`for (int i=0; i<100; i--)
{
doSomething();
}`
Any ideas?
<p>
My code doesn't work:
</p>
<pre>for (int i=0; i&lt;100; i--)
{
doSomething();
}</pre>
<p>
Any ideas?
</p>
MHMǫd--&O¶¤FŽ°ÖŔ?-3Ð=ñòŖ´
Æ
ź}ŻŠ&ǫd--O¶¤Fñòœ,Ã-Ž'ꐎ;<ĝĞƐvÃĭHGN«¬
N™vûŖ´ Ç ŗ ¯œs›2nèýũśŜ&«"VWtu%´ŗ
This is a |<tag attribute="value"/>| example.
?-3¯vŨòũǫd--ŀ&Š&«"vÃĭHGNŔƸéñòŖ´ŗ
!òśʶnŠ&«"vēĔ
ÆMNFGnĕ-;vŠ
Ç
&MHMǫd--&O¶¤FŽ%ÞŖĿŻŗ _m YJ à e m m
f
m Y
` *m _ m à ė e [ Y
Z à m _à Æ[
ņ ņ Ç
[2 !%K
Gp¬ŽśŜ&ŞĠĮ£¯Ŗ´6
Go to the Seam website at [=>http://jboss.com/products/seam].
ŖœŽnG,Ã-Ɠd¯œ°ŷĆ6
Go to [the Seam website=>http://jboss.com/products/seam].
$̋ĨȫŨ%´snŒ&ŞĠĮ£¯œ_öð<&G>ͻ%Þ¬«"
*ZâL-N¤Mƛ´¬Œ}Ŕtu%´ŗ
[S œzŸ.XY
,Ã-Žȃdñòœž*| &–EFġ1¬Œ}sƗƦŖ´
ÆȌT¯v°%ţŦñ°n
GK-M-G,@™ʧʨŽĮ£%Þv°«"v–EFǚŻ%°Ŗ´Çŗ
ŒòŽGp³´¬ęvŠưĮ%´ŗ
You might want to link to <a href="http://jboss.com/products/seam">something
©C©
h\
*Z
cool</a>, or even include an image: <img src="/logo.jpg"/>
,–ŔpòŖ´6
<table>
<tr><td>First name:</td><td>Gavin</td></tr>
<tr><td>Last name:</td><td>King</td></tr>
</table>
µvœsĝȅ"}ȶýũĩŔ°ȅ°ȅ%Þ¬%¯Ƌ"Ņ
©C©
ha
^ Ä y}_ 
_ [ Y e JJ J *Z *m Yà e
e ė *Z YY e m J e ~€b ņ ` [
ee `
YY e I*b J
^ ’ y}_ *Z YY YC `à jboss-seam-pdf.jar *m #I m *Z b [ņ
_m
m C_ m ~€bņ m €
Yf
ņ _m
m C m m * [ ~€b YY à Yf
Y[
ņ [ jboss-seam-pdf.jar à WEB-INF/lib à [J _m m *Z
#I e[ *m em eJ ė *Z YYe
*m *Z [ Ė m e b
[ m C_ m[Jà b Cf
e m [`à à [ YY m e ~ #[[àņ Ė m e m f Y
öJ
*m examples/itext YB
ZY[ e m ~€b YY f
YY Y[à Y
öJJņ ` ZY[ m m öà ~€b J e YY
^  <p:document>
€
Y
€
J `à e
[ åž*| e[ J J m
http://jboss.com/products/seam/pdf Y
€
m[ [f
_à mC m document J m e m *m document J YY J m €
f
ž*| m #`
©C©
ş
type
ő *m àY e m ` Y
[ C[
PDFņ RTF HTML e[ ~€b Jņ
à e m e [à _ö [à _m JJ
~€b ş
pageSize
ş
orientation
ő *m č e m YJ ` J *m f
[à C[ _[ ` LETTER A4 # e[[ [ e Yf
Y YJ č ` e com.lowagie.text.PageSize
[ #[C[àņ YJč YC m _m mJm e m YJ [à *m C[ Ÿa) gk)Ÿņ e ZY[ņ
ĖC[ m ^**^I YJ č
ő *m e m YJ [ C[ hg
*Z ~€b J
landscape [
Y ņ m mJm _m
YJ č C[ C
portrait
ş
margins
ő *m [eņ Jmņ Y ` J C[
ş
marginMirroring
ş
disposition
ő m J J m[ ` f
C [J YJ
ő ]m JJ ~€b _` `_ņ m f
m ž**~ Content-Disposition e m [
C[ inlineņ _m
m m m[ ` f
Y[à m `_ __ e Y`[ņ attachmentņ _m
m
m m m[ ` _[
*m e[ C[ inline
| #`
ş
title
ş
subject
ş
keywords
ş
author
ş
creator
AJ
<p:document xmlns:p="http://jboss.com/products/seam/pdf">
The document goes here.
</p:document>
^1 Ä ]
Ae[ _[[ m B Z̽ m_Cņ m A f
Y J _ ž*| J e[ e JJ ~€b ņ YC Y
[ A Y e JJ `[ ~€b *J
[ö <p:image> <p:paragraph> m `
e e Y[ *J [ö
<p:font> YC à[ e [[ m JJ m
<p:paragraph>
€
Y
| e Z m[ ` YJYm m
Z eJ ` e[_ņ e à[ [J
[
JY
#`
©C©
hh
*Z ~€b J
ş
firstLineIndent
ş
extraParagraphSpace
ş
leading
ş
multipliedLeading
ş
spacingBefore
ő *m `[ö Y
` `e m [f
ş
spacingAfter
ő *m `[ö Y
` e m [f
ş
indentationLeft
ş
indentationRight
ş
keepTogether
AJ
<p:paragraph alignment="justify">
This is a simple document. It isn't very fancy.
</p:paragraph>
<p:text>
€
Y
*m text J [[_ Z eJ ` Y
e YY[
f
J [ b C m Cà f
[ m outputText J _m J ž*| #`
ş
ő *m C[ ` Y[à *m _[[ àY
[[à ` C[ `J ZY
value
AJ
<p:paragraph>
The item costs <p:text value="#{product.price}">
<f:convertNumber type="currency" currencySymbol="$"/>
</p:text>
</p:paragraph>
<p:html>
€
Y
*m html J ž*| m ~€b
#`
©C©
hk
*Z ~€b J
ş
ő *m Z ` Y[à
value
AJ
<p:html value="This is HTML with &lt;b&gt;some markup&lt;/b&gt;." />
<p:html>
<h1>This is more complex HTML</h1>
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
</p:html>
<p:html>
<s:formattedText value="*This* is |Seam Text| as HTML.
</p:html>
<p:font>
It's very^cool^."
€
Y
*m e J e m e[ e ` e [[ Z f
e #`
ş
name
ő *m e ņ e ZY[6 COURIERņ HELVETICAņ TIMES ZAPFDINGBATS
ROMANņ SYMBOL
ş
size
ő *m Y č e m e
ş
style
ş
encoding
ő *m e à[ #à ` e 6 NORMALņ BOLDņ ITALICņ OBLIQUEņ UNDERLINEņ LINE-THROUGH
ő *m m
J
AJ
<p:font name="courier" style="bold" size="24">
<p:paragraph>My Title</p:paragraph>
</p:font>
<p:newPage>
€
Y
p:newPage
YJ `ö
AJ
<p:newPage />
©C©
ko
*Z ~€b J
<p:image>
€
Y
J m J ` `
[ e m [Ym e m _` YY[
Z f
J m value `
p:image
I
[ ` à
[[à J `à YY[
*m imageData ` Y
eà C[ `J ZY
_m C[ java.awt.Image `B
#`
ş
value
ő # m ZY `J YY[
fJ J
ş
rotation
ş
height
ş
width
ş
alignmentő
ş
alt
ş
indentationLeft
ş
indentationRight
ş
spacingBefore
ő *m e m J J
ő *m mJm e m J
ő *m _m e m J
*m [J e m J Æ ag)ņ
ů#[J [Ű e Y`[ C[Ç
ő #[C Z Y e m J
ő *m `[ö Y
` `e m [f
ş
spacingAfter
ő *m `[ö Y
` e m [f
ş
widthPercentage
ş
initialRotation
ş
dpi
ş
scalePercent
ş
wrap
ş
underlying
ő *m [J e
Æ Y
JÇ e
m J *m ` ZY J[ Y
J C[
_ Y
J C[ YJ Y Z à
[J Y
J
AJ
©C©
k
*Z ~€b J
<p:image value="/jboss.jpg" />
<p:image value="#{images.chart}" />
<p:anchor>
€
Y
e [
ö`[ [ö e YY m
e[[_J `6
p:anchor
#`
ş
name
ő *m e f
m ş
reference
ő *m m [ö e ö m
Y m m[ `J _m ŸͼŸ b ZY[ņ
Ÿͼ[öŸ e m Y _m name e link1
ö à [ ` e[[ AI Y e
m AJ
<p:listItem><p:anchor reference="#reason1">Reason 1</p:anchor></p:listItem>
...
<p:paragraph>
<p:anchor name="reason1">It's the quickest way to get "rich"</p:anchor>
...
</p:paragraph>
^2 œ _
<p:header>
€
Y
<p:footer>
*m p:header p:footer Y YC m `[à Y[
m e Z m YJ e J ņ _m
m Z
Y e m e YJ ž e [
m[ YY m Y e #`
©C©
ş
alignment
ő *m [J e m m½e `Z Æ ag)ņ ů#[J [Ű e [J C[f
Ç
ş
backgroundColor
ş
borderColor
ő *m `
öJ [ e m m½e
`Z Æ agņ ů¢[ [Ű e [ C[Ç
ő *m ` [ e m m½e `Z f
k)
*Z ~€b J
C[ ` ` J borderColorLeftņ borderColorRightņ
borderColorTop
borderColorBottomÆ f
agņ ů¢[ [Ű e [ C[Ç
ş
ő *m _m e m ` C[ ` ` Y
e J borderWidthLeftņ borderWidthRightņ borderWidthTop borderWidthBottom
borderWidth
AJ
<p:facet name="header">
<p:font size="12">
<p:footer borderWidthTop="1" borderColorTop="blue"
borderWidthBottom="0" alignment="center">
Why Seam? [<p:pageNumber />]
</p:footer>
</p:font>
</f:facet>
<p:pageNumber>
€
Y
*m YJ ` ` Y[
e m ef
J m p:pageNumber J *m YJ ` J [à `
m Z e m e [à ` AJ
<p:footer borderWidthTop="1" borderColorTop="blue"
borderWidthBottom="0" alignment="center">
Why Seam? [<p:pageNumber />]
</p:footer>
^S <p:chapter>
€
Y
<p:section>
e m J e[[_ `ö½
[ ņ m
p:chapter p:section J ` YC m à
[à ` e mYņ ` mà
à ` `[à Y | ~€b C_ YC à
CJ `_ mY #`
ş
©C©
ő *m [J e m m½e `Z Æ ag)ņ ů#[J [Ű e [J C[f
Ç
alignment
k+
*Z ~€b J
ş
number
ő *m mY ` ^Cà mY m[ ` J mY `
ş
numberDepth
ő *m Ym e `J e #[[ ` [C m J mY½
*m em e e m e e mY m
_[ ` +Qņ e Y[à m e[ `
Ym e m * m mY `ņ ` Ym e
) m[ ` m ņ m ` _[ `
Y[à Q
AJ
<p:document xmlns:p="http://jboss.com/products/seam/pdf"
title="Hello">
<p:chapter number="1">
<p:title><p:paragraph>Hello</p:paragraph></p:title>
<p:paragraph>Hello #{user.name}!</p:paragraph>
</p:chapter>
<p:chapter number="2">
<p:title><p:paragraph>Goodbye</p:paragraph></p:title>
<p:paragraph>Goodbye #{user.name}.</p:paragraph>
</p:chapter>
</p:document>
<p:header>
€
Y
#à mY p:title *m [ _[[ `
Y[à Z m mY½
` *m `à e m
[ à _ Z à ` p:paragraph
^[ Ÿ
` Y[à J m p:list p:listItem J à `[àf `[ à ` e [ m e[[_J
m ui:repeat J Y[à [ e C[ C e f
Y
<p:document xmlns:p="http://jboss.com/products/seam/pdf"
xmlns:ui="http://java.sun.com/jsf/facelets"
title="Hello">
<p:list style="numbered">
<ui:repeat value="#{documents}" var="doc">
<p:listItem>#{doc.name}</p:listItem>
</ui:repeat>
</p:list>
</p:document>
©C©
kQ
*Z ~€b J
<p:list>
#`
ş
style
ő *m J½`[[J à[ e [  e6 NUMBEREDņ
LETTEREDņ GREEKņ ROMANņ ZAPFDINGBATSņ ZAPFDINGBATS_NUMBER e à[ JCņ m [ `[[
ş
listSymbol
ş
indent
ş
lowerCase
ş
charNumber
ş
numberType
ő b `[[ [ņ Y
e m `[[ à`[
ő *m [C[ e m [
ő b [ à[ J [ņ _mm
m [ m[ ` [_ ő b ͽ#~b€ùó#*ņ m m
e
m `[[ m
ő b ͽ#~b€ùó#*͘ùA|^Iņ m `J
à[
AJ
<p:list style="numbered">
<ui:repeat value="#{documents}" var="doc">
<p:listItem>#{doc.name}</p:listItem>
</ui:repeat>
</p:list>
<p:listItem>
€
Y
p:listItem
YY m e[[_J `6
#`
ş
alignment
ő *m [J e m m½e `Z Æ ag)ņ ů#[J [Ű e [J C[f
Ç
ş
alignment
ş
indentationLeft
ş
indentationRight
ş
listSymbol
ő *m [J e m [ Æ
ag)ņ ů#[J [Ű e Y`[ C[Ç
f
ő *m [e ő *m Jm ő C m e[ [ à`[ e m [
AJ
...
©C©
k\
*Z ~€b J
^^ *`[ ` J m p:table p:cell J A[ö à `[
ņ m ZY[
_ [ e `[ m + [ņ m Cà +
[[ _[[ [[à e _ ž e _ ` [ņ m
m e _[[ ` Y m C `[ Y [Y[ YJ
<p:table>
€
Y
p:table
YY m e[[_J `
#`
ş
columns
ő *m ` e [ Æ
[[Ç m ö Y `[
_
ş
widths
ő *m [C _m e m [ *m m[ `
C[ e m [ b ZY[6 _m̾Ÿ) Ÿ _[
m m + [ m e [ m[
` _
m č e m m [
ş
headerRows
ş
footerRows
ş
widthPercentage
ő *m [ ` e _ _m
m ` m e _ m[ ` Y e m `[
Y [Y[ YJ
ő *m ` e _ m ` ef
_ *m C[ `
e m headerRows C[ e
m ) _ _m
m ö Y m m _ m
ö Y m eņ headerRows m[ ` + footerRows m[ ` ő *m Y
J e m YJ _m m m f
`[ Y
ş
horizontalAlignment
ő *m mč[ [J e m `[
Æ ag)ņ ů#[J [Ű e Y`[ C[f
Ç
ş
skipFirstHeader
ş
runDirection
ş
lockedWidth
ş
splitRows
ş
spacingBefore
ő *m `[ö Y
` `e m [f
ş
spacingAfter
ő *m `[ö Y
` e m [f
©C©
ka
*Z ~€b J
ş
extendLastRow
ş
headersInEvent
ş
splitLate
ş
keepTogether
AJ
<p:table columns="3" headerRows="1">
<p:cell>name</p:cell>
<p:cell>owner</p:cell>
<p:cell>size</p:cell>
<ui:repeat value="#{documents}" var="doc">
<p:cell>#{doc.name}</p:cell>
<p:cell>#{doc.user.name}</p:cell>
<p:cell>#{doc.size}</p:cell>
</ui:repeat>
</p:table>
<p:cell>
€
Y
p:cell
YY m e[[_J `
#`
©C©
ş
colspan
ő ¢[[ Y m [ `à [J colspan J m *`[ mC m `[à Y
[Y[ _
ş
horizontalAlignment
ş
verticalAlignment
ş
padding
ş
useBorderPadding
ş
leading
ş
multipliedLeading
ş
indent
ş
verticalAlignment
ş
extraParagraphSpace
ő *m mč[ [J e m [[
Æ ag)ņ ů#[J [Ű e Y`[ C[f
Ç
ő *m C
[ [J e m [[ Æ
ag)ņ ů#[J [Ű e Y`[ C[Ç
ő ~J JC [ ` Y
e J
paddingLeftņ paddingRightņ paddingTop paddingBottom
kg
*Z ~€b J
ş
fixedHeight
ş
noWrap
ş
minimumHeight
ş
followingIndent
ş
rightIndent
ş
spaceCharRatio
ş
runDirection
ş
arabicOptions
ş
useAscender
ş
grayFill
ş
rotation
AJ
<p:cell>...</p:cell>
^b } *m e m m `à ` [Y[ J
^b ›
à YY e[[ [ Y
e
¢[àņ [à [f
YY *mà 6 whiteņ grayņ lightgrayņ darkgrayņ blackņ redņ pinkņ yellowņ
greenņ magentaņ cyan blue
^b1 + ›
]m [J C[ ņ m ~€b YY m e[[_J mč[ [J
C[6 leftņ rightņ centerņ justify justifyall *m C
[ [J C[ topņ
middleņ bottomņ baseline
^c  Ä
€
J _ö e m `Z _m [ eJ ž_Cņ m e_ Y e eJ m e YY[
f
*m e[ Y[ C ~€b e J
AI ņ /seam-doc.seam |à
©C©
kh
*Z ~€b J
`_ Æ Ç _[ Ye AI m m [ ~€b [ö /
myDocument.pdf *m Y`[à Ė eJ * C ~€b e[ņ [[ ;Ye
m[ ` YY m C[ b[ m €
C[6
<filter>
<filter-name>Seam Servlet Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamServletFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Servlet Filter</filter-name>
<url-pattern>*.pdf</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>Document Store Servlet</servlet-name>
<servlet-class>org.jboss.seam.pdf.DocumentStoreServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Document Store Servlet</servlet-name>
<url-pattern>*.pdf</url-pattern>
</servlet-mapping>
*m useExtensions Y m Y Y[ m e
[à `à
J m J AI _m m e[ Z e
m àY `J J
<components xmlns="http://jboss.com/products/seam/components"
xmlns:pdf="http://jboss.com/products/seam/pdf">
<pdf:documentStore useExtensions="true" />
</components>
ó C Y _[[ ZY _m m Cf
# m Yņ e
m _[[ ` C[ * Ő Y
eà
e[ C_ ` m_ _m Z J m errorPage YYà e
m <pdf:documentStore useExtensions="true" errorPage="/pdfMissing.seam" />
^1 
¢mJ YY [ YC _m jboss-seam-pdf.jar ¢m ` ~€b f
` J ž*| YJ ¢mJ Ė m b¢m [`à
Æjfreechart.jar jcommon.jarÇ ` m WEB-INF/lib à *m àY e
m [à YY6 Y mņ ` m [ m
<p:barchart>
€
Y
€Y[à ` m
#`
ş
©C©
ő ¢[ _mm ` Y[à
m m
borderVisible
kk
*Z ~€b J
ş
borderPaint
ő *m [ e m `ņ e C`[̽
ş
borderBackgroundPaint
ő *m e[ `
öJ [ e m
m
ş
borderStroke
ő
ş
domainAxisLabel
ő *m Z [`[ e m Z
ş
domainAxisPaint
ő *m [ e m Z [`[
ş
domainGridlinesVisibleő
ş
domainGridlinePaintő
¢[ _mm J[ e
m Z m_ m m
*m [ e m J[ņ e Cf
`[
ş
domainGridlineStroke
ő
J[ņ e C`[
ş
height
ş
width
ş
is3D
ş
legend
ş
legendItemPaintő
*m
ö
à[
e
m
ő *m mJm e m m
ő *m _m e m m
ő # `[ C[ J m m m m[ `
+€ e )€
ő # `[ C[ J _mm m m
m[ [ [J
*m e[ [ e m Z [`[ m
[J
ş
legendItemBackgoundPaintő
*m `
öJ [ e m [Jņ
e ee e m m `
öJ [
ş
orientation
ş
plotBackgroundPaintő
ş
plotBackgroundAlphaő
ş
plotForegroundAlphaő
ş
plotOutlinePaintő
*m [ e m J J[ņ e C`[
ş
plotOutlineStroke
ő *m ö à[ e m J J[ņ
ő *m e m Y[ņ m vertical Æm
e[Ç horizontal
*m [ e m Y[ `
öJ
*m [Ym ÆY
àÇ [C[ e m Y[
`
öJ m[ ` ` `_ o Æ
Y[[à f
YÇ Æ
Y[[à YĖÇ
*m [Ym ÆY
àÇ [C[ e m
Y[ m[ ` ` `_ o Æ
Y[[à YÇ
Æ
Y[[à YĖÇ
e C`[
©C©
)oo
*Z ~€b J
ş
rangeAxisLabel
ő *m Z [`[ e m J Z
ş
rangeAxisPaint
ő *m [ e m J Z [`[
ş
rangeGridlinesVisibleő
ş
rangeGridlinePaintő
¢[ _mm J[ e
m J Z m_ m m
*m [ e m J J[ņ e Cf
`[
ş
rangeGridlineStroke
ő *m ö à[ e m J J[ņ
e C`[
ş
title
ő *m m [ Z
ş
titlePaintő
ş
titleBackgroundPaintő
*m [ e m m [ Z
*m `
öJ [ m m
[
ş
width
ő *m _m e m m
AJ
<p:barchart title="Bar Chart" legend="true"
width="500" height="500">
<p:series key="Last Year">
<p:data columnKey="Joe" value="100" />
<p:data columnKey="Bob" value="120" />
</p:series>
<p:series key="This Year">
<p:data columnKey="Joe" value="125" />
<p:data columnKey="Bob" value="115" />
</p:series>
</p:barchart>
<p:linechart>
€
Y
€Y[à [ m
#`
ş
borderVisible
ő ¢[ _mm ` Y[à
m m
ş
borderPaint
ş
borderBackgroundPaint
ő *m [ e m `ņ e C`[̽
ő *m e[ `
öJ [ e m
m
ş
©C©
borderStroke
ő
)o
*Z ~€b J
ş
domainAxisLabel
ő *m Z [`[ e m Z
ş
domainAxisPaint
ő *m [ e m Z [`[
ş
domainGridlinesVisibleő
ş
domainGridlinePaintő
¢[ _mm J[ e
m Z m_ m m
*m [ e m J[ņ e Cf
`[
ş
domainGridlineStroke
ő
J[ņ e C`[
ş
height
ş
width
ş
is3D
ş
legend
ş
legendItemPaintő
*m
ö
à[
e
m
ő *m mJm e m m
ő *m _m e m m
ő # `[ C[ J m m m m[ `
+€ e )€
ő # `[ C[ J _mm m m
m[ [ [J
*m e[ [ e m Z [`[ m
[J
ş
legendItemBackgoundPaintő
*m `
öJ [ e m [Jņ
e ee e m m `
öJ [
ş
orientation
ş
plotBackgroundPaintő
ş
plotBackgroundAlphaő
ş
plotForegroundAlphaő
ş
plotOutlinePaintő
*m [ e m J J[ņ e C`[
ş
plotOutlineStroke
ő *m ö à[ e m J J[ņ
ő *m e m Y[ņ m vertical Æm
e[Ç horizontal
*m [ e m Y[ `
öJ
*m [Ym ÆY
àÇ [C[ e m Y[
`
öJ m[ ` ` `_ o Æ
Y[[à f
YÇ Æ
Y[[à YĖÇ
*m [Ym ÆY
àÇ [C[ e m
Y[ m[ ` ` `_ o Æ
Y[[à YÇ
Æ
Y[[à YĖÇ
e C`[
©C©
ş
rangeAxisLabel
ő *m Z [`[ e m J Z
ş
rangeAxisPaint
ő *m [ e m J Z [`[
ş
rangeGridlinesVisibleő
¢[ _mm J[ e
m J Z m_ m m
)o)
*Z ~€b J
ş
rangeGridlinePaintő
*m [ e m J J[ņ e Cf
`[
ş
rangeGridlineStroke
ő *m ö à[ e m J J[ņ
e C`[
ş
title
ő *m m [ Z
ş
titlePaintő
ş
titleBackgroundPaintő
*m [ e m m [ Z
*m `
öJ [ m m
[
ş
ő *m _m e m m
width
AJ
<p:linechart title="Line Chart"
width="500" height="500">
<p:series key="Prices">
<p:data columnKey="2003" value="7.36" />
<p:data columnKey="2004" value="11.50" />
<p:data columnKey="2005" value="34.625" />
<p:data columnKey="2006" value="76.30" />
<p:data columnKey="2007" value="85.05" />
</p:series>
</p:linechart>
<p:piechart>
€
Y
€Y[à Y m
#`
©C©
ş
titleő
*m m [ Z
ş
labelő
*m e[ [`[ Z e Y ş
legendő
ş
is3Dő#
ş
labelLinkMarginő
ş
labelLinkPaintő
ş
labelLinkStrokeő
ş
labelLinksVisibleő
# `[ C[ J _mm m m
m[ [ [J €e[ C[ `[ C[ J m m m m[ `
+€ e )€
*m [ö J e [`[
*m Y e m [`[ [öJ [
m ö e m [`[ [öJ [
# e[J m [ _mm m [f
`[ [ö _
)o+
*Z ~€b J
ş
labelOutlinePaintő
*m Y _ m [ e m
[`[
ş
labelOutlineStrokeő
*m ö _ m [ e m
[`[
ş
labelShadowPaintő
*m Y _ m m_ e m
[`[
ş
labelPaintő
*m [ _ m [`[
ş
labelGapő
ş
labelBackgroundPaintő
ş
startAngleő
ş
circularő
ş
directionő
ş
sectionOutlinePaintő
ş
sectionOutlineStrokeő
ş
sectionOutlinesVisibleő
ş
baseSectionOutlinePaintő
ş
baseSectionPaintő
ş
baseSectionOutlineStrokeő
*m JY `_ m [`[ m Y[ Y
f
J e m Y[ _m
*m [ _ m `
öJ e
m [`[ e m [[ņ m `
öJ e[[
*m J J[ e m e # `[ C[ J m m m m[ `
_ [ e e[ņ m m _ [[Y
*m e[ *m m Y _  e6
clockwise anticlockwise *m e[ clockwise
*m [ Y e [[ *m [ ö e [[ _mm [ _
e m m Y[
*m ` [ Y
*m ` Y
*m ` [ ö
AJ
<p:piechart title="Pie Chart" circular="false" direction="anticlockwise"
startAngle="30" labelGap="0.1" labelLinkPaint="red">
<p:series key="Prices">
<p:data key="2003" columnKey="2003" value="7.36" />
<p:data key="2004" columnKey="2004" value="11.50" />
<p:data key="2005" columnKey="2005" value="34.625" />
<p:data key="2006" columnKey="2006" value="76.30" />
<p:data key="2007" columnKey="2007" value="85.05" />
</p:series>
</p:piechart>
©C©
)oQ
*Z ~€b J
<p:series>
€
Y
¢Jà ` `ö _ *m J Jč e _m YY[à à[J
m #`
ş
key
ő *m ş
seriesPaint
ş
seriesOutlinePaint
ő *m [ e m m ő *m [ [ e m m
ş
seriesOutlineStroke
ő *m ö _ m m
ş
seriesVisible
ő # `[ J e m m[ `
Y[à
ş
ő # `[ J e m m[ ` [ m [J
seriesVisibleInLegend
AJ
<p:series key="data1">
<ui:repeat value="#{data.pieData1}" var="item">
<p:data columnKey="#{item.name}" value="#{item.value}" />
</ui:repeat>
</p:series>
<p:data>
€
Y
*m J ` m Y ` Y[à m
JYm
#`
ş
key
ő *m e m ş
series
ő
*m
ņ
_m
`
<p:series>
©C©
ş
value
ő *m C[
ş
explodedPercent
ş
sectionOutlinePaint
ő b Y mņ m_ ZY[ e
m Y Y
ő b ` mņ m [ e m )o\
*Z ~€b J
[
ş
sectionOutlineStroke
ő b ` mņ m ö àY e m
[
ş
sectionPaint
ő b ` mņ m [ e m AJ
<p:data key="foo" value="20" sectionPaint="#111111"
explodedPercent=".2" />
<p:data key="bar" value="30" sectionPaint="#333333" />
<p:data key="baz" value="40" sectionPaint="#555555"
sectionOutlineStroke="my-dot-style" />
<p:color>
€
Y
*m [ Y [ [ J m ` ef
_m _J e[[ mY
#`
ş
color
ő *m [ C[ b J [ņ m m J
[ agņ ů¢[ [Ű
ş
color2
ş
point
ő *m f _m m J [ `J
ş
point2
ő *m f _m m J [ ő b J [ņ m m [ m m
J
AJ
<p:color id="foo" color="#0ff00f"/>
<p:color id="bar" color="#ff00ff" color2="#00ff00"
point="50 50" point2="300 300"/>
<p:stroke>
€
Y
€
` ö _ [ m
#`
ş
width
ş
cap
ő *m _m e m ö
ő *m [ Y àY [ C[ buttņ round square
©C©
)oa
*Z ~€b J
ş
join
ő *m [ B àY [ C[ miterņ round bevel
ş
miterLimit
ő b Bņ m C[ m [ e m
č e m B
ş
dash
ş
dashPhase
ő *m m C[ m m Y ` _
m [ *m Y
Y J m [Jm e
m [J _ _ J
ő *m m Ym m ee m m
Y m m m [ m[ ` _ _m
AJ
<p:stroke id="dot2" width="2" cap="round" join="bevel" dash="2 3" />
^2 *Z J `
_ Cà e e *m `
` ` ~€b Y[à J _` YJ ù m _m _m ž*| Jņ `
[à Y[à `
Z m `
<p:barCode>
€
Y
€Y[à `
J
#`
ş
type
ő # `
àY YY `à *Z [ C[ f
[6 EAN13ņ EAN8ņ UPCAņ UPCEņ SUPP2ņ SUPP5ņ POSTNETņ PLANETņ
CODE128ņ CODE128_UCCņ CODE128_RAW CODABAR
ş
codeő
*m C[ ` `à m `
ş
xposő
b ~€bņ m `[ à Y e m `
m
YJ
ş
yposő
b ~€bņ m `[ à Y e m `
m
YJ
ş
ő b ~€bņ m e
e m `
rotDegrees
J
©C©
ş
barHeight
ő *m mJm e m ` m `¢
ş
minBarWidth
ő *m ` _m
)og
*Z ~€b J
ş
barMultiplier
ő *m ` [Y[ e _ ` m f
`_ ` e POSTNET PLANET ş
barColor
ş
textColor
ş
textSize
ş
altText
ő *m [ _ m `
ő *m [ e à Z m `
ő *m č e m `
Zņ e à
ő *m alt Z e ž*| J [ö
AJ
<p:barCode type="code128"
barHeight="80"
textSize="20"
code="(10)45566(17)040301"
codeType="code128_ucc"
altText="My BarCode" />
^S j ēº+\ _ YC ZY[ YY e J _J Y ~€b f
J _J [ö e[ YYņ `[à m C _Jņ _[[ [à
<p:swing>
€
Y
I _J Y ~€b #`
ş
width
ő *m _m e m Y ` ş
height
ş
component
ő *m mJm e m Y ` ő # ZY _m C[ _J #]* Yf
AJ
<p:swing width="310" height="120" component="#{aButton}" />
^[ _ ©C©
)oh
*Z ~€b J
b em e *Zņ 6
ş
*Z ž ~J ŬmY6½½___[_J
½*Z½ŭ
ş
*Z #
ŬmY6½½___J
½[_J½ŭ
©C©
)ok
b ]
Ž
&ɍħë«ì,Dp³£&Ċ45;RSsġŖò¬«"vûŖ´ŗ
^[
&RŽ
jboss-seam-mail.jar
ŽÂ&p³š£ñò¬Â
b
•=;RSsġŖòŖ´ŗ
«ûƿǀñòŖ´ŗ
;Kë«ì
Œ&
[
#I
mailSession
ZY[½[ K‚PGŽ'(tuv—Å£ [ R&sġŖò2°Ŗ´ŗ
Ţ¯°âF3‚ä&ēĔ(°n
ŖœǹǰRñò2°¬Ơ’vķu'ęz´s°ţÖºġŖò2°Ŗ´ŗ
Ő [ à [ė J ė J J C f
++++ņ ůJ *J |[Ű
b ¿JI'k°±©
|[ š"œ1,Dp³£&®¯°Ə˛ͿȦ}̍ʻŲ’ŽµûŖĿŻ ő [
Žſȩ e
[ vûŖ´ŗ
<m:message xmlns="http://www.w3.org/1999/xhtml"
xmlns:m="http://jboss.com/products/seam/mail"
xmlns:h="http://java.sun.com/jsf/html">
<m:from name="Peter" address="[email protected]" />
<m:to name="#{person.firstname} #{person.lastname}">#{person.address}</m:to>
<m:subject>Try out Seam!</m:subject>
<m:body>
<p><h:outputText value="Dear #{person.firstname}" />,</p>
<p>You can try out Seam by visiting
<a href="http://labs.jboss.com/jbossseam">http://labs.jboss.com/jbossseam</a>.</p>
<p>Regards,</p>
<p>Pete</p>
</m:body>
</m:message>
N™ŽÂFE‚ŹȔ̿Øn
&Dĕ™ôª´¬«"Ɠz¯Ŗ´ŗ
<m:message>
ÂFE‚&ɍħ˵&cd <m:from> N™n ɍħĨ&Ɠd <m:to>
q°¬&%!òżœ
^ &š£ēĔơƬ¯2ţŦñ°Çn
N™š£¯Ŗ´ŗ
<m:message>
Ž
[
&ÿ—@̿ØŖ´ŗ
;RSqš£´¬Œ}s%ÞŖ´ŗ
<m:body>
ž*| 
N™
Ŗœ
[
N™q%Žn
ÆĻļ&e
[
<m:subject>
ޱN™ÿ—@qĝ
b
Θ%
[
,D&%Þµsû%´ŗ
ɍħēĔÖ°2%´sn
m:message
&Dĕ™&šŶn
mailSession
s
[
ɍħ´¬«";ñò¬&%n
78s´ƚÞŒ}Ž !&lDĕ™´¬«"ƼÕ´¬ŦŨ%´ŗ
@In(create=true)
private Renderer renderer;
©C©
)o
^[
public void send() {
try {
renderer.render("/simple.xhtml");
facesMessages.add("Email sent successfully");
}
catch (Exception e) {
facesMessages.add("Email sending failed: " + e.getMessage());
}
}
œ}ýũn
ȳîv
[
!&èésÃĭFñò278ĚzñòŖ´ŗ
<D-Ūū´¬}èésƥɅ»òn
b ĢÜ
%Ž
[
ǵ&OáMģÝsrƱv›2°Ŗ´ŗ
OáMɕp´¬ęš£ñò¬Ƒƒ BC NM&ź}ŻŠ“ż¯2°Ŗ´ŗ
jboss-seam-mail.jar
 [ ɍħ¯œ°ŷĆn
<m:attachment value="/WEB-INF/lib/jboss-seam-mail.jar"/>
ŽOáMGH-â-º»K<¯2n
[
!&OáMģݯŖ´ŗ
—O¶%Žn jboss-seam-mail.jar }°"Ò­%ģÝñòŖ´ŗ Ɛ&Ò­¯œ°ŷƎ fileName ƙĬǣǤ´¬ŦŨ%´ŗ
<m:attachment value="/WEB-INF/lib/jboss-seam-mail.jar" fileName="this-is-so-cool.jar"/>
java.io.Fileņ java.net.URL
ģÝ´¬Œ}Ŕ%ÞŖ´ŗ
<m:attachment value="#{numbers}"/>
ŖœŽn byte[] µ¬°Ž java.io.InputStream
<m:attachment value="#{person.photo}" contentType="image/png"/>
}
java.io.InputStream
“¯2ŽģÝ&
||^
NMƓd´¬Ų’sµ¬&sľºûŖ´ ÆŒ&ȟȠŽOáM&wĥ}¯2ijľòv°œ1Çŗ
byte[]
ñ»ưĮvŒ}n š£´¬Ļļ&N™&­Ŷ <m:attachment>
²³ ~€b ĝƑƒ b l ģÝ´¬Œ}s%ÞŖ´ŗ
%HF´¬ŦŨ%
<m:attachment fileName="tiny.pdf">
<p:document>
A very tiny PDF
</p:document>
</m:attachment>
ģݯœ°OáMw¿sɻ˵µ¬ŷĆ
<ui:repeat> š"ŦŨ%ģÝ%ÞŖ´ŗ
Æèn
—N¹-º»K<¯œ΀ɬw¿Çn
<ui:repeat value="#{people}" var="person">
<m:attachment value="#{person.photo}" contentType="image/jpeg" fileName="#{person.firstname}_#{per
</ui:repeat>
©C©
)
^[
# e à _ Y[à m J [6
<m:attachment
value="#{person.photo}"
contentType="image/jpeg"
fileName="#{person.firstname}_#{person.lastname}.jpg"
status="personPhoto"
disposition="inline" />
<img src="cid:#{personPhoto.contentId}" />
Ő à ` _J _m cid:#{...} ][[ņ m ^*b Y
e m `à YJ m
m e à Jņ m m _[[ ` [ö _m àJ [
m
J Æm Content-IDė mÇ ő J
Ņ
Ő [ m m `e àJ m `B
b1 œzŸºÄ ģøĤ¾
ɭĵ%Žn
ź}ŻŠ&Â78Ž
ž*| “ż¯2°¬vºn
“ż¯2°v°78Ŕ°Ŗ´ŗ
Œ&œ1n
&ÿ—@Ĥü}v¬D,Ã-ǣǤ´¬Œ}s%ÞŖ´ŗ
ž*| [
<m:body>
<f:facet name="alternative">Sorry, your email reader can't show our fancy email,
please go to http://labs.jboss.com/jbossseam to explore Seam.</f:facet>
</m:body>
b2 Ӏ.ĥĦħ
[
ԃ&ɍħĨ™ɍħ´¬Ų’sµ¬Œ}ŔǙvţµûŖĿŻ
Æ78™vŠ ŗ ĦħĨÂN™Ž´ƚ2 <ui:repeat> qTǞ´¬Œ}s%ÞŖ´ŗ
<ui:repeat value="#{allUsers} var="user">
<m:to name="#{user.firstname} #{user.lastname}" address="#{user.emailAddress}" />
</ui:repeat>
bS Ӏ.¿JI
œŦ¯n
ͮͯɂv¬qr&ÂFE‚ŚĦħmñɍħ´¬Ų’sµ¬ŷĆŔµûŖ´
Æâ-ð<&EFvŠÇŗ
šǃvēĔ}¯2Žn
ÂFE‚ŹȔ
<ui:repeat>
qTǞ´¬Œ}%´ŗ
<ui:repeat value="#{people}" var="p">
<m:message>
<m:from name="#{person.firstname} #{person.lastname}">#{person.address}</m:from>
<m:to name="#{p.firstname}">#{p.address}</m:to>
...
</m:message>
</ui:repeat>
b[ 3%&H
.k°
Â&,Dp³è%Žn
©C©
e
[
,DŽ
))
^[
ÂN™%Ţ¯ţ/p´¬Œ}z¯2°Ŗ´ŗ
B`J & template.xhtml ŽŧsġŖò2°Ŗ´ŗ
<m:message>
<m:from name="Seam" address="[email protected]" />
<m:to name="#{person.firstname} #{person.lastname}">#{person.address}</m:to>
<m:subject>#{subject}</m:subject>
<m:body>
<html>
<body>
<ui:insert name="body">This is the default body, specified by the template.</ui:insert>
</body>
</html>
</m:body>
</m:message>
B`J & templating.xhtml ŽŧsġŖò2°Ŗ´ŗ
<ui:param name="subject" value="Templating with Seam Mail"/>
<ui:define name="body">
<p>This example demonstrates that you can easily use <i>facelets templating</i> in email!</p>
</ui:define>
Ő [ e
[ J à [ņ ` à Y[
m B WEB-INF/lib f e
J m .taglib.xml e web.xml ė [`[ _m J |[
Æe à à [ à
m[à |[ ė mC m e[[ b C[ Zņ ė ö_ ` web.xml eJ YÇ
e à eJ b
[ b _m J [ņ àė[[ C
m I Y m eJ YJ
[[à f [à e C
Ņ
b^ ėĘâ
ŽĘęäÂFE‚&ɍħ“ż¯2°Ŗ´ŗ
—O¶%Žn
b
%ƿǀñò¬?;—@™sš£ñòŖ´sn ,D%$ɆÞ´¬Œ}s%ÞŖ´ŗ
<m:message charset="UTF-8">
...
</m:message>
ÿ—@n
ÜÒn
!¯2ĦħĨÒ}ɍħĨҎ;<äñòŖ´ŗ
,D&?;—@™cd¯2
e
[
sŢ¯°Ġ„EF‚>΁š£´¬«"Ťť´¬Ų’sµûŖ´ŗ
<?xml version="1.0" encoding="UTF-8"?>
bb ).Ĩ.ĩJĒ
!&ĩ&ĪFĕ
[
ǣǤ¯œ°Œ}sµûŖ´ŗ
s“ż¯2°¬Ŕ&s°ţÖºµûŖ´ Æ
g\ņ ůN™Ű ȺȻÇŗ œ}ýũn [
&Ƣ’Ƃcd´¬Œ}s%ÞŖ´ŗ
<m:message xmlns:m="http://jboss.com/products/seam/mail"
©C©
)+
^[
importance="low"
requestReadReceipt="true"/>
Œòśén <m:header> N™š›2ÂFE‚µ»Ƈ¬ĪFĕǣǤ´¬Œ}s%ÞŖ´ŗ
<m:header name="X-Sent-From" value="JBoss Seam"/>
b1 'ĥĦ±©
e à J ^ m à |€ Æ|J €C Ç C [ YC ¢# Y ő mail-ra.rar ő ` m C ` _m # m ` e [ Æ ė `[ CÇ me _ J
m mail-ra.rar ` _m Æė m mail à m
`[Ç mail-ra.rar m[ ` Y[
$JBOSS_HOME/server/default/deploy̽ e m
C e # à [à m m e[ņ Y[
ŧ&«"cd´¬Œ}s%ÞŖ´ŗ
@MessageDriven(activationConfig={
@ActivationConfigProperty(propertyName="mailServer", propertyValue="localhost"),
@ActivationConfigProperty(propertyName="mailFolder", propertyValue="INBOX"),
@ActivationConfigProperty(propertyName="storeProtocol", propertyValue="pop3"),
@ActivationConfigProperty(propertyName="userName", propertyValue="seam"),
@ActivationConfigProperty(propertyName="password", propertyValue="seam")
})
@ResourceAdapter("mail-ra.rar")
@Name("mailListener")
public class MailListenerMDB implements MailListener {
@In(create=true)
private OrderProcessor orderProcessor;
public void onMessage(Message message) {
// Process the message
orderProcessor.process(message.getSubject());
}
}
Ħħ´¬ŚÂFE‚«ûn onMessage(Message message) s;ñò¬Œ}vûŖ´ŗ
ź}ŻŠ&
ï,45Ž
|€
q%/p¯Ŗ´sn
ij;,Ã-ŽGE-¯v°%ţŦñ°ŗ
Ő
e
e
Y6½½_öB`J½_ö½]öBYćYJ̾`C|[
mail-ra.rar
mf
e à ė J # à [[ mail-ra.rar à à e à YY[
f
C [ [ Y
b2 `a
345 ^[ RġŖĿ¬Žn ]^fùb½[` —@DGq jbossseam-mail.jar
ġŖĿŖ´ŗ
#
š£¯2°¬ŷƎn
&
[
Rš£´¬&ĞƐvcdŽŲ’µûŖĿŻŗ ŒòśéŽn C|[ #~ sµ¬ºn
©C©
)Q
^[
C|[ #~ s'Ɗñò2°¬º Æ # %š£ñò¬ #~ } Y[ Ž lib/mail.jar }¯2
}ƹTħñò¬Çn C #
C b_ö &;Čsµ¬º Ælib/activation.jar
}¯2 }ƹTħñò¬Ç Ťť´¬Ų’sµûŖ´ŗ
^[ łŽl,GïK‚}¯2 b
[ š£´¬Ų’sµûŖ´ŗ
HM–H&ɭŶ&˜‚5%Ž ~ &š£Ŕ“ż´¬tuĬsµûŖ´ŗ Ŗœn f
âF3‚&š£ŔŲ’}vûŖ´ŗ
mailSession
b2
;RSŽ C|[ š›2Đ'ę&đ |*~ ˜}˄ħ¯Ŗ´ŗ
mailSession
^^ ʼnŇ%pŘ¯2°¬n ŖœŽ cd& š£%Þ¬ŷĆn C|[ s ù€ FGFº»š£%Þ¬tuĬsµûŖ´ŗ
[
;RS&Kâ,@Ö°2&ȨãŽ
ůÂŋŌ&;RSŰ %ɾǂñò2°Ŗ´ŗ
+ohņ
b2 + . õ} #JK"J&
# deploy/mail-service.xml Ž ù€ ˜M<´¬ C|[ EF45cd¯Ŗ´ŗ
—O¶&l-cdŽš£¯2°¬SFðGż2ÈĸsŲ’}vûŖ´ŗ
l-Ö°2&ȨãŽ
mY6½½_öB`J½_ö½]öBYćYJ̾C|[
%ɾǂñò2°Ŗ´ŗ
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:mail="http://jboss.com/products/seam/mail">
<mail:mail-session session-jndi-name="java:/Mail"/>
</components>
ŒŒ%

ù€
˜œ<´¬ÂEF45IJǁ´¬«"Ɠz¯Ŗ´ŗ
º»
java:/Mail
b21 `a.I;<%
ÂEF45Ž components.xml º»cd´¬Œ}s%ÞŖ´ŗ
˜}¯2 smtp.example.com š£´¬«"Ɠz¯Ŗ´ŗ
ŒŒ%

Y
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:mail="http://jboss.com/products/seam/mail">
<mail:mail-session host="smtp.example.com"/>
</components>
bS zē
ė [ ZY[ |[_ Æe `J ŬmY6½½`JŭÇ [ C
|[_ JY_ Y
öJ m YC SMTPņ POP3ņ IMAPņ _`[ņ m [
©C©
)\
^[
JYm
[ [̽ ė _ ^^ YY[
` Y[à # [J à YY[
*m C e |[_ ` _m Æ m mail/buni-meldware e[Ç Yf
[[à [ e C[Y f [`Zņ [ Æ[ Ç f
Cà m YY[
Y[à e à _ |[_ Y
à
m[ [[ m [ [ e `J ŬmY6½½`Jŭ
* [`Zņ [ņ à m meldware Y6
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:mail="http://jboss.com/products/seam/mail">
<mail:mail-session host="smtp.example.com"/>
<mail:meldware>
<mail:users>
<value>#{duke}</value>
<value>#{root}</value>
</mail:users>
</mail:meldware>
<mail:meldware-user name="duke" username="duke" password="duke">
<mail:aliases>
<value>[email protected]</value>
<value>[email protected]</value>
</mail:aliases>
<mail:meldware-user name="root" username="root" password="root" administrator="true" />
</components>
ž _ėC _ ņ dukeņ _m m _ [ _m
m root
b[ P—
^[ Ž http://jboss.com/products/seam/mail Ò­--q%N™š›2²³ñòŖ´ŗ
<ЎļÂFE‚& message N™sµ¬ŽŴ%´ŗ ÂFE‚N™Ž
«¬ [ ²³&ƒU(°Ŗ´ŗ
*m Y[J J e e
[ ` [ m `à à à b J̽ e Ė Z[ Æà[mņ BC
YÇ
m ` m urlBase
õ6J÷
ÂÂFE‚&N™
ş
importance
ő [_ ǼÇn [ ÆŀÇn mJm ÆƁÇ &°ŴòºvûŖ´ŗ
—O¶%Ž [ ÆŀÇ vûn ŒòsÂÂFE‚&Ƣ’Ƃcd¯Ŗ´ŗ
ş
precedence
ş
requestReadReceipt
ő ÂFE‚&ÉÊƂcd¯Ŗ´ Æèn `[öÇŗ
ő
—O¶%Ž
e[
%´ŗ
cdñò¬}n
ĦħĻǘ&G?-sǣǤñò2 From: &<D-ĦħĻǘsɍħñòŖ´ŗ
©C©
)a
^[
ş
ő cdñò¬}n !&Ɯs requestContextPath &ÊɉǣǤñò [ q%
<h:graphicImage> vŠ&;RSš£%Þ¬«"vûŖ´ŗ
urlBase
õ6e÷
[
&
b6
<D-cd¯Ŗ´ŗ
Ö&ؚ£%ÞŖ´ŗ
ş
name
ş
address
[
“¯2ŧ&"nj°Ŵòº
“¯2ŧ&"nj°Ŵòº
ő [ &ɍħ˵&Ò­%´ŗ
ő [ &ɍħ˵& [ <D-%´ŗ
õ6Y[à*÷
[ & IY[àf6
Ö&ؚ£%ÞŖ´ŗ
ş
address
<D-cd¯Ŗ´ŗ
[
ő [ &ɍħ˵& [ <D-%´ŗ
õ6÷
[ ĦħĨǣǤ¯Ŗ´ŗ ĦħĨsԃ&ŷƎԃ& õ6÷
Œ&N™Ž õ6Y÷ vŠ&Njûĺ¯N™qTǞ¯2ŔɦŹ%´ŗ
ş
name
ş
address
N™š£¯Ŗ´ŗ
ő ĦħĨ&Ò­%´ŗ
ő ĦħĨ& [ <D-%´ŗ
õ6
÷
[  ¢¢ &ĦħĨǣǤ¯Ŗ´ŗ ¢¢ sԃ&ŷƎԃ& õ6
÷ N™š£¯Ŗ´ŗ
Œ&N™Ž õ6Y÷ vŠ&Njûĺ¯N™qTǞ¯2ŔɦŹ%´ŗ
ş
name
ő ĦħĨ&Ò­%´ŗ
ş
address
ő ĦħĨ& [ <D-%´ŗ
õ6`
÷
[

¢¢
&ĦħĨǣǤ¯Ŗ´ŗ
¢¢
sԃ&ŷƎԃ&
õ6`
÷
N™š£¯Ŗ´ŗ Œ&N™Ž õ6Y÷ vŠ&Njûĺ¯N™qTǞ¯2ŔɦŹ%´ŗ
ş
name
ő ĦħĨ&Ò­%´ŗ
ş
address
ő ĦħĨ& [ <D-%´ŗ
õ6m÷
[ ĪFĕǣǤ¯Ŗ´ Æèn X-Sent-From: JBoss SeamÇŗ
ş
name
ş
value
ő ǣǤ´¬ĪFĕÒ%´ Æèn X-Sent-FromÇŗ
ő ǣǤ´¬ĪFĕƜ%´ Æèn JBoss SeamÇŗ
õ6
m÷
©C©
)g
^[
[ ģÝǣǤ¯Ŗ´ŗ
ş
value
ő ģÝ´¬OáM%´ŗ
ş
String
ő String ŽGH-â-q&OáMǵ&â-}¯2>ͻñòŖ´ŗ
ş
java.io.File
ő ^ ¿s File Ċ–‚PGȺȻ%ÞŖ´ŗ
ş
java.net.URL
ő ^ ¿s URL Ċ–‚PGȺȻ%ÞŖ´ŗ
ş
java.io.InputStream
ş
byte[]
ő ^ ¿s InputStream ȺȻ%ÞŖ´ŗ Œ&ŷĆn fileName }
contentType &ƝēsƓdñòvŨòũvûŖĿŻŗ
ő ^ ¿s byte[] ȺȻ%ÞŖ´ŗ Œ&ŷĆn fileName } contentType
&ƝēsƓdñòvŨòũvûŖĿŻŗ
ƜƙĬsȇȈñò¬ŷĆn
ş
Œ&N™s
<p:document>
VWñò¬<ÃÂs²³ñò2
[
sƓdñòvŨòũvûŖĿŻŗ
ş
Œ&N™s!&ĩ&
b
<ÃÂs!Œº»²³ñò2
sƓdñò2°vŨòũvûŖĿŻŗ
ş
fileName
ş
contentType
N™ġŻ%°¬v»n
ģÝñòŖ´ŗ
fileName
N™ġŻ%°¬}n
[
ģÝñòŖ´ŗ
ž*| fileName
ő ģÝ´¬OáMš£´¬OáMÒƓd¯Ŗ´ŗ
ő ģÝñò¬OáM& ||^ NMƓd¯Ŗ´ŗ
õ6`B
÷
[ &ÜÒcd¯Ŗ´ŗ
õ6`à÷
[
&ÿ—@cd¯Ŗ´ŗ
ž*| [
“ż¯2°v°ĦŨIJûˬƿǀ´¬Ĥü,Ã-ġĢ
OáEFR¯2°Ŗ´ŗ
ş
s²³ñò¬ŷƐ
m[
alternative
ő plain cd´¬}D,Ã-& [ s²³ñòŖ´ŗ ŒòśéŽ ž*| [ s²³ñòŖ´ŗ
type
©C©
)h
c ĪÌĄīw¿JI%—
%Žn]`G?-“¯2īÍĈÐ=("Œ}sīļžſ%ÞŖ´ŗ
C
^^%&īÍĈĬ}°ýũnƾţ&ʥŽ|ȶ°΂ºƚ¬%¯Ƌ"ŗ
ŒòŽŤº%Œ&ƺƻK´¬ˠ}Ö&ēĔ%´ŗ!¯2˥˦%ǂŤvl-΃
˽&’Üsµ¬v»ũnŒòŽǃúvēĔ%´ŗ
%Žn;RSš›2žſ|ÂFE‚ɍĦħ%ÞŖ´ŗ
¯º¯ƾţ&7-3-%Ž|Ž˼΄%´ŗ
Ž4vīÍĈÂÚF<}M¹ķŋ—@-âFĭ&ǚǛż2DMˣä¯Ŗ´
ŗ
ş
java.util.concurrent.ScheduledThreadPoolExecutor
ş
m ^ C
Æe ^ +o ʼnŇ Ç
ş
Ēč
Æ —O¶ Ç
c ĪÌĄī
#à
m C m [[ mC m Ė[à e C
ZY
m
[àJ Y
m m *m e[ Y
mņ ` Y ScheduledThreadPoolExecutor Ye ee
[à ` YC YY e Y à
m
öņ m
J m ö _[[ C [[à ` Z
e àė _öf
J C m YY ^ +oņ m e[[_J [ components.xml6
<async:timer-service-dispatcher/>
m à à
m ö _[[ ` Y
`à m ė ^ C
e
àė e[ _m m * C
ņ ė _àņ à ė _m
[à e à _ à
m m *m Y mJ ö_
m à J ^ +o Y[ _[[ mC m Y e J Y ņ
_m
m JC J m m ö _[[ C[[à ` Y
#m [C m Y Ēč [`à J à
m mf
Ő `[ m Ēč [`à #I Æe m lib àÇ à ^#I
[ C [ application.xml ņ à m e[f
[_J [ components.xml [[ m Ēč Y
m
<async:quartz-dispatcher/>
*m #~ e m e[ ScheduledThreadPoolExecutorņ m ^+ Timerņ m Ēč
Scheduler [J[à m *mà B ŸY[J Y[àŸ `à J [ components.xml
c ĪÌĄ¿ÙJC
šŔſȩvºœnj%ŽnīÍĈƭìƗ¯ŽnÂÚF<ƭìƗ¯ƭìƗ¯ˬ“¯2īÍĈ
©C©
)k
īÍĈĬ}ÂFE‚™
Æɂv¬-DF<%Ç
Ð=ñĿ¬ŦŨ%´ŗ
΅ǔŽĻļnGHMʽʾD-R-ĺ¯nƢ°ƞɁ˜FG™Hœ<%Ð=ñĿœ
°ŷƐnīÍĈƭìƗ¯š°Ŗ´ŗ
Œ&âNŽnGHMsÐ=§¨˜ǵ¼/ŠR™%Þ¬«"vn##åš
£´¬345%}2Ŕ%´ŗ
^;RS%ŽnKLMNOP-ï,¯2ÂÚF<sīÍĈÐ=ñò
¬«"Ɠd¯Ŗ´ŗ
@Local
public interface PaymentHandler
{
@Asynchronous
public void processPayment(Payment payment);
}
ÆC
˂Ģv»;RS&'ƊGH-ï,´¬Œ}s%ÞŖ´Ç
;RS%Žn
īÍĈĬ&š£Ž`GH-̹˼Š%´ŗ
@Stateless
@Name("paymentHandler")
public class PaymentHandlerBean implements PaymentHandler
{
public void processPayment(Payment payment)
{
//do some work!
}
}
# [ Y m [6
@Stateful
@Name("paymentAction")
public class CreatePaymentAction
{
@In(create=true) PaymentHandler paymentHandler;
@In Bill bill;
public String pay()
{
paymentHandler.processPayment( new Payment(bill) );
return "success";
}
}
īÍĈÂÚF<ŽŸŹ®±&M¹;,Ã-%Ð=ñòn
ƭìƗ¯ˬ&EF45ŖœŽ“”;,Ã-&ƪƫŽGE-%ÞŖĿŻŗ
¯º¯l‚S-KE-;,Ã-ŽʋʌñòŖ´ŗ
īÍĈÂÚF<ƭìƗ¯Ž@Durationn@Expirationn
Ŷ&'(&œ1-3‚™%ÞŖ´ŗ
@IntervalDurationï,45š›2n
@Local
public interface PaymentHandler
{
@Asynchronous
public void processScheduledPayment(Payment payment, @Expiration Date date);
@Asynchronous
©C©
))o
īÍĈĬ}ÂFE‚™
public void processRecurringPayment(Payment payment,
@Expiration Date date,
@IntervalDuration Long interval)'
}
@Stateful
@Name("paymentAction")
public class CreatePaymentAction
{
@In(create=true) PaymentHandler paymentHandler;
@In Bill bill;
public String schedulePayment()
{
paymentHandler.processScheduledPayment( new Payment(bill), bill.getDueDate() );
return "success";
}
public String scheduleRecurringPayment()
{
paymentHandler.processRecurringPayment( new Payment(bill), bill.getDueDate(),
ONE_MONTH );
return "success";
}
}
m [ C à m Timer `B
_m m C
*m
Timer `B
m_ `[_ m ^+ _m à m ^+ Y
m b m f
e[ ScheduledThreadPoolExecutorņ m `B
Future e m €ʭ b m
Ēč Y
mņ QuartzTriggerHandleņ _m
m _ _[[ m Z f
@Local
public interface PaymentHandler
{
@Asynchronous
public Timer processScheduledPayment(Payment payment, @Expiration Date date);
}
@Stateless
@Name("paymentHandler")
public class PaymentHandlerBean implements PaymentHandler
{
@In Timer timer;
public Timer processScheduledPayment(Payment payment, @Expiration Date date)
{
//do some work!
return timer; //note that return value is completely ignored
}
}
@Stateful
@Name("paymentAction")
public class CreatePaymentAction
{
@In(create=true) PaymentHandler paymentHandler;
@In Bill bill;
public String schedulePayment()
{
Timer timer = paymentHandler.processScheduledPayment( new Payment(bill),
bill.getDueDate() );
©C©
))
īÍĈĬ}ÂFE‚™
return "success";
}
}
#à
m m à m C[ m [[
c1 +ĉ ē ďĊ }
*m Ēč Y
m Æ [ m_ [[ Ç [[_ à m
@Asynchronousņ @Durationņ @Expirationņ @IntervalDuration `C m Y_e[ [ e *m Ēč Y
m YY m _ f
*m @FinalExpiration Y
e e m J ö
// Defines the method in the "processor" component
@Asynchronous
public QuartzTriggerHandle schedulePayment(@Expiration Date when,
@IntervalDuration Long interval,
@FinalExpiration Date endDate,
Payment payment)
{
// do the repeating or long running task until endDate
}
... ...
// Schedule the task in the business logic processing code
// Starts now, repeats every hour, and ends on May 10th, 2010
Calendar cal = Calendar.getInstance ();
cal.set (2010, Calendar.MAY, 10);
processor.schedulePayment(new Date(), 60*60*1000, cal.getTime(), payment);
ù m m m m QuartzTriggerHandle `B
ņ _m
m à [ Yņ Yņ m m[ *m QuartzTriggerHandle `B
[č`[ņ à C m ` e à öY e Z Y e
QuartzTriggerHandle handle =
processor.schedulePayment(payment.getPaymentDate(),
payment.getPaymentCron(),
payment);
payment.setQuartzTriggerHandle( handle );
// Save payment to DB
// later ...
// Retrieve payment from DB
// Cancel the remaining scheduled tasks
payment.getQuartzTriggerHandle().cancel();
*m @IntervalCron YY AZ B` àZ e ö m[J b f
ņ m e[[_J à
m m )6oY )6QQY Cà ]à m m e |
m
// Define the method
@Asynchronous
public QuartzTriggerHandle schedulePayment(@Expiration Date when,
©C©
)))
īÍĈĬ}ÂFE‚™
@IntervalCron String cron,
Payment payment)
{
// do the repeating or long running task
}
... ...
// Schedule the task in the business logic processing code
QuartzTriggerHandle handle =
processor.schedulePayment(new Date(), "0 10,44 14 ? 3 WED", payment);
*m @IntervalBusinessDay YY C
m Ÿm €àŸ f
b ņ m e[[_J à
m m Q6oo m ) `
à e m m à e[ņ Z
[ [[ _ö A e[ m[à [
)oo e m ` à
// Define the method
@Asynchronous
public QuartzTriggerHandle schedulePayment(@Expiration Date when,
@IntervalBusinessDay NthBusinessDay nth,
Payment payment)
{
// do the repeating or long running task
}
... ...
// Schedule the task in the business logic processing code
QuartzTriggerHandle handle =
processor.schedulePayment(new Date(),
new NthBusinessDay(2, "14:00", WEEKLY), payment);
*m NthBusinessDay `B
m eJ e m C
JJ Ő Y
eà m[à ÆJņ Yà m[àņ fA m[à Ç C m additionalHolidays YYà
public class NthBusinessDay implements Serializable
{
int n;
String fireAtTime;
List <Date> additionalHolidays;
BusinessDayIntervalType interval;
boolean excludeWeekends;
boolean excludeUsFederalHolidays;
public enum BusinessDayIntervalType { WEEKLY, MONTHLY, YEARLY }
public NthBusinessDay ()
{
n = 1;
fireAtTime = "12:00";
additionalHolidays = new ArrayList <Date> ();
interval = BusinessDayIntervalType.WEEKLY;
excludeWeekends = true;
excludeUsFederalHolidays = true;
}
... ...
}
*m @IntervalDurationņ @IntervalCronņ @IntervalNthBusinessDay [[à
Z
[C e mà m mņ RuntimeException _[[ ` m_
©C©
))+
īÍĈĬ}ÂFE‚™
c2 +ĉ Æ
¢YfC C à [ ` à
m * C e à
m Yf
Jņ Y[à [[ m raiseAsynchronousEvent() m e m Events [ * m[
Cņ [[ m raiseTimedEvent() mņ YJ m[ `B
Æe m f
e[ Y
m C
Y
mņ TimerScheduleÇ ¢Y à `C
à
m C m [ _àņ ` ` m [à m ` Y
Z
YYJ m à
m m
c1 z ö à C | J e Y
c1 
* eJ ė e
e J | Jņ à [[ `
à Y
Ė à _ J ņ [ [[ _m e m
QueueConnectionFactory ½ TopicConnectionFactory
e[ J UIL2ConnectionFactory _m
m m [ e
à e _m |Ē e à J m | YCņ à `m e
queueConnection.queueConnectionFactoryJndiName
topicConnection.topicConnectionFactoryJndiName seam.propertiesņ web.xml components.xml
Ő [ [ Y
Ė components.xml [[ J TopicPublisher QueueSender6
<jms:managed-topic-publisher name="stockTickerPublisher"
auto-create="true"
topic-jndi-name="topic/stockTickerTopic"/>
<jms:managed-queue-sender name="paymentQueueSender"
auto-create="true"
queue-jndi-name="queue/paymentQueue"/>
c11  
ù_ņ à B
| TopicPublisher TopicSession à Y6
@In
private TopicPublisher stockTickerPublisher;
@In
private TopicSession topicSession;
public void publish(StockPrice price) {
try
{
stockTickerPublisher.publish( topicSession.createObjectMessage(price) );
}
catch (Exception ex)
{
throw new RuntimeException(ex);
}
}
©C©
))Q
īÍĈĬ}ÂFE‚™
ņ e _öJ _m Ė6
@In
private QueueSender paymentQueueSender;
@In
private QueueSession queueSession;
public void publish(Payment payment) {
try
{
paymentQueueSender.send( queueSession.createObjectMessage(payment) );
}
catch (Exception ex)
{
throw new RuntimeException(ex);
}
}
c12 jƝ   |Æ Ő Y
J J à ^+ J C ` |JfC ` à
C ` Yņ _m
m Y`[ B
m C YY[
f
Y Y
c1S jƝ  IJ [ à `
` | Y
e [f C
Y *m f
` ¢mY )ņ IJ
©C©
))\
f ÀĬJ;
ź}ŻŠ&ŷĆn
ΆŘ345ëŨ¬ƠvÿSFGŽ—N¹-%´ŗ
!¯2n —N¹-Ž'(ʼnŇ&ŀ%ŽŔ›}Ŕ-3H–¯ţ°ĥÁ%´ŗ ~ž~ ĝ I`à
&ʥǔŽn °ľƇ¬ Ÿm mJŸ Ã,Gĭ´òũȁȂsµ¬}Ə"%¯Ƌ"ŗ
Ťº!òŽɁ'ºŔ¯òŖĿŻsn
GH-N޳&ԃï<ç%ǬŔÚ-ƹí¯v°%cȸ%Þ¬345vŠn
µŖûƃœŒ}sµûŖĿŻŗ
·ºvΈ»sˆ…Ǫý2°¬&ŽĐ—N¹-śéŽđ
Ÿm
mJŸ
}°"Ã,Gĭ%¯Ƌ"ŗ
¤78£345ȁȂ¯ţţ¯2°¬&Žn ŔnjȅŻ—N¹-ƹí%´ŗ
¯œs›2nŒ&Ã,GĭƁ°ȁȂĬsµ¬}ƠȂ´¬&Žȳ=sµûŖ´sn
Έ»Žƒǔ&345œţñŻ&Îçĉ°2°Ŗ´ŗ
—N¹-&ƹív¬ƚţǙvţ%Þ¬ēĔsµòũn´ƚ2'(´¬ȣƜsµûŖ´ŗ
!Œ%ÃĭF4&9ŷ%´ŗ¯ºŔΉȑˏ%ŽµûŖĿŻŗ
345Ţ¯ţcȸ´òũnǬDžŔľœ¬̴ͱvÃĭF4™ΊȈ3
45&´ƚ2&Dž%Į£´¬Œ}s%Þ¬&%´ŗ
ş
—N¹-Ž…Ǐvs»ǯ¼&ÃĭF4՛2°Ŗ´ŗ
Œ&Œ}ŽǕÈƢ’%´sn345&ÃĭF4&«"vȁȂĬŽµûŖĿŻŗ
ş
I|Ú45
ƞ`ĝ!&ĩ&~#'ƊvŠÇ
Ž—N¹-º»—NͤŧÃĭF4ǞÞŖ´ŗ
ŒòŽ}2ŔLjūvķuv&%´snçDZ›œšľòēñòsnj%´ŗ
H8G45&ÃĭF4΋—NGH-NʼnŇ&Źï<%wɖĬ՜Ŀn—N¹
-}ŔÍĈñĿ¬}nīļƢ°Ð=vûŖ´ŗ
ԃ78%ƹíñònĸ®sŖòv—NŽƷ°ºŔǘòŖĿŻŗ
wʕŠv-,D-vÃ,Gĭ%ŽnͤŧÃĭF4“”ƪƫÃĭF4¯«"}
¯Ŗ´snŒòŽƷ°Œ}%ŽµûŖĿŻŗ А&ŷƎnɴû%´ŗ
ş
&“”;,Ã-Žn“”ƪƫ&ÃĭF4%´ŗ
“”;,Ã-ƀ¸¯œ;RSŽn78&MNHG45ŋŌ¯œƪƫÃ
ĭF4¯nƀÕ¯Ŗ´ŗ
ş
Аns•=´¬ij;,Ã-
Ƶ¬°Ž“”-;&-,OEF45lŋŌÝŨ»òœ^;,ê•=&ȁ
Ȃij;,Ã-Ç Žn ǹǰ&“”ıØÙŖòœ—N&ÃĭF4}¯2ɸɹ°Ŗ´ŗ
Œ&ÃĭF4&ΌFɓŽĻļŽ}2ŔƁţvûŖ´̛
GH-NʼnŇ%Žns•=´¬ij;,Ã-Ž«›2D345sšǃä
ñòn—N¹-&H8G45&wɖĬȾ´¬Ų’ŽµûŖĿŻ
Æ̲ˋŠKFG%΍Á%´Ç
ŗ
ˠ}Ö&ij;,Ã-ǬΎŔ&Ċ–‚PGıØÙŖv°ȃûnŒ&ÃĭF4&îɓ
Ö°2µŖûȾ´¬Ų’ŽµûŖĿŻŗ
ş
H8G45ŋŌ¯v°ƪƫ&345΋;,Ã-ÃĭF4´¬
Œ}Ŕ%ÞŖ´ŗ
345΋;,Ã-ƀÕñòœƪƫŽnGH-Nq&ĩ&ï<ŽŔnjȅŻƃ
ýŖĿŻŗ
©C©
))a
ÃĭF4
ş
;RSÃĭF4%
H8G45&ƪƫŽn¢
mš›œ&pojoCacheÞŖ´ŗ
¢
mGH-N%š£¯2°òũnŒ&ƪƫŽĩ&ï<ŔƃýŖ´ŗ
ş
šŶnDĕ™ñòœb‚&įİÃĭF4´¬Œ}s%ÞŖ´ŗ
I|Ú45&ͤŧÃĭF4}DZ°n—NsÈĸñò2Ŕ¼/Šȳîv¬Œ}Ž
v°&%n
ǂzŠȳîä´¬345΋;<ɆţºnǃúvíîĈȃR4cd´¬Ų
’sµûŖ´ŗ
ͤŧÃĭF4Žīļ̚ØŪ›œ‘ʝ%´&%nȨãÖ°2Žëš°&I|Ú45&Ġ
ɆȺȻ¯2ţŦñ°ŗ
«¬‚įİ&ÃĭF4vŠn¢
Œ&ɽ%ŽnYB¢
m;RSĝn<s:cache>mƣƤĮ£´¬ēĔÖ°2ɾǂ¯Ŗ´ŗ
f -
'ĭ¡±©
lM&
pojoCache
;RSŽ
org.jboss.cache.aop.PojoCache
&M-N-•=¯Ŗ´ŗ
ƄÈ&
C
Ċ–‚PG%µòũɦŹÃĭF4ǞţŒ}s%Þn
Ċ–‚PGŽGH-Nq%D345ñòŖ´
ÆD345síîvŷĆÇŗ
Èĸ&tuĬsµ¬Ċ–‚PGÃĭF4Õnjœ°ŷƎn
¢
m
&˜M;<΋KEF'(¯n
Ċ–‚PG&Èĸs¼/Š¥ǘñòn
D345ñò¬«"´¬Ų’sµûŖ´ŗ
}°"Ú-ǃú
v
m&cdVW´
YB¢
mš"ŽnGH-â-JBossCache&BǞÞntreecache.xml¬ŦŨ%´ŗ
¢
mŽ̃ȅ¯ţ̡˴%Ώ»ľ¯°cdsœţñŻµ¬&%nŒŒ%Žɾǂ¯ŖĿŻŗ
Ȩ㎢
m&ĠɆȺȻ¯2ţŦñ°ŗ
Ő e Y[ treecache.xml examples/blog/resources/treecache.xml
^#I—KM´¬ŷƎn¢
m&B}cdOáM^#IƣƤġ1¬Œ}ëȿ1
¯Ŗ´ŗ application.xmlBVW´¬Œ}ʅòv°%ţŦñ°ŗ
ŧ&«"n;RSÃĭF4M‚PG¯Ŗ´ŗ
@Name("chatroom")
public class Chatroom {
@In PojoCache pojoCache;
public void join(String username) {
try
{
Set<String> userList = (Set<String>) pojoCache.get("chatroom", "userList");
if (userList==null)
{
userList = new HashSet<String>();
pojoCache.put("chatroom", "userList", userList);
}
userList.put(username);
}
catch (CacheException ce)
©C©
))g
ÃĭF4
{
throw new RuntimeException(ce);
}
}
}
¢
mԃcd´¬ŷƎncomponents.xmlš£¯2ţŦñ°ŗ
<core:pojo-cache name="myCache" cfg-resource-name="myown/cache.xml"/>
f1 ~Įį.ÀĬJ;
&¢
m
&Į£%Ŕ›}ŔȗȘș°&Žn
bëŨ¬‚įİ&ÃĭF4ƺƻ>Ɣ´¬n
<s:cache>
N™%´ŗ
<s:cache>
ŽqĥŠ pojoCache š"&%n š£´¬ŷƎ­W&ɻË(›2ţŦñ° Æ^#I  B
Ūò¬n ĝ›º°vcdúûɿŨ¬nvŠ&ɻË%´ŗÇ
<s:cache>ŽnµŖûÈĸñòv°DN™΋;,ŏš£¯2ţŦñ°ŗ
œ}ýũnš®&`[J?Ěz´¬`[J&œPL‡‚%´ŗ
<s:cache key="recentEntries-#{blog.id}" region="welcomePageFragments">
<h:dataTable value="#{blog.recentEntries}" var="blogEntry">
<h:column>
<h3>#{blogEntry.title}</h3>
<div>
<s:formattedText value="#{blogEntry.body}"/>
</div>
</h:column>
</h:dataTable>
</s:cache>
Ɠd´¬Œ}«›2n Ś‚įİ&ÃĭF4˜‚5ԃÕÖŒ}s%ÞŖ´ŗ
Œ&è%Žn ˠ}Ö& `[J “¯2ˠ}Ö&ÃĭF4˜‚5s¸ǰ¯Ŗ´ŗ region
Žn
´ƚ2&˜‚5ƀ¸´¬
¢
m
&ï<Ɠd¯Ŗ´ŗ
ɂv¬ï<Žɂv¬íîĈȃR4ÕÖŷĆsµûŖ´ŗ
Æ­W&̡˴vcd%Ɠd%ÞŖ´ŗÇ
key
!¯2n <s:cache> &ǕÞvƺƻŽn “ʎ&—Ns°ÖÈĸñò¬º Ɯ}ýũn ®¯° `[J
s°Öƥ͸ñò¬ºÇ
ǘûǁv°}°"Œ}%´ŗ
ÖŖûn
ÃĭF4ñòœįݎn
ǂzŠÃĭF4º»ΐƸ´¬Ų’sµûŖ´ŗ
public void post() {
...
entityManager.persist(blogEntry);
pojoCache.remove("welcomePageFragments", "recentEntries-" + blog.getId() );
}
µ¬°ŽnÈĸʽʾ78ƃĿ¬Ų’sv°&%µòũn¢
mï<&íîĈȃ̷
ţcd¯2ŔƷ°%¯Ƌ"ŗ
©C©
))h
1i \ Æ
J _m ] [[_ ^^ _` C
ö e[[ CJ e
ė Z[ e_öņ [J YY e C[ _` C
*m
mY _[ö mJm m Y Ė [[_ _` C
_m f
C
1i  yĖ
* [[_ Y _` C
Ė m m à Z ` e m Ėņ Y
[ #~ m[ ` eJ̽
org.jboss.seam.webservice.SOAPRequestHandler SOAPHandler Y[ m m
_ö e JJ ė [e
à
[ J m Y e _` C
Ė
# Y
[ eJ e[ņ standard-jaxws-endpoint-config.xml m[ ` Y[
m
META-INF à e m jar e[ m m _` C
[ *m e[ f
m e[[_J #~ m[ eJ6
<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
<endpoint-config>
<config-name>Seam WebService Endpoint</config-name>
<pre-handler-chains>
<javaee:handler-chain>
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
<javaee:handler-name>SOAP Request Handler</javaee:handler-name>
<javaee:handler-class>org.jboss.seam.webservice.SOAPRequestHandler</javaee:handler-clas
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
</endpoint-config>
</jaxws-config>
1i1 Æ \ Æ
m_ C YYJ `_ _` C
Ėć #~ m
[ Y `m m #~ Ė Y J à m C
€ e m m C
ņ `
ö J žė ZY[ e _` C
Ė m C €6
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:seam="http://seambay.example.seam.jboss.org/">
<soapenv:Header>
<seam:conversationId xmlns:seam='http://www.jboss.org/seam/webservice'>2</seam:conversationId>
</soapenv:Header>
<soapenv:Body>
<seam:confirmAuction/>
</soapenv:Body>
</soapenv:Envelope>
©C©
))k
]` C
# à m `C #~ Jņ m conversationId [ _m m
#~ m m m C € e m Ėņ m 2 Aef
[àņ `
_` C
à ` `à Cà e _` C
[ _
Cà e [JJņ Y m C[Y Y[ C €
YYJ `_ C[ _` C
m ` _m m Y
e J[ C
# Y mJ m m conversationId m [ ` Ė[e
_m Y
e http://www.jboss.org/seam/webserviceņ m_ _[[ ` `[
m C € e m Ė žė ZY[ e Y m
`C Ė J6
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Header>
<seam:conversationId xmlns:seam='http://www.jboss.org/seam/webservice'>2</seam:conversationId>
</env:Header>
<env:Body>
<confirmAuctionResponse xmlns="http://seambay.example.seam.jboss.org/"/>
</env:Body>
</env:Envelope>
# à ņ m Y J m conversationId [ m f
Ė
1i1 + j ĉ
# _` C
` Y[ m [ ` ~ņ f
m e C[ _` C
ņ m _` C
e
C[ Y
e m _` C
_ [ `ņ m [ Y`[ ö Y `à JCJ @Name €J m [[_ ė `B
Æ
mÇ e ` m _` C
[ [e
©C©
)+o
]` C
1i2 + Ä ē Æ
ė _[ö mJm ZY[ _` C
*m m [[ e m
à ZY[ YY[
ė /examples àņ e[[_ m Jà ` m YC ė e ö [ö m _` C
[ e _` C
m6
@Stateless
@WebService(name = "AuctionService", serviceName = "AuctionService")
public class AuctionService implements AuctionServiceRemote
{
@WebMethod
public boolean login(String username, String password)
{
Identity.instance().setUsername(username);
Identity.instance().setPassword(password);
Identity.instance().login();
return Identity.instance().isLoggedIn();
}
// snip
}
# à ņ _` C
[ `ņ J m
] e m javax.jws Y
öJņ e `à Ifh *m @WebService f
[[ m m m [ Y[ _` C
ņ m @WebMethod f
m login() m e m m _` C
m *m name serviceName ` m @WebService Y[
# Ė `à m Y
e
ņ m m m ` ZY _` C
m [ ` [ m e
e m _` C
[ Æ_m m
_` C
[ `Ç m `C ZY[ņ m AuctionServiceRemote
e
[ m login() m @WebMethod
# à m `C ņ m _` C
Y[ login() m m [Jf
ė `[f Identity Y öYJ _m Jàņ m
_` C
_ Y[ e
ņ YJ ee m [ _ö Y
*m [[_ e m J e ` [J
`_ _` C
m [f
ė [ö m ZY[ *m _` C
m `J _ C `à [f
JJ m AuctionAction.createAuction() m6
@WebMethod
public void createAuction(String title, String description, int categoryId)
{
AuctionAction action = (AuctionAction) Component.getInstance(AuctionAction.class, true);
action.createAuction();
action.setDetails(title, description, categoryId);
}
# mė m e AuctionAction6
@Begin
public void createAuction()
{
auction = new Auction();
©C©
)+
]` C
auction.setAccount(authenticatedAccount);
auction.setStatus(Auction.STATUS_UNLISTED);
durationDays = DEFAULT_AUCTION_DURATION;
}
b m _ m_ _` C
Y
Y [J J Cņ `à
J e
[JJ m [ _ö C[ Y
©C©
)+)
1 j
Žn
]`
‚º»
##å
Æ#à
m
C
Y
å| Ç
š£¯2;RSÅGE-´¬ưĮvēĔƿǀ¯Ŗ´ŗ
Œ&ķu'ǹ´¬OD‡ðG%Žn
ôǶΐΑūsºº»v°«"v›2°Ŗ´
f
;RSŲ’vŔ&Žn
##å
Ļ2GE-tu}´¬œ1&ſȩvï,45ŦŨ%´ŗ Œ&ɽ%Žn ##å tuv
]`
‚p¬œ1Ų’v-,FÖ°2Wƚn
!¯2
IJ
OD‡ðG&ķuÖ°2ŔȨ¯ţɾǂ¯Ŗ´ŗ
1 `a
IJ
&ķuš£´¬Žn
ŖŴ
–DFcd´¬Ų’sµûŖ´ŗ
web.xml
OáMq%
I
<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
ŧ&-,FŽn
]`
‚Ų’v
C
Y
MR´¬Œ}%´ŗ
MR´ƚÞ-Gsš́̐ÖµûŖ´ŗ
š0&w֎n
IJ
&ķuí¬GHMM<OD‡ðG&Ź2&;<ġØŖ´ŗ
<script type="text/javascript" src="seam/resource/remoting/resource/remote.js"></script>
̐ÖƉ&-GŽn
ƭìƗ¯œ°;RS“´¬-N–}¡dÓġØŖ´ŗ
!òŽ;RS&KLMNOP-Ĝ¯2/Š²³ñòn
MNOP-&ÅÂÚF<ƭìƗ´&š£ñò¬Ź2&GH-“´¬¡dÓq
̿¯2°Ŗ´ŗ
-G&Ò­Ž;RS&Ò­sDzΒñòŖ´ŗ
èýũn
@Name("customerAction") }°"ï,45ÝÞ&-,D-EF45 ÕÖv»n
-GN™ŽśŜ&«"vûŖ´ŗ
<script type="text/javascript"
src="seam/resource/remoting/interface.js?customerAction"></script>
͏‚º»wÖś$&;RSGE-¯œ°ŷƎn
-GN™&âHÂN}¯2!ò»Ź2ġ1Ŗ´ŗ
<script type="text/javascript"
src="seam/resource/remoting/interface.js?customerAction&accountAction"></script>
#[C[àņ à à m s:remote J Y m Ė C
Y Y
m Y [ à _m Y _m 6
<s:remote include="customerAction,accountAction"/>
©C©
)++
IJ
11 žž ƔRK
;RS}&GHMM<&MNHG45Žn
´ƚ2
Seam
C
Y
Ċ–‚PGǐȍ%(ľòŖ´ŗ
Œ&Ċ–‚PGŽ
remote.js
dÓñòn
;RS“´¬īÍĈƭìƗ¯!òš£¯Ŗ´ŗ
!òŽn)
Ö&ķuˆÁñòŖ´ŗ
;RS}Ōɺ´¬ÂÚF<ġĢ
Seam.Component
!¯2nÅG?-'(´¬ÂÚF<ġĢ
Seam.Remoting
%´ŗ
Œ&Ċ–‚PGΓĻ´¬wŽrƱvēĔŽn žſvº»ª1¬Œ}%´ŗ
11 œ \ $%&#
Ċ–‚PGsŠ&«"/p´¬ºƃ¬œ1n
žſvĻ2wΔΕØƗ¯2ØŖ¯Ƌ"ŗ
ŖŴš0nhelloAction
}ƭũò¬®¯° ;RSp³¯Ŗ¯Ƌ"ŗ
Seam
@Stateless
@Name("helloAction")
public class HelloAction implements HelloLocal {
public String sayHello(String name) {
return "Hello, " + name;
}
}
®¯°;RS&œ1nKLMNOP-Ŕ²³´¬Ų’sµûŖ´ŗ
ï,45ĞơƬ¯2ţŦñ°ŗ
Ļ2&ÂÚF<ǵ&GE-tu}´¬œ1Ų’%´ŗ
@WebRemote
IJ
@Local
public interface HelloLocal {
@WebRemote
public String sayHello(String name);
}
ɆţŲ’sµ¬˜M<&;<ŽŒòŦŨ%´ŗ
!ò%Žn]^
‚&œ1
®¯°‚p³¯2n m[[#
;RSMR¯Ŗ¯Ƌ"ŗ
f
<s:remote include="helloAction"/>
ŸŹMNHG,@–v78?G-?-}´¬œ1n‚ÿNÝŨŖ¯Ƌ"
ŗ
<button onclick="javascript:sayHello()">Say Hello</button>
GFGñòœ}Þn'ęÿNǬº(ľĿ¬œ1ŽnŔ"Ǚ¯-GǣǤ´¬Ų
’sµûŖ´ŗ
<script type="text/javascript">
//<![CDATA[
function sayHello() {
var name = prompt("What is your name?");
Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback);
}
function sayHelloCallback(result) {
alert(result);
©C©
)+Q
IJ
}
// ]]>
</script>
pŘŸą%´Ņ
345—KM¯2n‚–Hœƛ¯Ŗ¯Ƌ"ŗ
ÿNGFG¯2nKsƗœ»Ò­Ūū¯Ŗ¯Ƌ"ŗ
ƭìƗ¯&³øŤť´¬œ1&
m[[
ÂFE‚snÂFE‚ÿFG-ĚzñòŖ´ŗ
Ǚ¯Îçƍ¯œ°&%µòũn & /examples/remoting/helloworld —@DGŒ&
ž[[ ][ &´ƚ2&Ú-;<sµûŖ´ŗ
}Œȅ%nŒ&-G&;<ŽǬ´¬&%¯Ƌ"ºŗ
Ŕ›}ãºţÁ>¯2ØŖ¯Ƌ"ŗɻª1n)
Ö&ÂÚF<'Ɗ¯œ
C
Y
;<º»ƃ2°ÞŖ¯Ƌ"ŗ
š0&ÂÚF<Ž78“¯2Ò­Ūū´¬«"ʳ¯nÅG?-("}°"˯˰
ÕnjŖ´ŗ śŜ&(º»ƃ2ØŖ¯Ƌ"ŗ
Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback);
Œ&(&š0&ĥÁ
Seam.Component.getInstance("helloAction")
Žn
helloAction
;RS&KÃ4nµ¬°ŽŸ-N–Ÿĺ¯Ŗ´ŗ
Œ&-N–“¯2;RS&ÂÚF<ƭìƗ¯stu%´ŗ
!òŽnŖñŒ&(&Ȥû&ĥÁ%Ƕ²¯Ŗ´6 sayHello(name, sayHelloCallback);
;<(ŹȔ%(›2°¬Œ}Žn;RS&sayHelloÂÚF<&ƭìƗ¯}n
âHÂN}¯2nameț´Œ}%´ŗ
)
ŽƉ&âHÂNsayHelloCallbackŽn
Œ&;RS& sayHelloÂÚF<&âHÂN%ŽµûŖĿŻŗ !&Ĥľûn If
J
OD‡ðGG?-ǵ&D-R-ĦŨœ»n
!ò
sayHelloCallbackÂÚF<ț´ƚÞŒ}Ɠz¯Ŗ´ŗ
Œ&;˜FGâHÂNŽŸŹĊ45%´ŗ ĺûƜ C &ÂÚF<ƭìƗ´ŷĆn
µ¬°Ž§¨Ⱦ¯v°ŷƎn Η͜vţ!&ŖŖ¯2ţŦñ°ŗ
sayHelloCallbackÂÚF<snÅG?-“´¬D-R-Ħħ¯œŷĆn
ÂÚF<ƭìƗ¯&§¨Ěz´¬HÂFE‚sǹòŖ´ŗ
111 C
Y
Ċ–‚PGŽn
;RS}Ōɺ´¬ƾţ&GHMÂÚF<ƿǀ¯Ŗ´ŗ
Ơv
)
Ö&ÂÚF<nnewInstance()}
getInstance()Žn
śʶ&ɽŔVWñò2°Ŗ´sn
Œò»&ƠvDZ°ŽnnewInstance()
Žn4
™
&MN-
ĺ´Œ}
Žn°ÖŔ;RSNM&®¯°M-N-²³¯n!¯2ngetInstance()%´ŗ
Seam.Component
ēÃÅ
©C©
)+\
IJ
®¯°?,@,@nµ¬°Ž
C
;RSM-N-²³´¬œ1Œ&ÂÚF<š£¯Ŗ´ŗ
Œ&ÂÚF<«ûĺñò¬Ċ–‚PGŽn ˜M<&“ż´¬Ŕ&}͏ J½
ÂÚF<ÕÖºn
µ¬°ŽnĤü}¯2në˂Øv»ũn!&O@<ƣƤGE-stu%´ŗ
è}¯2nśŜ& ?,@,@;RSȦxţŦñ°ŗ
@Name("customer")
@Entity
public class Customer implements Serializable
{
private Integer customerId;
private String firstName;
private String lastName;
@Column public Integer getCustomerId() {
return customerId;
}
public void setCustomerId(Integer customerId} {
this.customerId = customerId;
}
@Column public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
@Column public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
GHMM< ¢ ²³´¬œ1nśŜ&;<VW¯Ŗ´ŗ
var customer = Seam.Component.newInstance("customer");
!¯2nŒŒº»Ž Ċ–‚PG&O@<&cdstu%´ŗ
customer.setFirstName("John");
// Or you can set the fields directly
customer.lastName = "Smith";
ÃÅ
getInstance()ÂÚF<Žn
EF45
;RS&n-N–ǵ&ȺȻIJǁ´¬œ1š£ñòŖ´ŗ
!òŽn;RS“¯2Å&ÂÚF<'(š£tu%´ŗ
Œ&ÂÚF<ŽnĞd&;RS&4™ĺ¯Ŗ´ŗ
!&§¨njŨ2͏;RSÒ%
ʗƭìƗ´}n͏;RSM-N-sĺñòŖ´ŗ
)
­V&º»jŨ2n
©C©
)+a
IJ
;RS&saveCustomer()ÂÚF<!òț¯Ŗ´ŗ
Seam.Component.getInstance("customerAction").saveCustomer(customer);

õÃÅ
!òs;RS&ŷĆn
Ċ–‚PGŒ&ÂÚF<ț´};RSÒĺ¯Ŗ´ŗ
Ŗœn;RS%v°ŷĆn[[ ĺ¯Ŗ´ŗ
if (Seam.Component.getComponentName(instance) == "customer")
alert("Customer");
else if (Seam.Component.getComponentName(instance) == "staff")
alert("Staff member");
112 j
IJ
&ǕĥÁ&GHMM<&ķuŽnSeam.RemotingĊ–‚PGġŖòŖ´ŗ
ÂÚF<ƣƤƭʻŲ’Žź}ŻŠv°}Ž°ýn Ə̥´¬ȣƜ&µ¬Ƣ’vŔ&sµûŖ´ŗ
jĉÃÅ
345s ;RS%Žv° C ġĢºnµ¬°Žnš"ŷĆn
âHÂN;RSÂÚF<ț´œ1nGHMM<%Œò»&NMp³
´¬Ų’sµ¬ºŔ¯òŖĿŻŗ
Ų’vNM&M-N-p³´¬œ1ncreateType()ÂÚF<š£¯2ţŦñ°ŗ
âHÂN}¯2nŸŹ˃˸& C GH-ț¯2ţŦñ°ŗ
var widget = Seam.Remoting.createType("com.acme.widgets.MyWidget");
jĉõÃÅ
Œ&ÂÚF<Žn;RS%v°¡£%µ¬Œ}Ɛ´òũn¢YJ¢Y
ùÆÇ}ɰȣ%´ŗ
Ċ–‚PGM-N-NM&Ò­ĺ¯Ŗ´ŗ
ŖœnNMs·ǘ%v°ŷĆn[[
ĺ¯Ŗ´ŗ
Œ&Ò­ŽnNM&
C
GH-ŸŹ˃˸Ò%´ŗ
12 ]Ɲ ]Ÿ ]Ä
IJ [ YY m C[ e ^ ZYņ _m
m YC m f
C m e CJ e m C AJ m Seam.Remoting.eval() e
f
ņ ^ ZY ` [à C[ m C m [J C[
[f [[`
ö m *m e
Y _ Yņ m
e `J m ^ ZY C[ņ m `J m [[`
ö m Cö _m m C[ e m ZY žė ZY[6
function customersCallback(customers) {
for (var i = 0; i < customers.length; i++) {
alert("Got customer: " + customers[i].getName());
}
©C©
)+g
IJ
}
Seam.Remoting.eval("#{customers}", customersCallback);
m ZY[ņ m ZY #{customers} C[ `à ņ m C[ e m
ZY Æ m [ e ¢ `B
Ç m customersCallback() m Y ` m m `B
m _à mC
m àY Y ÆC s:remoteÇ ` `[ _ö _m m C
Y _ö _m [ e customer `B
ņ Ė Y m customer àY6
<s:remote include="customer"/>
1S KLO"%
O%PQR4
$Vncd&ɽ%Žn MNOP-nµ¬°Žn;RS&œ1& Ÿ-N–Ÿ Žnseam/
remoting/interface.jsĻ2nµ¬°Ž s:remote š£¯2‚MRñòŖ´ŗ
<script type="text/javascript"
src="seam/resource/remoting/interface.js?customerAction"></script>
<s:remote include="customerAction"/>
‚Œ&-GMG<´¬Œ}«ûn
;RS&œ1&MNOP-dӐǤý2n;RS&ÂÚF<'(´¬œ1
Ų’v!&ĩ&;RS}NMs²³ñòn
IJ
OD‡ðG%š£tuvûŖ´ŗ
²³ñò"¬GHM-N–Žn̐Ö&NMsµûŖ´ŗŸ'(tuŸ
-N–n!¯2nŸNMŸ -N–%´ŗ '(tu-N–Žnɸ¬ɹ°ÕnjnEF45 ;RS“´¬ÂÚF<'(´¬œ1š£ñòŖ´ŗ
wēnNM-N–ŽnƪƫƀÕ¯nâHÂNµ¬°Ž§¨}¯2ĺûƜ}¯2ɍÝtuvN
MĚ¯Ŗ´ŗ
²³ñòœGHM-N–&NMŽn;RS&NMÄ¸¯Ŗ´ŗ;R
SsEF45
&ŷƎ'(tu-N–s²³ñòn
!òśé&?,@,@nŖœŽC&ŷƐŽNM-N–s²³ñòŖ´ŗ Œ&±ƳŽ
Ö&èésµûŖ´ŗ ;RSs C ÆÖŖûnEF45 ĝ ?,@,@
%v°ŷĆÇ
%nºÖ!&ÂÚF<©]`I
ï,45sÝŨ»ò2°œŷƎnNM-N–&Ĥľû'(tu-N–s²³ñòŖ´
ŗ
ŒòŽnEF45
GE-%Þv°ī^
ʼnŇ%nC
;RS&ÂÚF<ƭìƗ´ IJ š£tu¯Ŗ´ŗ
1[ B%3À4
Å;,Ã-Žn
IJ
&G?-
D-R-MG&wĥ}¯2ɍĦħñò¬ǣǤȟȠġŻ%°Ŗ´ŗ
ǹʮDŽ%Ž“”
ŦŨ¯ºġŻ%°ŖĿŻsnʹƦȁȂñò¬tuĬsµûŖ´ŗ
©C©
½
€
)+h
IJ
1[ ‘ } .`awİ×Ø×
“”-;%ÅƭìƗ¯¯«"}´¬ŷĆn
IJ;,Ã-qµ¬“”€
&ıØÙØ}cds(ý¬Ų’sµûŖ´ŗÅG?-&Ŷ“”
ıØÙĢœ1ŽnSeam.Remoting.getContext().getConversationId()ƭìƗ¯Ŗ´ŗ
G?-&­“”€
cd´¬œ1ŽnSeam.Remoting.getContext().setConversationId()ƭìƗ¯Ŗ´ŗ
€
“”€
sǂzŠ
Seam.Remoting.getContext().setConversationId()%cdñòv°ŷĆn
ÅƭìƗ¯«›2ĺñò¬š0&íîv“”€
s¼/Šĉû…2»òŖ´ŗ
‚q%ԃ&“”€
š£´¬ŷƎn!òɇò&ƭìƗ¯&­“”€ǂzŠcd´¬Ų’sµ¬ºŔ¯òŖĿ
ŻŗÖ&“”ŦŨš£´¬ŷƎn ĞƐvŒ}´¬Ų’ŽµûŖĿŻŗ
1[1 j ē Æ à ` Ė ö [[ _m m Y e m
C_ė C * mņ à ZY[
[à m C € m e m C_ `e öJ m [[ *m [[ YY e C
Y _[[ m C € m e J [[ m C_ė C
€6
Seam.Remoting.getContext().setConversationId( #{conversation.id} );
1^ –J!KF4
IJ
Žnԃ&;RSƭìƗ¯s
Ö&G?-q%'(ñò¬Œ}tu¯Ŗ´ŗ
SFðGHO@FGɑǙ´¬Œ}sǃú%µòũn
ŠŒ%ŔŒ&ĞȬš£´¬Œ}ʰʱ¯Ŗ´ŗ
Seam.Remoting.startBatch()ÂÚF<
Žn
˜F./Ŷ'(ñòœ;RSƭìƗ¯Žn
ʽʾɍ»ò¬&%ŽvţnÃM™ñòŖ´ŗ
®œv˜F./¯Ŗ´ŗ
Seam.Remoting.executeB
Ų’}ñò¬´ƚ2&;RSƭìƗ¯s˜FǣǤñòœ}Þnatch()ÂÚF<Žn
˜ÃM™ñòœƭìƗ¯´ƚ2ġĢ
Ö&G?-ɍħ´¬%¯Ƌ"ŗ
!¯2n!Œ%ËŽ'(ñòŖ´ŗ
ƭìƗ¯s'(ñòœŶn
´ƚ2&ĺûƜġĢ
Ö&D-R-Žn
GHMĺñòn;˜FGķus
ÆŔ¯ncdñò2°òũÇ
'(}͏ˎ%./ñòŖ´ŗ
©C©
)+k
IJ
ÂÚF<ŽnÐΘŖ›œŹ2&ƭìƗ¯Ȓȓ¯2n˜FÅ
Seam.Remoting.cancelBatch()<Ąą¯Ŗ´ŗ
˜FsĮ£ñò2°¬ƃ¬Žn/examples/remoting/chatroomȺȻţŦñ°ŗ
1b •PPO&.ı÷IJ­
1b &!ij3G” º ě…PO&
Œ&ɽŽnĜˆ—NNM&RÖ°2Wƚ2°Ŗ´ŗ
˜M<%ŽŒò»&ƜŽnwʕŠĴ,@–NMnµ¬°Žn“ż´¬HFâGH}ʹʺĬsµûŖ´ŗ
 J
âHÂNƜcd´¬ŷƎn
Ċ–‚PGš£¯2ţŦñ°ŗ
ſȩ
C
Y
J
õ C
%Rñò2°¬´ƚ2&ƒƜNMŽRñò2°Ŗ´ŗ
GHMM<%Žn
ƒƜŽļ
J
Ěǹ}¯24HMƛñò2°Ŗ´ŗ
!¯2n˜M<%ŽnŒò»ŽnŢ¯°ƉŠ&NMÈʺñòŖ´ŗ
Ĵ,@–nŖœŽnHFâNMǵ&ÈʺŽn
àn€`[n
b[nJn Jn
!¯2nm NMR¯Ŗ´ŗ
[ ŽnGHMM<%Ž C
Y& [ Ɯ%Ěǹñòn˜M<%Ž
C `[ %ĚǹñòŖ´ŗ
1b1 Æ
wʕŠnŒò»Žn
?,@,@nC
;RSnŖœŽnf
Y
GH-%´ŗ
Ċ–‚PG&®¯°M-N-²³´¬œ1ŽnǃúvÂÚF<š£¯2ţŦñ°ŗ
;RSŽSeam.Component.newInstance()n
Ŗœn!&ĩ&Ŕ&ŽSeam.Remoting.createType()š£¯2ţŦñ°ŗ
âHÂNsnŒ&EG45&Ɛ&ŷǧ%VWñòœ!&ĩ&íîvNM&
Ö%Žv°ŷĆn
Œò»
)
Ö&ÂÚF<&Šnj»º«›2²³ñò¬Ċ–‚PGŦŨsâHÂNƜ}¯2š£ñò¬ƚ
Þ%µ¬Œ}ȾʔţŒ}ŽƢ’%´ŗ
°ţÖº&ƪɠ%Žn
śŜ&«"˥˦âHÂNNMƔd%Þv°;RSÂÚF<sµ¬ºŔ¯òŖĿ
Żŗ
@Name("myAction")
public class MyAction implements MyActionLocal {
public void doSomethingWithObject(Object obj) {
// code
©C©
)Qo
IJ
}
}
Œ&ŷĆn
myWidget
;RS&M-N-ț¯œ°}Œȅ%´sn
myAction
&MNOP-Ž!&°Ŵò&ÂÚF<º»ŔƣƤȺȻñòv°œ1
myWidget
ġØŖĿŻŗ Œòʗʘ´¬Žn MyWidget ǂzŠMR´¬Ų’sµûŖ´ŗ
<s:remote include="myAction,myWidget"/>
Œò«û
myWidget
Ċ–‚PGs
Seam.Component.newInstance("myWidget")
%p³ñò¬«"vûn Œòs myAction.doSomethingWithObject() țñòŖ´ŗ
1b2 ĴÜwÍĵ
ĵÝ&ƜŽn ĴΙſÌŖ%ŢŤv J ĚzŌjäñòŖ´ŗ GHMˬ%Ž Cf
Y € Ċ–‚PGš›2ĵÝƜ}/pñĿŖ´ŗ ˜ˬ%Ž java.util.Date
š£¯Ŗ´ ÆŖœŽ java.sql.Date ĝ java.sql.Timestamp vŠ&ŜÌGH-Çŗ
1bS ]
GHMˬ%Žn
Ž
J
âHÂN&Ɯcd´¬ŷƎſȩ
&
ŧ&;RSè}¯2ȺȻ¯2ţŦñ°ŗ
}ÍƟijľòŖ´ŗ
J
Ěǹš°Ŗ´ŗ
@Name("paintAction")
public class paintAction implements paintLocal {
public enum Color {red, green, blue, yellow, orange, purple};
public void paint(Color color) {
// code
}
}
paint()
ÂÚF< red &͢š›2ƭìƗ´Žn J &ŖŖ%âHÂNƜț¯Ŗ´ŗ
Seam.Component.getInstance("paintAction").paint("red");
ʖŔɬvûŖ´ŗ
ÖŖûn
;RSÂÚF<s
ÆŖœŽĺñò¬Ċ–‚PG™HO&ŠŒº
GHMˬ%Ž J }¯2ĚzñòŖ´ŗ
âHÂNĺ´ŷĆ
O@<ġĢŷĆÇn
1b[ BHK;<%

J ŽDMn ȡĆn wxn EFvŠ´ƚ2&ȡĆNM“ʎ}¯ ƜŦ¯ |Y ŽƸţn
ŒòÖ°2Žŧ&EG45ȺȻÇn
C
Y
DM}¯2GHMˬ%'ƊñòŖ´ŗ
âHÂN}¯2Œò»&NM&°ŴòºĦŨIJ¬;RSÂÚF<ƭìƗ´ŷĆn
š£´¬âHÂNŽ
C
Y
DM¯Ŗ´ŗ
;RSÂÚF<sŒò»&NM&°Ŵòºĺ´ŷƎn
ĺûƜŔ
C
Y
©C©
)Q
IJ
DMvûŖ´ŗ
IJ
OD‡ðGŽn
˜ˬ%
;RSÂÚF<;“¯2ǃúvNMÈʺ´¬Œ}stu%´ŗ
`J
z
C
Y q%Ž |Y “´¬SM,@–&RŽv°œ1n 4v |Y 'Ɗs IJ OD‡ðG%ƿǀñòŖ´ŗ Å;“´¬âHÂN}¯2š£%Þ¬
|Y p³´¬Žn ®œ Seam.Remoting.Map Ċ–‚PGp³¯Ŗ´ŗ
var map = new Seam.Remoting.Map();
Œ&
C
Y 'Ɗ%Ž |Y }/p´¬Œ}ƉŠ}¯œĜˆŠvÂÚF<n size()n
isEmpty()n keySet()n values()n get(key)n put(key, value)n remove(key)n contains(key)
ƿǀ¯Ŗ´ŗ !òɇò&ÂÚF<Ž C &!ò}ÍɰvûŖ´ŗ ÂÚF<s keySet()
̥ì values() vŠ& ȡĆĺ´}n !&ÃŖœŽƜĊ–‚PGġĢ C
Y #à
Ċ–‚PGsĺñòŖ´ŗ
1c •–J—Ķp
˜™&ǣΚƼƽ´¬ƉŠ%n
RFFœ@<œq%GHM}˜ç(›œûƦœû´¬´ƚ2&â3F&
qrĚz´¬—˜F™Å<í¬Œ}s%ÞŖ´ŗ —˜F™Å<í¬Žn
ŧ&°Ŵòº(°Ŗ´ŗ C
Y q% setDebug() ÂÚF<'(´¬ēĔŽŧ&Ļû%´ŗ
Seam.Remoting.setDebug(true);
YZ[ š›2cd("ēĔŽŧ&«"vûŖ´ŗ
<remoting:remoting debug="true"/>
—˜F™ķuĊO´¬Žn
setDebug(false)
Λ&ÂFE‚—˜F™K™ɆÞÙ؜°ŷƎn
ƭìƗ¯Ŗ´ŗ
ƭìƗ¯Ŗ´ŗ
Seam.Remoting.log(message)
1f ¿JI'MC±©
ǽƧ&$ĥʚ˫—O¶%Ězñò¬K—@™ÂFE‚Žn
Dĕ™&L-N¤Mƛn ŸŹĊO´¬vŠstu%´ŗ
Èĸn
1f ¿JI'Çķ±©
—O¶&
Ÿ~[
]Ÿ
}°"ÂFE‚Ɛ&ÂFE‚Èĸ´¬Žn
Seam.Remoting.loadingMessage &Ɯcd¯Ŗ´ŗ
Seam.Remoting.loadingMessage = "Loading...";
1f1 M•G%—¿JI'ĸ±
©C©
)Q)
IJ
K—@™ÂFE‚ŸŹĚzñĿv°«"´¬Žn displayLoadingMessage() ë«ì
hideLoadingMessage() ǬŔ(ľv°ķu%$ɆÞ¯Ŗ´ŗ
// don't display the loading indicator
Seam.Remoting.displayLoadingMessage = function() {};
Seam.Remoting.hideLoadingMessage = function() {};
1f2 N4P„.M•G%—O%:P
K—@™M‚3N$ɆÞ¯2ŎÂ&M;&ĩn
ƩÞvŔ&ĚzñĿ¬Œ}s%ÞŖ´ŗ displayLoadingMessage()
&ŚÂFE‚ǯ¼&'Ɗ%$ɆÞ¯2Œò(°Ŗ´ŗ
}
hideLoadingMessage()
Seam.Remoting.displayLoadingMessage = function() {
// Write code here to display the indicator
};
Seam.Remoting.hideLoadingMessage = function() {
// Write code here to hide the indicator
};
1i Ĺðñ©•P'þÿ±©
ÅÂÚF<s'(ñò¬}n
!&§¨ŽGHMĺñò¬
å| D-R-ŌjäñòŖ´ŗ
Œ&D-R-ŽŧGHM«û
C
Y
Ċ–‚PG¤4ĭñòŖ´ŗ
ĩ&Ċ–‚PGǵ&ȺȻġĢÔƴvNM&ŷĆ
ÆC`
vŠÇn
Œ¯œȺȻñò¬Ċ–‚PGŔ´ƚ2D-R-&wĥ}¯2ŌjäñòŖ´ŗ
Œò»&Ċ–‚PGŽĩ&Ċ–‚PGȺȻ´¬Œ}s%Þn
ŖœŒ&ĩ&Ċ–‚PGŽ!&ĩ&Ċ–‚PGȺȻ%Þ¬}°›œ˭ƐvûŖ´ŗ
PFG¯v°ŖŖ¯2ëţ}n
Œ&Ċ–‚PGЙHOđŽĊ–‚PGç%¸ǰ´¬ŋʂ«›2ŽīļɄǕvŔ&v¬
tuĬsµûŖ´ŗ
Μ²Švƺƻ}¯2
ÆD-R-sɏɐ}v¬ƺƻ}ŽƐÇn
GHM“¯2ķ˦ȟȠsǿĚñò2¯Ŗ"&̑ˢœ°ŷĆŔµ¬ºŔ¯òŖĿŻŗ
IJ
Žn
ÅÂÚF<&
@WebRemote
ï,45&
exclude
O@<Ɠd´¬Œ}%!&Ċ–‚PG™HOĐÍ´¬đ4vēĔƿǀ¯2°
Ŗ´ŗ Œ&O@<Ž<F ÆĐđÇ ĚVš›2Ɠdñò¬â-ŖœŽÔƒ&â-ġĢ
J
DMĦŨIJûŖ´ŗ
ÅÂÚF<ƭìƗ´}n
Œò»&â-}wʄ´¬§¨}v¬Ċ–‚PG™HOq&Ċ–‚PGsŌjäñò¬§¨â3
Fº»ƸéñòŖ´ŗ
´ƚ2&è%ŧ& Widget GH-š£¯Ŗ´ŗ
@Name("widget")
public class Widget
{
private String value;
private String secret;
private Widget child;
private Map<String,Widget> widgetMap;
private List<Widget> widgetList;
// getters and setters for all fields
©C©
)Q+
IJ
}
1i ĺĻ.QG#C'þŠ±©
ÅÂÚF<s
Widget
&M-N-ĺ´ŨòŠ
secret
O@<Žķ˦ȟȠsġŖò2°¬œ1ǿĚ¯œţv°ŷĆn ŧ&«"Ă¯Ŗ´ŗ
@WebRemote(exclude = {"secret"})
public Widget getWidget();
Ÿ
Ÿ
&ƜŽĺñò¬Ċ–‚PG&
secret
O@<ȺȻ¯Ŗ´ŗ
ŒŒ%n
GHM“¯2Œ&ĞdO@<sǿôñò2ŔŞľv°}ʷd¯Ŗ´ŗ ĺñò¬ Widget Ž child O@<sµûn ŒòŔ Widget vûŖ´ŗ Ĥľû child & secret
ƜĹ¯œ°ŷƎŠ"¯œ»«°%¯Ƌ"ºŗ
<FĚVš£¯2§¨}v¬Ċ–‚PG™HOq&Œ&O@<&â-Ɠd´¬Œ}s
%ÞŖ´ŗ
@WebRemote(exclude = {"child.secret"})
public Widget getWidget();
1i1 z w BHK;<%'þŠ±©
Ċ–‚PG™HOqĊ–‚PGs¸ǰ%Þ¬!&ĩ&ŷǧŽ
Map
µ¬°ŽvŻ»º&ȡĆ&ȑˏqvûŖ´ ÆListn Setn Array vŠÇŗ ȡƎžſ%n
!&ĩ&O@<}ÍƟijýŖ´ŗ œ}ýũn Widget & widgetList O@<qĩ&
Widget wxsġŖò2°2n Œ&wx& Widget & secret O@<ͯ2°¬ŷĆn
ï,45Žŧ&«"vûŖ´ŗ
@WebRemote(exclude = {"widgetList.secret"})
public Widget getWidget();
&ÃŖœŽƜÍ´¬ŷĆ&ĚVŽǙ¯ɂvûŖ´ŗ Map &O@<Ò&Ŷȅ [key]
ÝŨǤý¬}
Map
&ÃĊ–‚PGƜͯn
[value]
ŽƜĊ–‚PG&ƜͯŖ´ŗ ŧ&è%Ž widgetMap O@<Ăñòœ secret
O@<՜Ŀ¬ēĔz¯2°Ŗ´ŗ
Map
@WebRemote(exclude = {"widgetMap[value].secret"})
public Widget getWidget();
1i2 ĝaPO&.ƔRK
'þŠ±©
šŶn§¨}v¬Ċ–‚PG™HOq&ŠŒƗǹ´¬ºŋʂvţĊ–‚PGNM&O
@<͐š£%Þ¬ĚVÖ°2ɾǂ¯Ŗ´ŗ
Œ&ĚVŽ;RSÒ
ÆĊ–‚PGs ;RS%µ¬ŷĆÇ ŖœŽŸŹ˃˸GH-Ò ÆĊ–‚PGs
;RS%Žv°ŷĆ&ØÇ &°Ŵòºš£¯Ν̀Κ›2ĚǹñòŖ´ŗ
@WebRemote(exclude = {"[widget].secret"})
public Widget getWidget();
©C©
)QQ
IJ
1iS þŠÌļ'Ö×ĂĽľ©
ÍͥŽĊ–‚PG™HOq%ԃ&â-º»Ċ–‚PGO@N´¬œ1×ØĆľĿ
¬Œ}Ŕ%ÞŖ´ŗ
@WebRemote(exclude = {"widgetList.secret", "widgetMap[value].secret"})
public Widget getWidget();
1 z ¿JI%—
IJ
Ž
|
ÂFE‚™“¯2'ǑŠRƿǀ¯2°Ŗ´ŗ
ˆEG45%Žǹǰ'Ɗñò2°¬
|
RÖ°2VȆ¯2°Ŗ´sn
ɭŶn
Èĸñò¬tuĬsµ¬&%ơƬ¯2ţŦñ°ŗ
ǹǰn
Œ&ķu'ʯΟʼnŇŜ%š£´¬Œ}Žʰʱñò2°ŖĿŻŗ
1 `a
|
ČFG–-GHM–´¬­n
ŖŴ
IJ
%–-GHM–ñĿ¬Œ}s%Þ¬ČFGwxcd´¬Ų’sµûŖ´ŗ seam.propertiesn
web.xml
ŖœŽ
components.xml
&
org.jboss.seam.remoting.messaging.subscriptionRegistry.allowedTopics
TŜµ¬ČFGwxĚzñĿŖ´ŗ
<remoting:remoting poll-timeout="5" poll-interval="1"/>
11 z $”4KLO”±©
ŧ&è%Ž | *Y
ǵ&–-GHM–ēĔz¯2°Ŗ´ŗ
function subscriptionCallback(message)
{
if (message instanceof Seam.Remoting.TextMessage)
alert("Received message: " + message.getText());
}
Seam.Remoting.subscribe("topicName", subscriptionCallback);
ÂÚF<Ž
)
Ö&âHÂNĦŨIJûŖ´ŗ
ÖƉŽ–-GHM–´¬
|
*Y
Ґvûn
ÖƉŽÂFE‚sĦŨIJ»ò¬}ƭìƗ´;˜FGķuvûŖ´ŗ
Seam.Remoting.subscribe()
)
Rñò2°¬ÂFE‚Ž
)
ȑˏ%n
,Ã-ÂFE‚}Ċ–‚PGÂFE‚%´ŗ
;˜FGķuțñò¬ÂFE‚NM&,-Ų’}´¬ŷƎn
instanceof
Ǻ͙Xš›2ÂFE‚s Seam.Remoting.TextMessage v&º Seam.Remoting.ObjectMessage
%µ¬&º,-´¬Œ}s%ÞŖ´ŗ
TextMessage
Ž!&
text
O@<,Ã-ƜġØ ÆŖœŽĤľû getText() ƭìƗ´Çn ObjectMessage Ž!&
object O@<Ċ–‚PGƜġØŖ´ ÆŖœŽ!& getObject() ÂÚF<ƭìƗ´Çŗ
©C©
)Q\
IJ
12
ĈJK.$”4KLO”'Ŀŀ±©
ČFG&–-GHM–ŀŁ´¬Žn
ƭìƗ¯2ČFGÒ%ț¯Ŗ´ŗ
Seam.Remoting.unsubscribe()
Seam.Remoting.unsubscribe("topicName");
1S T!%—.&MI4'Łł±©
R™&Ƕ²ēĔĂă´¬œ1Èĸ%Þ¬âHÂNs
)
Seam.Remoting.pollInterval
®¯°ÂFE‚“¯2ŶjRsǶ²´¬ç͛Ăă¯Ŗ´ŗ
—O¶cdŽ o vûŖ´ŗ
ÖµûŖ´ŗ
ÖƉŽ
%n
ΙſÌ%Ěǹ¯Ŗ´n
) ÖƉ&âHÂNŽ Seam.Remoting.pollTimeout %n Œ&âHÂNŔΙſÌ%ĚǹñòŖ´ŗ
˜ǵ&G?-sNM‡œ¯2æΠ&żΡɍħ´¬Ŗ%&®¯°ÂFE‚ȏķ
´¬ɐñĂă¯Ŗ´ŗ
—O¶Ž
oΙ%n
˜sRñò¬}Tħ%Þ¬ÂFE‚sv°ŷƎæΠ&żΡsƣnjĺñòŖ´ŗ
ƜƁţcd´¬ŷƎơƬsŲ’%´ŗ
ŚG?-sÂFE‚ȏķ´¬Ų’sµ¬}°"Œ}Žn
ÂFE‚sĦħñò¬Ŗ%ŖœŽ!&G?-sNM‡œ´¬Ŗ%˜-DF<sǫ
dñò¬}°"Œ}vûŖ´ŗ
Œ"¯œG?-sÍΐƾƒǶ²´¬}n
ǕɎ&-DF<sǫdñò¬§¨vûŖ´ŗ
pollTimeout
Œò»&Ċ45Ž
YZ[
ǐȍ%cd´¬Œ}ʰʱ¯Ŗ´sn
Ų’ż2
C
Y
%$ɆÞ´¬Œ}s%ÞŖ´ŗ
ŧ&è%ŽR™sºvû™DF4–Ƕ²´¬«"cd´¬ēĔz¯2°Ŗ´ŗ
Œò»&âHÂNŽȦš£&345ǃúvƜcd¯2ţŦñ°ŗ
YZ[6
<remoting:remoting poll-timeout="5" poll-interval="1"/>
C
Y6
// Only wait 1 second between receiving a poll response and sending the next poll request.
Seam.Remoting.pollInterval = 1;
// Wait up to 5 seconds on the server for new messages
Seam.Remoting.pollTimeout = 5;
©C©
)Qa
11 ò \ Ė
b m m Ye m óJ[ ]` *[ö Æó]*Ç C[Y à
##å YY[
f
ņ YC J [à m [[_ ó]* _J [à
_m Y
* ó]*ņ _ m à [à e[ _m m ó]* [ f e
` e mY6½½
JJ[
½_`[ö½ *m mY Y Zf
Y[ m_ ó]* _ö m_ 11 
*m Y
[ eJ Ė ó]* YY[
ņ m_C m
C[ ` [[ ¢mY )\ņ ¢eJJ Y
öJJ
YY[
e [
111 y ĉ *m e Y YYJ Y ` [[ C ó]*ņ `m àf
m à
m C
e
e m m à _m [[ m e
m
e
m[
Z
m
ó]*
e
com.google.gwt.user.client.rpc.RemoteService6
public interface MyService extends RemoteService
{
public String askIt(String question);
}
*m à
m e
m[ ` [ņ Z
Y m [ f
[ AsyncCallback Y e m e m m [6
public interface MyServiceAsync extends RemoteService
{
public void askIt(String question, AsyncCallback callback);
}
*m à
m e
ņ m ZY[ MyServiceAsyncņ _[[ ` Y[ `à ó]* m[ C ` Y[ [à
*m Z Yņ Y m Y[ m à
m e
6
@Name("org.jboss.seam.example.remoting.gwt.client.MyService")
public class ServiceImpl implements MyService
{
@WebRemote
public String askIt(String question)
{
if (!validate(question))
{
throw new IllegalStateException("Hey, this shouldn't happen, I checked on the client, " +
"but its always good to double check.");
}
return "42. Its the real question that you seek now.";
©C©
)Qg
m óJ[ ]` *[ö
}
public boolean validate(String q)
{
ValidationUtility util = new ValidationUtility();
return util.isValid(q);
}
}
*m m m m[ ` `[ C ó]* ` _m m
@WebRemote ņ _m
m Ė e [[ _`f`[ m
112 œĖ ò\ ē *m Z Yņ _ m m m à
m e
m f
Y *m m ` [
m _J [ņ _[[ ` `à m _f
J ` e
m à
m [ `6
private MyServiceAsync getService()
{
String endpointURL = GWT.getModuleBaseURL() + "seam/resource/gwt";
MyServiceAsync svc = (MyServiceAsync) GWT.create(MyService.class);
((ServiceDefTarget) svc).setServiceEntryPoint(endpointURL);
return svc;
}
*m e[ Y _ m _J m Cö m m m [ `
*m e[[_J ZY[ Y[ e
_m [`[ņ Z Y `f
6
public class AskQuestionWidget extends Composite
{
private AbsolutePanel panel = new AbsolutePanel();
public AskQuestionWidget()
{
Label lbl = new Label("OK, what do you want to know?");
panel.add(lbl);
final TextBox box = new TextBox();
box.setText("What is the meaning of life?");
panel.add(box);
Button ok = new Button("Ask");
ok.addClickListener(new ClickListener()
{
public void onClick(Widget w)
{
ValidationUtility valid = new ValidationUtility();
if (!valid.isValid(box.getText()))
{
Window.alert("A question has to end with a '?'");
}
else
{
askServer(box.getText());
}
}
});
panel.add(ok);
initWidget(panel);
}
©C©
)Qh
m óJ[ ]` *[ö
private void askServer(String text)
{
getService().askIt(text, new AsyncCallback()
{
public void onFailure(Throwable t)
{
Window.alert(t.getMessage());
}
public void onSuccess(Object data)
{
Window.alert((String) data);
}
});
}
...
]m [
öņ m ` Cö m askServer() m YJ m e m Y
Z Æ m ZY[ņ C[ [ Ye m m Y C[
ĖÇ *m askServer() m Ė e
m à
m [ `
Æ `à m getService() mÇ Cö m askIt() m *m [ Æ J e m [[ e[Ç m_ [ __
*m Y[ e m ZY[ ` e m ` m examples/
remoting/gwt à
11S ò\ + 
b Y[à e ó]* YYņ m Y[ffC
Y Y Æ_m
m Y
`f
e
m Ç *m [à _m
m ` e m [
óA [à m ó]* YC * mņ à _[[ mC m ö B à [Ymņ _[[ ó]* _[ Æ_m
m à _[[ e m àf
_àÇ
*mņ à e[ņ Y[
Æ m Y e à e[Ç6
<taskdef uri="antlib:de.samaflost.gwttasks"
resource="de/samaflost/gwttasks/antlib.xml"
classpath="./lib/gwttasks.jar"/>
<property file="build.properties"/>
¢ build.properties e[ņ _m
m m m 6
gwt.home=/gwt_home_dir
©C©
)Qk
m óJ[ ]` *[ö
*m e m[ Y m à _m ó]* [[ *m ņ f
J6
<!-- the following are are handy utilities for doing GWT development.
To use GWT, you will of course need to download GWT seperately -->
<target name="gwt-compile">
<!-- in this case, we are "re homing" the gwt generated stuff, so in this case
we can only have one GWT module - we are doing this deliberately to keep the URL short -->
<delete>
<fileset dir="view"/>
</delete>
<gwt:compile outDir="build/gwt"
gwtHome="${gwt.home}"
classBase="${gwt.module.name}"
sourceclasspath="src"/>
<copy todir="view">
<fileset dir="build/gwt/${gwt.module.name}"/>
</copy>
</target>
*m J _m [[ _[[ Y[ m ó]* YY[
ņ Yà m Y
e
à Æ_m
m _[ ` m webapp Y e à _ f ` ó]* J ž*| C
Y e
Ç Ő C m [J m gwt-compile J f
à [_à m ó]* à
I` m ó]* _m m `_ f à m[ ` J m e à C[YJ _m ó]* e à ė J mņ B Y[J m ņ à
ė JJ m e m [ö Æ e
ņ e à ė _ė m m
`_ņ _[ J e à à m[ ù* ` J ó]* [[ f ė m
C[`[ŅÇ
©C©
)\o
12  _ēĖ ŃĂ
YJ
ńĆł«û
YJ
¹-&K‚PG
rƱā(%Þ¬«"vûn“”&Øv»Ŵ &Śȑ&ƁƂvij;,Ã-•=vŠ
&Ơ’vķu YJ 345%Į£%Þ¬«"vûŖ´ŗ
ùŅ *m YJ J [ m B`ff
[`à *m Yf
à Ė e [[ fYJ J mĖ C m mY
YJ “´¬ &R«ûŧ&«"vŒ}stuvûŖ´ŗ
ş
;RSM-N- YJ ` M‚PG´¬
ş
YJ ` ;RSM‚PG´¬
ş
YJ ` ;RSÈʺ´¬
ş
YJ ` ;,Ã-TǞ%Þ¬«"´¬
ş
;RS % YJ ]` 345./´¬
ş
YY e YJ ~[e*
|J
ş
YC J Y[
e YJė OpenEntityManagerInViewFilter OpenSessionInViewFilter
ş
YY e YJ TaskExecutors `
ö @Asynchronous [[
12 B%TU%
'  O%RK
±©
;RSM-N-& YJ ` ǵ&M‚PG45Žn <seam:instance/>
Ò­æç̜<Hš£¯2(°Ŗ´ŗ
Ò­æç̜<Hí¬Žn
Ò­æç YJ ` dÓOáMǣǤ¯vŨòũvûŖĿŻŗ
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:seam="http://jboss.com/products/seam/spring-seam"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://jboss.com/products/seam/spring-seam
http://jboss.com/products/seam/spring-seam-2.0.xsd">
Œò%n ;RSŽŠŻv YJ ` ŔM‚PG45tu}vûŖ¯œŗ
<bean id="someSpringBean" class="SomeSpringBeanClass" scope="prototype">
<property name="someProperty">
<seam:instance name="someComponent"/>
</property>
</bean>
;RSÒ&Ĥľû ^ ¿sĮ£tu%´ŗ
<bean id="someSpringBean" class="SomeSpringBeanClass" scope="prototype">
<property name="someProperty">
©C©
)\
YJ b_ö ńĆ
<seam:instance name="#{someExpression}"/>
</property>
</bean>
;RSM-N-Žn
YJ
ǵ&M‚PG45s%Þ¬«"vûŖ´ŗ
`
%
YJ
`
<seam:instance name="someComponent" id="someSeamComponentInstance"/>
<bean id="someSpringBean" class="SomeSpringBeanClass" scope="prototype">
<property name="someProperty" ref="someSeamComponentInstance">
</bean>
΢ΣŅ
ŽÔƒ&;,Ã-ÕÖ-,Ov;RSŗ“ż´¬Œ}Ĝˆc
ȸñòŖ¯œŗ YJ Ž!"%ŽµûŖĿŻŗ &˜M‚PG45}ɂvûn YJ
&M‚PG45ŽÂÚF<ƭìƗ¯ÎǶ²¯ŖĿŻŗ
!&Ĥľûn
YJ
`
sM-N-äñò¬}ÞŦŨn
M‚PG45ŽǶ²¯Ŗ´ŗ
ű›2n
`
sM-N-äñò¬}ސĮ£tuvM-N-Žn `&HMOMGŹĈç% `
sš£´¬Ŕ&}͏M-N-%´ŗ
èýũn
##
-;;RS&M-N-s ƣƤn ſw& YJ ` M‚PGñò¬}n
!&ſw&
YJ
`
Ž!&“”sĄą¯œŶŔŴ›}͏M-N-“´¬ȺȻƀÕ¯Ŗ´ŗ
Œ&ƺƻ-;MČĕ-}ƭŻ%°Ŗ´ŗ
4-,‡ŹȔƭìƗ¯sȝò¬«"n
˜MM‚PG45Ž-;MČĕ-s¼ǏɗÕñò¬«"¯Ŗ´ŗ YJ
%Žn
;RS&KÃ4M‚PG´¬Œ}%KÃ4sƭũòœŷƐȺȻ>Ɣ´¬Ų
’sµûŖ´ŗ
<seam:instance/>
N™%¼/Š ;RSKÃ4%Þ¬«"vûŖ´ŗ
<seam:instance id="seamManagedEM" name="someManagedEMComponent" proxy="true"/>
<bean id="someSpringBean" class="SomeSpringBeanClass">
<property name="entityManager" ref="seamManagedEM">
</bean>
Œ&Žn
YJ
`
º»
•=ij;,Ã-&š°ē&
Öz¯2°Ŗ´ŗ
Æ
•=ij;,Ã-
YJ
OpenEntityManagerInView
O@N&Ĥü}¯2ñ»ȱȲvš£ēĔŽn
YJ
ëŨ¬
•=;RS&Į£&ΖȺȻţŦñ°ŗÇ
121  ' B%TU%
O%RK
±©
YJ ` ;RSM-N-M‚PG´¬&Žñ»žſ%´ŗ
'ęn tuvēĔŽ ) ÖµûŖ´ŗ
ş
^ ¿š£¯2 YJ ` M‚PG´¬
ş
YJ ` ;RS´¬
©C©
)\)
YJ b_ö ńĆ
) ŽƉ&Ċ45Ö°2Žŧ&EG45%ɾǂ¯Ŗ´ŗ šŔžſvēĔŽ ^ ¿š›2
YJ ` GE-´¬ēĔ%´ŗ
YJ
DelegatingVariableResolver
Žn
YJ
}
b
ńĆ´¬œ1
YJ
«ûƿǀñò¬M,™D45RM%´ŗ Œ& VariableResolver š£´¬}n `
%´ƚ2& YJ ` ^ ¿ %š£%Þ¬«"¯Ŗ´ŗ DelegatingVariableResolver
faces-config.xml ǣǤ´¬Ų’sµûŖ´ŗ
<application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
</application>
*m à B
YJ ` J @In6
@In("#{bookingService}")
private BookingService bookingService;
^ ¿%M‚PG45("œ1 YJ ` š£´¬Œ}ĂȃŽµûŖĿŻŗ %
^ ¿sš£ñò¬}Œȅv»ŠŒ%Ŕ
YJ
`
š£´¬Œ}s%ÞŖ´ŗ
KE-}‚OKdÓn ðÙÂÅ45vŠŗ
122  ' B%TU%
±©
Ò­æç̜<Hš£´¬}n
ŠŻv
YJ
;RS´¬Œ}s%ÞŖ´ŗ
;RS¯œ°
<seam:component/> N™TǞ´¬ŦŨ%´ŗ
<seam:component/>
`
`
%Ŕ
&ƎƏq
<bean id="someSpringBean" class="SomeSpringBeanClass" scope="prototype">
<seam:component/>
</bean>
—O¶%Žn
<seam:component/>Ž
`
dÓ%ʫý»ò¬GH-}Ò­ÝŨ2
STATELESS;RS²³¯Ŗ´ŗ }ÞëûnFactoryBean sš£ñò¬ŷĆvŠn YJ
` &GH- s ` dӐƗ2ţ¬GH-%Žv°Œ}sµûŖ´ŗ Œ&«"vŷĆn class
ŽǂzŠƓdñòvŨòũvûŖĿŻŗ
Ò­ÝŨΤĆ&tuĬsµ¬ŷĆn
;RSÒǂzŠƓd¯2ŔŞ°ŖĿŻŗ
YJ ` Ğd& -;%•=¯œ°ŷĆn <seam:component/> & scope
ƙĬš£´¬Œ}s%ÞŖ´ŗ Ɠdñò¬ -;s STATELESS %Žv°ŷĆn YJ
`
Ž
prototype
-;ñòvŨòũvûŖĿŻŗ
·µ¬
YJ
`
ŽĻļ-,D-vĞȬĜˆŠÕ›2°Ŗ´&%n Œ&ƙĬŽwʕŠŽƄ’vûŖ´ŗ
12S 4B&.  ńĆâF3‚Žn
YJ
)o
-NM&L-N‡-;}¯2
;,Ã-&Į£Ŕtu¯Ŗ´ŗ Š&«"v ;,Ã-ŀ%Ŕ´ƚ2& YJ `
ƎƏ´¬Œ}s%ÞŖ´ŗ
œŦ¯n
YJ
;RSŗŽ-,O“ż´¬«"ŽŞȷñò2°v°Œ}ƲƂȶ°Ɨ¯2
©C©
)\+
YJ b_ö ńĆ
ţŦñ°ŗŒ&Œ}º»nˆķu&š£ŽΥƢ(›2ţŦñ°ŗ
Аn
EF45µ¬°Ž“”-;& YJ `&GH-N™Ž̈́ș°ƺƻŽ»Ż%ëûn
˘°̟̠&-;º»ˎ°̟̠&-;&
`

`
ŖœŽ;RSM‚PG´¬ŷƎn ɧÁơƬΦ›2ţŦñ°ŗ
YJ ` e
à cd%<seam:configure-scopes/> wƂƓd´¬}n ´ƚ2& -;sL-N‡-;}¯2 YJ ` Į£tuvûŖ´ŗ YJ ` Ğd&
-;ŋŌÝŨ¬Žn
`
dÓ&
scope
ƙĬ%
-;Ɠd¯2ţŦñ°ŗ
<!-- Only needs to be specified once per bean factory-->
<seam:configure-scopes/>
...
<bean id="someSpringBean" class="SomeSpringBeanClass" scope="seam.CONVERSATION"/>
dÓq&
prefix
ƙĬƓd´¬Œ}«›2n
-;Ò&DO@FG-Èĸ´¬Œ}s%ÞŖ´ŗ ƗO¶&DO@FG-Ž seam.
%´ŗÇ
configure-scopes
à e[ e YJ ¢Y J m _à [[à
_m e
J @In * mC f
à m Yf
eà @In(create=true) m B
Y eà Y
e
` ` f
à m default-auto-create ` e configure-scopes ö [[
YJ ` _m Y Œ&ēĔ%dÓñòœ
-;&
YJ
`
Žn
<seam:instance/>
š£´¬Œ}vţĩ&
YJ
`
M‚PGtu%´ŗ
œŦ¯n
-;MČĕ-sŲŴɗÕñò¬«"ɧÁơƬ¯2ţŦñ°ŗ
YJ
%wʕŠš£ñò¬ēĔŽn ` dÓq%& <aop:scoped-proxy/> &Ɠd%´ŗ ¯º¯n
-;& YJ ` Ž <aop:scoped-proxy/> }&ʹʺĬsµûŖĿŻŗ ¯œs›2n
ſw&
`

-;
YJ
`M‚PG´¬Ų’sµ¬ŷĆn
<seam:instance/>š£¯vŨòũvûŖĿŻŗ
<bean id="someSpringBean" class="SomeSpringBeanClass" scope="seam.CONVERSATION"/>
...
<bean id="someSingleton">
<property name="someSeamScopedSpringBean">
<seam:instance name="someSpringBean" proxy="true"/>
</property>
</bean>
12[ ’  yz
YJ YC Z`[ J `
_m YY e à
#~ Æ~#ņ ž`ņ €ņ *#Ç YJ [ YC Jm J
_m à YY[
C *
|J m ]`Ym ]`[J
YJ
J ZY YY e à C
e m f
YY e[[ C ^^ YYJ [ [ö I^ĒAI^͘ù^] ù*͘A~~I*^€
b
e
m
YJ
m
©C©
)\Q
YJ b_ö ńĆ
ŬmY6½½
YJe_öJ½YJ½
½)oZ½e
½
m[ŭ
* eJ YJ `[ m YJ*
Y [ö
6
<spring:spring-transaction platform-transaction-manager="#{transactionManager}
*m spring:spring-transaction Y _[[ [č YJ à
mč
Y`[ e à
mč [[`
ö
12^ ’ z y Ä 
 e m Y_e[ e e C Y m `[à mC ^à|J Y e m [e e C *m [ à e m
Y`[ _m m m f
m e _[[ Jf
e m LazyInitializationException YJ YC _à
J Y
Z `à m Y e J[ _` Ė ÆOpenEntityManagerInViewFilterÇ ņ _[ ` e YJ C[Y [ mC J Y
Z J [[ e m [ YJ YC e J
_m ~#ÆJ PersistenceAnnotationBeanPostProcessorņ JpaTemplateņ Ç
YC _à e YJ J Y
Z _m YJė
YC ~# [ `JJ C Y Y
Z Y`[ YJ YY[
*m J _ö YC m e[[_J e
[à6
ş
Y J Y
Z J YJ YC [
ş
C Y Y
Z _` Ė ÆJ
à
m Ėč B`Ç
ş
[[_ e J J Y
Z _m YJ J Æ_[[ e[m m Y
Z [[àÇ
YJė Y
Z YYJ [ [[_ [à Y ^à|J Y ^f
à|Jb
à m J _ö `à _YYJ ^à|Jb
à
J Y
Z
<bean id="seamEntityManagerFactory" class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBe
<property name="persistenceContextName" value="entityManager"/>
</bean>
]m ėY
¢Zùė m e m J Y
Z f
Y à e[ m ^à|Jb
à m ù Ė[ m Y
m ėà|Jė e à _m YC ee ù à `à YCJ Y
Aù [ö 6
<bean id="seamEntityManagerFactory" class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBe
<property name="persistenceContextName" value="entityManager"/>
©C©
)\\
YJ b_ö ńĆ
<property name="persistenceUnitName" value="bookingDatabase:extended"/>
</bean>
*m ^à|Jb
à m ` à YJ YC [ b ZY[ņ f
J YJė PersistenceAnnotationBeanPostProcessor m Z
`e
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
e à e à [ ^à|Jb
à YJ ` _m J
Y
Z à [[ m PersistenceAnnotationBeanPostProcessor _m
m Yf
Aù à _m `à e[ `à Y
eàJ m defaultPersistenceUnitName YYf
à
*m applicationContext.xml Jm [ö [ö6
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName" value="bookingDatabase"/>
</bean>
<bean id="seamEntityManagerFactory" class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBe
<property name="persistenceContextName" value="entityManager"/>
<property name="persistenceUnitName" value="bookingDatabase:extended"/>
</bean>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor">
<property name="defaultPersistenceUnitName" value="bookingDatabase:extended"/>
</bean>
*m component.xml Jm [ö [ö6
<persistence:managed-persistence-context name="entityManager"
auto-create="true" entity-manager-factory="#{entityManagerFactory}"/>
JpaDaoSupport eJ m _à e J Y
Z mà _[ ` e J Y
Z
JpaTemplate
<bean id="bookingService" class="org.jboss.seam.example.spring.BookingService">
<property name="entityManagerFactory" ref="seamEntityManagerFactory"/>
</bean>
12b ’ z œ 
*m YJ J [ YC YY e Y[ J
ž` J YJė [ *m J Cà [ m ~# f
J
ö YJė ~# J YJė YYJ [ [[_ [à Y ^à|f
J Y ^à|Jb
à Y ććć ` C[`[ YJ [ ņ m
J _ö `à _YYJ YZà b
à J
ž` Z
<bean id="seamSessionFactory" class="org.jboss.seam.ioc.spring.SeamManagedSessionFactoryBean">
<property name="sessionName" value="hibernateSession"/>
</bean>
]m ėùė m e m persistence:managed-hibernate-session Y
©C©
)\a
YJ b_ö ńĆ
*m b
à m ` à YJ YC [ *m J [
YC YY e [[ SessionFactory.getCurrentInstance() [J à [[ Jf
¢
ÆÇ m SeamManagedSessionFactory
12c B%TU%
Ä
w¬9.  + |
345&ÕÖ YJ & #YY[
¢Z ./´¬œ1 YJ & ContextLoaderListener š£´¬Œ}Ž%ÞŖ´sn Ís°ţÖºµûŖ´ŗ
ş
YJ #YY[
¢Z Žn SeamListener&Ŷ./ñòvŨòũvûŖĿŻŗ
ş
7ŎF̥ìńĆ,-%&š£ƉŠ}¯œ
&./Ž̡˴vŒ}sµûŖ´ŗ
YJ
#YY[
¢Z
Œò» ) Ö&ÍΧΨ´¬œ1 YJ ńƐŽ YJ #YY[
¢Z ./´¬
;RSsġŖò2°Ŗ´ŗ
Œ&
;RSš£´¬Žn
<spring:context-loader/>
&dÓ
components.xml
TǞ¯Ŗ´ŗ
config-locations
ƙĬ%š£´¬
YJ
;,Ã-OáM&ŷǧƓd¯Ŗ´ŗ
ԃ&cdOáMsŲ’vŷƎn
S-ñò¬
<spring:config-locations/>
?DTǞ´¬Œ}s%ÞŖ´ŗ
Œò("Žn
components.xml
OáMÔƒ&Ɯ?DÂǣǤ´¬Ĝƒű›2ţŦñ°ŗ
<components xmlns="http://jboss.com/products/seam/components"
xmlns:spring="http://jboss.com/products/seam/spring"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.0.xsd
http://jboss.com/products/seam/spring
http://jboss.com/products/seam/spring-2.0.xsd">
<spring:context-loader config-locations="/WEB-INF/applicationContext.xml"/>
</components>
12f ’  Ė]Ä ĕ+ĉ
YJ YC `
e Z
J à
m[à [[ TaskExecutor
*m YJ J [[_ e m e YJ TaskExecutor e Z
J f
@Asynchronous m [[ * `[ m e
[à [[ m SpringTaskExecutorDispatchor YC YJ ` e ö^Z
[ö 6
<spring:task-executor-dispatcher task-executor="#{springThreadPoolTaskExecutor
YJ TaskExecutor YY m[J e à
m C e[[f
`
ö Dispatcher ` YC m[ m[ à
m C [ö 6
<!-- Install a ThreadPoolDispatcher to handle scheduled asynchronous event -->
<core:thread-pool-dispatcher name="threadPoolDispatcher"/>
©C©
)\g
YJ b_ö ńĆ
<!-- Install the SpringDispatcher as default -->
<spring:task-executor-dispatcher task-executor="#{springThreadPoolTaskExecutor}" schedule-dispatcher="
©C©
)\h
1S œ 1S b[[ Z m J [ö #Y
m Ω Cà Y_e[ m[Jà `J e
Z½ee
Ė YY[
e ee C[ m _m [J _m
`B
[ ÆöYJ m Z Y ņ m `_ m Z f
m [ņ ĖàJ mÇ ž` m Z à [ mö e_ ņ ö e m ` ½ Z à
mč `J à `
ö J[ J `B
e e Z Ė ž` m J
#Y
m m C
ž` m m ` J J [à [[à Y`[ _m
~# ž` # [ Zņ YC ž` m Jf
~[ e m ž` m Ŭćććŭ e e Y
e
m
ž` m YB
1S1 
ž` m eJ m m META-INF/persistence.xml hibernate.cfg.xml
e[
ž` m eJ m `[ e[ e eJ Yņ
ž Y e m [ eJ J <persistence-unit name="sample">
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
[...]
<!-- use a file system based index -->
<property name="hibernate.search.default.directory_provider"
value="org.hibernate.search.store.FSDirectoryProvider"/>
<!-- directory where the indexes will be stored -->
<property name="hibernate.search.default.indexBase"
value="/Users/prod/apps/dvdstore/dvdindexes"/>
</properties>
</persistence-unit>
e à Y[ J ž` # ^à|J +)Z Æ` # Q)ó#Çņ à [ eJ m YYY C [
<persistence-unit name="sample">
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
[...]
<!-- use a file system based index -->
<property name="hibernate.search.default.directory_provider"
value="org.hibernate.search.store.FSDirectoryProvider"/>
<!-- directory where the indexes will be stored -->
<property name="hibernate.search.default.indexBase"
value="/Users/prod/apps/dvdstore/dvdindexes"/>
©C©
)\k
ž` m
<property name="hibernate.ejb.event.post-insert"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-update"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-delete"
value="org.hibernate.search.event.FullTextIndexEventListener"/>
</properties>
</persistence-unit>
ù
*m Y [J e[ e ž` # ^à|J ++Z m eJ e[ņ m e[[_J B mC ` Y[à6
ş
m`f
mB
ş
m`f
fB
ş
[
f
B
ù
e à Y[à m ^#Iņ ė eJ Y application.xml
1S2 ’
ž` m Y Zņ m
ö m e
ŬmY6½½___m`J½m`͘
½
m½e
½½m[͘J[½ŭ e
e
ž` m e[[à J _m m #~ e ~# ½ ž`
_
mJ e žĒ ¢ ` Ėà Ė B e_ [ e *m #~ m YY[
_m m FullTextSession #~ Æ`
[ e ž`ė
SessionÇ
]m ž` m Yņ B
FullTextSession
@Stateful
@Name("search")
public class FullTextSearchAction implements FullTextSearch, Serializable
{
@In
FullTextSession session;
public void search(String searchString) {
org.apache.lucene.query.Query luceneQuery = getLuceneQuery();
org.hibernate.Query query session.createFullTextQuery(luceneQuery, Product.class);
searchResults = query
.setMaxResults(pageSize + 1)
.setFirstResult(pageSize * currentPage)
.list();
}
[...]
}
©C©
)ao
ž` m
ù
Z org.hibernate.Session m ` J[
ž` FullTextSession
e m C ~
#~ ņ m J YY
@Name("search")
public class FullTextSearchAction implements FullTextSearch, Serializable
{
@In
FullTextEntityManager em;
public void search(String searchString) {
org.apache.lucene.query.Query luceneQuery = getLuceneQuery();
javax.persistence.Query query = em.createFullTextQuery(luceneQuery, Product.class);
searchResults = query
.setMaxResults(pageSize + 1)
.setFirstResult(pageSize * currentPage)
.getResultList();
}
[...]
}
]m ž` m Yņ FulltextEntityManager B
FullTextEntityManager Z EntityManager _m m Y
e
mņ m _à FullTextSession Zf
Session
]m ^ +o |J €C B
Æ J
©~
¢ZÇņ Y`[ Y[
m EntityManager e
`à m
FullTextEntityManager e
m [ ž_Cņ m Y[
B
_[[ ` FullTextEntityManager Y[6 _
J m Y`[
@Stateful
@Name("search")
public class FullTextSearchAction implements FullTextSearch, Serializable
{
@PersistenceContext
EntityManager em;
public void search(String searchString) {
org.apache.lucene.query.Query luceneQuery = getLuceneQuery();
FullTextEntityManager ftEm = (FullTextEntityManager) em;
javax.persistence.Query query = ftEm.createFullTextQuery(luceneQuery, Product.class);
searchResults = query
.setMaxResults(pageSize + 1)
.setFirstResult(pageSize * currentPage)
.getResultList();
}
[...]
}
¢
b
YY[
ž` m
Search.createFullTextSession à
e
ņ
m
J
¢m
ö m €€ m `[J ZY[ e m ` e ©C©
)a
ž` m
e ž` m
©C©
)a)
1[  Ė ¢eJ Cà `J Y
Z[à Y Ae[àņ
C[ [ e å| Ė J à b Y[ f
C[ *mė ` Y ee `à m e[[_J ̽ àė[[ C
àY à e m ee à[eņ à B Yà Y e m Zf
Y[ YY[
Ņ
1[ 
bņ [ė [ö m `
eJ m _mC _ _m
b
1[  ē _ ĉ Æ e ņ à e
C[Ņ
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
ÆŐ B m AI Y à Ç
ņ Ė m e[[_J à à web.xml e[6
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
*m [ Y`[ e `YYJ ņ e àJ Yf
Y[
Z
b Y[ mC `ö Y[ e Cf CJ m
e _m ė C YYJ e à mC Y`[ _m C
YYJ J e `ņ à _
mJ [f CJ Őė[[
m web.xml6
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
1[1 ’ ©C©
)a+
¢eJJ Y
öJJ YY[
e à _ e[[_ C
e
[ e ~ņ m e[[_J [ faces-config.xml6
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
# m e[[_J [ web.xml6
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
1[2 j Æ
*m I
C[ YC `à IJņ Y
m Æ m f
à mYÇ b A [ ¢eJJ m I
C[ Ė
m e[[_J à web.xml6
<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
1[S Æ ė à C[ e[ e `
Y ž_Cņ m C[
e _m
m Y Y m e e[ * ö mJ ņ [ à eJ C[ e[ B [ö à _[ eJ m `[f Yf
* ö CJ e m eņ _ e [[ e[ web.xml6
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
*m e[ ` m e e[ Y
e web.xml *m e
*m e[ m ` e `ņ à m components.xml
à Y `[_6
ş
url-pattern
ő A Y
eà _m
m Ė e[ņ m e[ [[ Ė
©C©
)aQ
¢eJJ Y
öJJ YY[
url-pattern
*
à[ Y _m
m [[_ _[
eeZ
ş
regex-url-pattern
ő A Y
eà _m
m Ė e[ņ m e[ [[ f
Ė regex-url-pattern J[ ZY m e Ė Ym ė
_m J _m YJ m J[ ZY m m Ė Ym f
m C Ė Z Ym
ş
disabled
ő A `[ `[ e[
#J m e[ `[ m e[[_J `[f e[
]Ä 
*m e[ YC m Z
Y YYJ e
[à pages.xml Æ[ [[ YY[
f
_[[ mÇ [ ö e [[J `
ö _m
Jm Z
Y Æ#
J m C ^^ Y
e
ņ m _` m[ m [[àņ ` _ėC e m m `mC ` [ Y [[ YY[
C # [à Ė e Y[ C[ J [ö
*
Ç
à e[ņ m Z
Y m[J e[ _[[ Y
[[ Ėņ m_C m `mCf
à ` B `à J <web:exception-filter> à components.xmlņ m_ m ZY[6
<components xmlns="http://jboss.com/products/seam/components"
xmlns:web="http://jboss.com/products/seam/web">
<web:exception-filter url-pattern="*.seam"/>
</components>
Æ  ē *m e[ [[_ YYJ m C Z `_ Y à `_ Ė Y m Y
e m C e
*m e[ _[[ Y
[[ Ė `à e[ņ ` m `mC [ `
B components.xml6
<web:redirect-filter url-pattern="*.seam"/>
z *m e à _m J m e[ Y[ b [ [f
Y e Ė Y
m J m [Y½ef Y
e
ÆIb¢f)+hhÇ * C m e[ Jņ m e[[_J à components.xml6
<web:multipart-filter create-temp-files="true"
max-request-size="1000000"
url-pattern="*.seam"/>
©C©
)a\
¢eJJ Y
öJJ YY[
ş
create-temp-files
ő e trueņ Y[ e[ _ Yà e[
Æ e m[ àÇ *m à ` Y e [J e[ Yf
[ ZY
*m e[ J false
ş
max-request-size
ő e m č e e[ Y[ Ė Æ `à J m Content-Length m m ĖÇ Z
m C[ņ m Ė _[[ ` ` *m
e[ J o Æ č [Ç

m m
J e ` e *m e[ [[ `à e[ Ė à components.xml `[
6
<web:character-encoding-filter encoding="UTF-16"
override-client="true"
url-pattern="*.seam"/>
ş
encoding
ő *m J ş
override-client
ő e m trueņ m Ė J _[[ ` _mC
Y
e `à encoding _mm m Ė [à Y
e J
e falseņ m Ė J _[[ [à ` e m Ė ė
[à Y
eà J *m e[ J false
j_
e I
mb
à YB
ņ _[[ [[ m I
mb
#BZ e[ e
àņ öJ [[ `e [[ m `[f e[ Ő ė f
[[ m I
mb
#BZ e[ web.xml à[e
*m I
mb
#BZ e[ [à [[ e m I
mb
B Y à
YB
* C m e[ Jņ m e[[_J à components.xml *m Y
m m Y
e m I
mb
€C[Y ó6
<web:ajax4jsf-filter force-parser="true"
enable-cache="true"
log4j-init-file="custom-log4j.xml"
url-pattern="*.seam"/>
ş
force-parser
ő e
[[ b YJ ` C[ `à I
me
ė å| àZ m
ö
e falseņ [à ##å Y C[ C _[[fe å| J
force-parser false YC Ye
ņ ` YC C[ e
##å
Y
ş
enable-cache
ő `[ mJ e e_öfJ ÆJ BC
Yņ ¢ņ
Jņ Ç ]m C[YJ BC
Y ¢ņ J YC m
`_ e mJ m ©C©
)aa
¢eJJ Y
öJJ YY[
ş
ő Y YfYY[
[JJJ # Ymņ [C _` Yf
Y[
Zņ m [JQBZ[ eJ e[ m[ ` YC
log4j-init-file
ĉ Ÿ
*m e[ m m
m [JQB YY J
Z m ` [ e [J Y e ņ `à J ʿåΪΫ m
Y
à e[ņ m [JJJ e[ _[[ Y
[[ Ėņ m_C m `mC à `
B `à J <web:logging-filter> à components.xmlņ m_ m Zf
Y[6
<components xmlns="http://jboss.com/products/seam/components"
xmlns:web="http://jboss.com/products/seam/web">
<web:logging-filter url-pattern="*.seam"/>
</components>
Ä  Æ
IĖ C[ m m m b C[ Y
mJm
m b [e
à
[ņ YC C[ e[ m ` YY[ à m
C[ m Y
*m e[ [[_ C[ _m m Z Y m
Z m `JJ e m Ėņ m _ m e m f
Ė Ő m[ ö m m e[ C YY[ m b FacesServlet
m Ym [ e Z J b Ė
*m e[ [[ `à e[ Ė à components.xml `[
6
<web:context-filter url-pattern="/media/*"/>
*m Z e[ ZY
e m C e à C Z Ė Y conversationId Ő Y`[ e J m J m Ė
Ő [ Y`[ e J YYJ e à _ C `
ö m
[ ZY m C YYà e m `[ Y conversation
+ [[ à e[ e àņ [[_J à Y
eà _m m m à
e[ Y[
Æm C[ Y
e
ė YC _[[ e e à
Y
eà à e[ web.xmlÇ m @Filter à Y
Æ_m
m Y[ javax.servlet.FilterÇ6
@Startup
@Scope(APPLICATION)
@Name("org.jboss.seam.web.multipartFilter")
@BypassInterceptors
©C©
)ag
¢eJJ Y
öJJ YY[
@Filter(within="org.jboss.seam.web.ajax4jsfFilter")
public class MultipartFilter extends AbstractFilter {
#J m @Startup m m Y C[`[ J Y̽
`B
ė C[`[ m Æ@BypassInterceptorsÇ̽ m e[ m[ ` em
_
m
m
m
m
I
mb
e[
Æ@Filter(within="org.jboss.seam.web.ajax4jsfFilter")Ç
1[[  ē ĉ ] ] YY[à m SeamInterceptor Y *m Y[ _à m
YY[
m e[[_J Y eJ ejbjar.xml6
<interceptors>
<interceptor>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor>
</interceptors>
<assembly-descriptor>
<interceptor-binding>
<ejb-name>*</ejb-name>
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
</interceptor-binding>
</assembly-descriptor>
ö_ _m J e ` ù€  _à m Yf
eà m @JndiName Cà ` Y ž_Cņ m Ė
# ` YY
m Y
eà Y m [
[ m
ù€ e m ^ Ae[àņ m YYJ J[`[ ù€
e m ^+ Y
e
ņ m YYJ CfY
e
] [[à Y
eà
m Y components.xml
b #ņ m e[[_J Y 6
<core:init jndi-name="myEarName/#{ejbName}/local" />
]m myEarName m e m ^#I _m
m m ` Y[à
 m Z e ^#I Æ_m J m ^``[ ^+ Çņ m e[f
[_J Y m 6
<core:init jndi-name="#{ejbName}/local" />
Őė[[ mC ZY e m Jm J e m YY[
C ù
m C Æ
m ó[bmÇ Ė à Y
eà ù€ e [[ ^ f
Y ZY[
[à Æ [àÇ m ņ à Y
ö à _ Y ̽fÇ
^+ Cņ _ m e Y
[ `[f Y e f
Jņ m e[[à _ e ņ [à Y
C J _m m Events Y e à ė m
[ à components.xml e[ņ _ė ö_ _m fJ 6
©C©
)ah
¢eJJ Y
öJJ YY[
<transaction:ejb-transaction/>
1[^ }Ĕ ń
*m e[ à ö_ ` Ő Y[
seam.propertiesņ METAINF/seam.properties META-INF/components.xml e[ à mC _m
m à f
Y Y[à ÆC Yà YY e[ _[[ Ç # Yņ _[[ à mC _m seam.properties e[ e Y
_` mC Æ]#IÇ e[ņ à Y[
seam.properties e[ m WEB-INF/classes
à e à mC à Y [ m
*mė _mà [[ m ZY[ mC Yà seam.properties e[ Ő ė B [
m e[ ZY
CàmJ [[ _öŅ
Ő Jm mö m [[à _m ö e e_ö J _[ ö Yà e[ ee
m `mC e m e_ćć ][[ņ m _ö e [f
e m |őe _ ė m mņ Z ` Y _[ ` e
à [ Cà Y ZY[
[à components.xmlņ B [ö m f
YJ e_ö Ņ mö àė[[ [ö _à `
1[1  Æ ]] [
e àė J C ^^ \ Cņ m [[ m eJ Ė J Ņ
1[1 yĖ

àėC Y
öJ [[ m ee Jm ^#Iņ m mC _[[ [ö
mJ [ö m6
my-application.ear/
jboss-seam.jar
lib/
jboss-el.jar
©C©
)ak
¢eJJ Y
öJJ YY[
META-INF/
MANIFEST.MF
application.xml
my-application.war/
META-INF/
MANIFEST.MF
WEB-INF/
web.xml
components.xml
faces-config.xml
lib/
jsf-facelets.jar
jboss-seam-ui.jar
login.jsp
register.jsp
...
my-application.jar/
META-INF/
MANIFEST.MF
persistence.xml
seam.properties
org/
jboss/
myapplication/
User.class
Login.class
LoginBean.class
Register.class
RegisterBean.class
...
Ő m[ [ jboss-seam.jar B` [ META-INF/application.xml̽ jbossel.jar m[ ` Y[
m ^#Iė [` à ÆYJ m ^#I [Ym
e à _ B~| €[ņ à [ m B m ^#Iė [` f
à
e à _ e
[ Æ Çņ à [ jsf-facelets.jar m
WEB-INF/lib à e m ]#I
e à _ m J [`à Æ YY[
Çņ à [
jboss-seam-ui.jar m WEB-INF/lib à e m ]#I e à _ m ~€b [ J [`ņ à Y jboss-seam-pdf.jar jboss-seam-mail.jar WEBINF/lib
e à _ m `J YJ Æ[à _ö e YY[
J e
[Çņ à
[ jboss-seam-debug.jar m WEB-INF/lib à e m ]#I
mY _m C[ ZY[ YY[
m Y[à`[ à C ^^ m YY ^ +o
[[à _m m _ [[ m _ à m Y
e eJ ` ef
[à _ė [à ` m e m _à m e àė C_m[ `à [[ m
eJ eeņ e[ e öY C m e m `
ö [
1[2  1]]
©C©
)go
¢eJJ Y
öJJ YY[
e[ C e àė à à ö m Y[J ^ +o m à _[ ž`+ ~# e ^ +o Y
ņ Y[ C f
e ` Őė[[ e m e e ` `
_[[ ` Cà à J ^ +o _m àė à ņ m ņ àė[[
` `[ ö CJ e ė Ė [C J m
C Y YC [C [ö ` Ő [ J à [[à J m *# UserTransaction f
[C[à J ė @Transactional YY[
_[[ B J _m J ž` _m C
*m ` [ C e m `öJ ZY[ YY[
m žf
`+ C e ^+ņ m C m ~# C
*m ZY[ YY[
à Y[à à )^^ YY[
C
1[2  œ _[[ `Y ž` SessionFactory e à hibernate.cfg.xml e[ e à f
[[ `[f Y6
<persistence:hibernate-session-factory name="hibernateSessionFactory"/>
Ő _[[ [ eJ J e à _ J ž`
Session ` C[`[ C B
<persistence:managed-hibernate-session name="hibernateSessionFactory"
session-factory="#{hibernateSessionFactory}"/>
1[21  y+ _[[ `Y ~# EntityManagerFactory e à persistence.xml e[ e à f
[[ m `[f Y6
<persistence:entity-manager-factory name="entityManagerFactory"/>
©C©
)g
¢eJJ Y
öJJ YY[
Ő _[[ [ eJ J Y
Z e à _ J
~# EntityManager ` C[`[ C B
<persistence:managed-persistence-context name="entityManager"
entity-manager-factory="#{entityManagerFactory}"/>
1[22 yĖ
] Y
öJ YY[
]#Iņ m e[[_J 6
my-application.war/
META-INF/
MANIFEST.MF
WEB-INF/
web.xml
components.xml
faces-config.xml
lib/
jboss-seam.jar
jboss-seam-ui.jar
jboss-el.jar
jsf-facelets.jar
hibernate3.jar
hibernate-annotations.jar
hibernate-validator.jar
...
my-application.jar/
META-INF/
MANIFEST.MF
seam.properties
hibernate.cfg.xml
org/
jboss/
myapplication/
User.class
Login.class
Register.class
...
login.jsp
register.jsp
...
e _ _ Y[à ž` f^^ C [ö *
*ùóņ _ [[ ` _ö
1[S  Æ ]Ņ ē ]
Y`[ Y[[à e ^^ C m ņ à
[[ m_ J ņ m _[[ ` *# C[`[ e
àė J ~#ņ à [[ ~# f[
[ ņ EntityTransactionņ [ö 6
<transaction:entity-transaction entity-manager="#{entityManager}"/>
e àė J ž`ņ à [[ m ž` #~ [ö
m6
<transaction:hibernate-transaction session="#{session}"/>
©C©
)g)
¢eJJ Y
öJJ YY[
e ņ àė[[ [ e # ` [C ^` J m ^^ #~
1[[  Æ ]Ņ ē ]
^` [ à ^+ Y m Z e m C ^^ \ YY[
f
C *m Y
[[àņ ` [àņ e[ e J
*m `öJ ZY[ YY[
[ *ùó J m ^` C SeamTest
*m `öJ ZY[ YY[
à C ` Y[à *
1[[  ] ^` `à [[ *
e YY[
[à ^` [à €ʭ \ Æ €ʭ aÇ ^` ` _[
m ŬmY6½½
eJ½YB
½m_e[YmYćJY̾͘))haaάY
öJ̾͘))hkggŭ *m
Y
e [[J ^` *
a Ė Y[ bņ à m[
Yà m ^` #I eJ e[ *
ş
¢Yà [[ e[ m ^` bootstrap lib ņ
Z
Y e m jndi.properties e[ņ m *
lib à
ş
IC m annotations-api.jar e[ e m *
lib à
©C©
)g+
¢eJJ Y
öJJ YY[
ùZņ _ eJ e[ ` Y ^` fY
e
e
f
[à
ş
# m ^` [ conf/server.xml m[ YY e [[ m
[ m e[
<Listener className="org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener" />
ş
]#I e[ J m[ ` `[ `à J [ conf/context.xml
<Listener className="org.jboss.embedded.tomcat.WebinfScanner" />
b eJ Yņ Y[ m ^` *
J _ö
à ŬmY6½½_öB`J½_ö½]öBYćYJ̾^`#*
ŭ
1[[1 yĖ
*m mC e ]#If` Y[à C[ J [ö *
_[[
[ö mJ [ö m6
my-application.war/
META-INF/
MANIFEST.MF
WEB-INF/
web.xml
components.xml
faces-config.xml
lib/
jboss-seam.jar
jboss-seam-ui.jar
jboss-el.jar
jsf-facelets.jar
jsf-api.jar
jsf-impl.jar
...
my-application.jar/
META-INF/
MANIFEST.MF
persistence.xml
seam.properties
org/
jboss/
myapplication/
User.class
Login.class
LoginBean.class
Register.class
RegisterBean.class
...
login.jsp
register.jsp
...
| e m ZY[ YY[
à ` Y[à *
`à J ant deploy.tomcat
1[^  xyz ©C©
)gQ
¢eJJ Y
öJJ YY[
ė B~| J [[ `à e[ņ àė[[ `[ B~| `à f
[[J `[f Y Őė[[ [ ZY[
[à [ à Y
YJf
e[_ e components.xml6
<bpm:jbpm>
<bpm:pageflow-definitions>
<value>createDocument.jpdl.xml</value>
<value>editDocument.jpdl.xml</value>
<value>approveDocument.jpdl.xml</value>
</bpm:pageflow-definitions>
<bpm:process-definitions>
<value>documentLifecycle.jpdl.xml</value>
</bpm:process-definitions>
</bpm:jbpm>
ù em Y
[ eJ e à [à mC YJe[_ e à mC
` Y
eņ à YC B~| eJņ ž`
eJ e B~| *m €€ [ ZY[ jbpm.cfg.xml hibernate.cfg.xml e[ m _[[ _ö _m 6
<jbpm-configuration>
<jbpm-context>
<service name="persistence">
<factory>
<bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
<field name="isTransactionEnabled"><false/></field>
</bean>
</factory>
</service>
<service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
<service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
<service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
<service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
<service name="authentication"
factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
</jbpm-context>
</jbpm-configuration>
*m Y mJ m m B~| [ `[
^+ m[ [ m *# 1[^ yĖ
*m à à _[[fe Y
öJJ e e B~| eJ Y
½
YJe[_ e e[ m ZY[ _ėC Y[à Y
öJ [[ m
e[ m e m ^#I eņ _ _[[ Y``[à J m Y
öJJ e m ^#I [ö mJ [ö m6
my-application.ear/
jboss-seam.jar
lib/
jboss-el.jar
jbpm-3.1.jar
META-INF/
MANIFEST.MF
application.xml
my-application.war/
META-INF/
MANIFEST.MF
©C©
)g\
¢eJJ Y
öJJ YY[
WEB-INF/
web.xml
components.xml
faces-config.xml
lib/
jsf-facelets.jar
jboss-seam-ui.jar
login.jsp
register.jsp
...
my-application.jar/
META-INF/
MANIFEST.MF
persistence.xml
seam.properties
org/
jboss/
myapplication/
User.class
Login.class
LoginBean.class
Register.class
RegisterBean.class
...
jbpm.cfg.xml
hibernate.cfg.xml
createDocument.jpdl.xml
editDocument.jpdl.xml
approveDocument.jpdl.xml
documentLifecycle.jpdl.xml
1[b  y
* YY[
Y[ņ àė[[ YC Y[ Æportlet.xmlņ Ç m [ C ^^ m examples/portal f
à e ZY[ e m `öJ Y
eJ ~[
1[c  _ +
Cà Y m m e e[ mJm m m
e ž**~ ņ m_ bė à `e m ė ž**~ m #YY[
C m e[ ` e +o ņ
_m
m eJ server/default/conf/standardjboss.xml ÆY[
e[ _m à _
eJÇ
*m e[ b ` B `à eàJ m C[ e max-bean-life m
LRUStatefulContextCachePolicy m eJ6
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUStatefulContextCachePolicy</cache-policy>
<cache-policy-conf>
<min-capacity>50</min-capacity>
<max-capacity>1000000</max-capacity>
<remover-period>1800</remover-period>
<!-- SFSB timeout in seconds; 1800 seconds == 30 minutes -->
<max-bean-life>1800</max-bean-life>
<overager-period>300</overager-period>
<max-bean-age>600</max-bean-age>
©C©
)ga
¢eJJ Y
öJJ YY[
<resizer-period>400</resizer-period>
<max-cache-miss-period>60</max-cache-miss-period>
<min-cache-miss-period>1</min-cache-miss-period>
<cache-load-factor>0.75</cache-load-factor>
</cache-policy-conf>
</container-cache-conf>
*m
e[
ž**~
`
e
server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml
e QoZņ server/default/deploy/jboss-web.deployer/conf/web.xml e Q)Z *m e[[_J à m
e[ [ m e[ e [[ _` YY[
6
<session-config>
<!-- HTTP Session timeout, in minutes -->
<session-timeout>30</session-timeout>
</session-config>
* C m C[ e à _ YY[
ņ Y[à [ m à à Yf
Y[
ė _ web.xml
©C©
)gg
1^ {
S
¢Q Æ
[ ¢ e CÇ J Æ
[à Ÿ*
m[Jà ~C_Ÿ [Ç f
[ė ^^\ YY[
C YY[
` Y[à ¢Qņ ` Ė
[ eJ mJņ Y
*m mY _[[ m_ à Zf
[à _m ` ] _[[ `à [öJ m `[J Y[àJ m ^^\
ž[ öJ ZY[ YY[
_m
m _m *m _ _[[ Y[à YB
J `à seam-gen b `
seam-gen YY[
_m I
mb
BZ Yņ
e
[ *m ZY m YY[
[ à _m €[ņ ~#
YC _m m`ņ ¢IA€ C JJ e |àĒ `
1^ {
S
b _ [[ m J f ¢QB *m mY Ė à ¢Q J *
m[Jà ~C_ Æ ¢Q oJÇ Ő _[ ¢Q J e mf
Y6½½___
[
½
m[Jà½
m½BC½
QB½½
ŬmY6½½___
[
½
m[Jà½
m½BC½
QB½½ŭ [_ [[
[
mņ ņ m_ m J [ b em e [[J ¢Qņ
[ m readme.txt ` _m ¢Qņ m ¢Q [[ J [
€_[ čY ¢Q
)
|ö à mC $JAVA_HOME $ORACLE_HOME C C`[ Æ
$ORACLE_HOME m à _m
m à čY ¢QÇ b em e f
[[J ¢Qņ [ m readme.txt ` _m ¢Q
+
#YY[
ƽ_Ç Y[à m $ORACLE_HOME/j2ee/home/applications f
à
ù m ¢Q YY m Y[à `à e[ *m Cà à
Y[à m YY[
à m C
Q
¢Q6 $ORACLE_HOME/j2ee/home/java -jar -XX:MaxPermSize=256M oc4j.jar
Ő C m e[ ~ó à J J `C ¢Q
[ ŬmY6½½___
[
½
m[Jà½
m½BC½
QB½½
QBf[m[ŭ
e [
Ő _[[ ` ö m Y_ e m m e à mC f
¢Q
\

Y[à
à
m
ö
à
YY[
ht-
tp://localhost:8888/<your-app-path>
a
Ő Y m C `à YJ CTRL-C m [ _m
m m C f
J
©C©
)gh
¢Q
1^1
jee5/booking
Ä
*m jee5/booking ZY[ ` m ž[ öJ ZY[ Æ_m
m #Ç
 e m `Z J ó[emņ ` ė à `[ e ¢Q [
m $SEAM_DIST/examples/jee5/booking à
1^1 Ė ]Ä }
bņ [ [ö m `
Y
e m `öJ ZY[ # _m m ö_f
[J _ [ö m Z Y
Ė m ¢Q ] _[[ m_ à m_ J m Y
m YY[
)a)+ņ ů
[J m B\½`öJ ZY[ Ű `[_
1^1 ş
jboss-seam.jar
ő ] [ m ^+ [ Æ_màć _[[ ` `[ _m J ̽ m Y[ ^+ e[
Ç
ş
jboss-el.jar
ş
jboss-seam-ui.jar
ş
jboss-seam-debug.jar
ş
jsf-facelets.jar
ş
richfaces-api.jar
ő ė b [ Y #Y
mė f`[
ņ richfaces-impl.jar richfaces-ui.jar ő _m
m Ė #Y
m f
fJ f`[
1^11 ]Ä ş
ž` ő e ņ _ ž` m ~# YC Æm m
*Y ö ^[ _m
m mY _m ¢QÇ
* ž` à ~# YC à m e[[_J B6
ş
hibernate.jar
ş
hibernate-annotations.jar
ş
hibernate-entitymanager.jar
ş
hibernate-validator.jar
ş
jboss-common-core.jar
ş
commons-logging.jar
©C©
)gk
¢Q
ş
ş
ş
commons-collections.jar
*m Yà B ő C B e m ZY[ ş
javaasist.jar
ş
dom4j.jar
ş
cglib.jar
ş
asm.jar
ş
commons-beanutils.jar
ş
commons-digester.jar
ş
log4j.jar
ő *m ` [e e à JJ eJ [JQB e Y
öJ ` eJ [JJJ _[[ ` m QB
^Z ¢Q B ő IJ YY[
C Æ
m # ó[emÇ à [à [ m Y
e m ` e à f
[[à ÆJ e à *Z à [ #ù* IÇ̽ `ņ ¢Qņ ŸJŸ [[J à [_à [ m6
ş
hibernate-search.jar
ş
hibernate-common-annotations.jar
ş
lucene-core.jar
ş
antlr.jar
ş
jbpm-jpdl.jar
ş
quartz.jar
ş
dbunit.jar
ş
jboss-embedded-api.jar
ş
€[ ő e à ] ė J à _m €[ņ `
mC [ €[ e a B6
ő e m` m
ő e m` m
ő e *Z
ő e ė ~|
ő e J [
ş
drools-core.jar
ş
drools-compiler.jar
ş
janino.jar
ş
mvel141.jar
ş
core.jar
©C©
ő e J [
)ho
¢Q
ş antlr-runtime.jar
€[ J m ZY[
1^11  
*m B e_ mJ ` 6
web.xml
Ő [ [[ à B`ė m web.xml *m [[à Ė e ` e ^^\ YY[
C f e ZY[ ¢Q ó[em
*m [à m ZY[ė _`Z[ e[ņ `[_ ZY[
<ejb-local-ref>
<ejb-ref-name>
jboss-seam-jee5/AuthenticatorAction/local
</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>
org.jboss.seam.example.booking.Authenticator
</local>
<ejb-link>AuthenticatorAction</ejb-link>
</ejb-local-ref>
persistence.xml
Ő YC m eJ e à ~# Y[ ] f
J ž` ¢Q `[J [ #ù* Iņ _ [C
Ėà e
àņ _ [ _ m ¢Q J6
b ZY[ eà m resources/META-INF/persistence.xml e[ ¢ m
ó[em YY f
m ¢Q YY
<property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.query.factory_class"
value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.OrionTransactionManagerLookup"/>
1^12
 jee5/booking
Ä
|eà m build.xml e[ m ZY[6
ş
Af
m [`[ ¢Qf[ [`à YY *m _[[ [ [[ m
Z Y
`C
m[ [ö [ö m e[[_J6
<!-- add libs for oc4j (eager classloading) -->
<property name="jbpm.lib" value="true"/>
<property name="drools.lib" value="true"/>
<property name="quartz.lib" value="true" />
©C©
)h
¢Q
<property name="search.lib" value="true" />
<property name="dbunit.lib" value="true" />
<property name="jboss-embedded-api.lib" value="true" />
)
[ m YY `à J ant m examples/jee5/booking à *m `[
J dist/jboss-seam-jee5.ear
+
¢Yà dist/jboss-seam-jee5.ear e[[_J m `[_
1^2 }ĉ {
S
*m f[ ` m Æe[à Ç Y Ė Y[à ^^ \
Y[
¢Q à mC [à _[ [[ e[[_J
)aņ ů[[ Y e ¢QŰ [ Y[àJ m jee5/booking ZY[ņ J m ` mĖ[` ` * Y[à
m YY[
à _[ [ m YY[
Yf
m
à
f
¢Yà hsqldb.jar ¢Q m [`à à6 cp ../../seam-gen/lib/hsqldb.jar
$ORACLE_HOME/j2ee/home/applib/ Æ¢Q ė _m ` ` _ f
žĒ €Ç
)
^ m ¢Q e[ $ORACLE_HOME/j2ee/home/config/data-sources.xml ņ f
<data-sources> ņ <managed-data-source
connection-pool-name="jee5-connection-pool"
jndi-name="jdbc/__default"
name="jee5-managed-data-source" />
<connection-pool name="jee5-connection-pool">
<connection-factory
factory-class="org.hsqldb.jdbcDriver"
user="sa"
password=""
url="jdbc:hsqldb:." />
</connection-pool>
*m jndi-name m jta-data-source persistence.xml +
^ $ORACLE_HOME/j2ee/home/config/server.xml ņ <application-server> ņ <application name="jboss-seam-jee5"
path="../../home/applications/jboss-seam-jee5.ear"
parent="default"
start="true" />
* öY mJ Y[ m à e YB
Q
^ $ORACLE_HOME/j2ee/home/config/default-web-site.xml ņ ņ <web-site> ņ <web-app application="jboss-seam-jee5"
name="jboss-seam-jee5"
load-on-startup="true"
root="/seam-jee5" />
©C©
)h)
¢Q
*m root m Z Ym à _[[ Y à _` `_ m YY[
f
\
¢Yà
m
YY[
¢Q6
cp
dist/jboss-seam-jee5.ear
$ORACLE_HOME/j2ee/home/applications/
a
½Y ¢Q e[[_J )aņ ů[[ Y
e ¢QŰ `C
g
¢m
ö m YY 6 http://localhost:8888/seam-jee5
1^S
{
S
}ĉ 
seam-gen
J [ e C[Y m Ė
ö[à J à Y J _m e[[ YY[
ž_C m YB
m eJ # *m m Z Y mC Z
¢QB *m e[[_f
J ZY[ à J m [ Y[ Z ņ ` e
à à eC €^ seam-gen YB
_m YY e ^
[Y ù`
seam-gen
] _[[ `à J Y[àJ Yà Y[ YY[
J seam-gen *m
_ė[[ m_ à m_ à seam-gen ž` *[ C J ` m e
[ ¢IA€ YY[
seam-gen _[[ ~# à
`ņ #YY[
b_ö Y b C_ e à ] _[[ [ à J €[
*m [ |àĒ Æ` e à [ à `ņ [J m Ē YYYÇ̽ [[ņ eJ |àĒ ņ m `
_m Y[ €ė eJ [ _[ m mysql-connector-java-X.jar e
B`
YY ]m J Y à m [ _[[ m `[
User _m [ username password _m [ à à m à Y à àY e Y[ `[ à _[ [ö
1^S
ò seam-gen
b _ [[ m seam-gen _m _ _ņ ./seam setup m `
à b[[_ m J ZY[ `[_ ` à à Y ÆZ à
` e oc4jexample Ç
> ./seam setup
Buildfile: build.xml
init:
setup:
[echo] Welcome to seam-gen :-)
[input] Enter your Java project workspace (the directory that contains your Seam projects) [C:/Pro
/home/jbalunas/workspace
[input] Enter your JBoss home directory [C:/Program Files/jboss-4.2.2.GA] [C:/Program Files/jboss/home/jbalunas/jboss/jboss-4.2.2.GA
©C©
)h+
¢Q
[input] Enter the project name [myproject] [myproject]
oc4j_example
[echo] Accepted project name as: oc4j_example
[input] Select a RichFaces skin (not applicable if using ICEFaces) [blueSky] ([blueSky], classic,
[input] Is this project deployed as an EAR (with EJB components) or a WAR (with no EJB support) [e
[input] Enter the Java package name for your
org.jboss.seam.tutorial.oc4j.action
[input] Enter the Java package name for your
org.jboss.seam.tutorial.oc4j.model
[input] Enter the Java package name for your
org.jboss.seam.tutorial.oc4j.test
[input] What kind of database are you using?
mysql
[input] Enter the Hibernate dialect for your
session beans [com.mydomain.oc4j_example] [com.mydoma
entity beans [org.jboss.seam.tutorial.oc4j.action] [o
test cases [org.jboss.seam.tutorial.oc4j.action.test]
[hsql]
([hsql], mysql, oracle, postgres, mssql, db2,
database [org.hibernate.dialect.MySQLDialect] [org.hi
[input] Enter the filesystem path to the JDBC driver jar [lib/hsqldb.jar] [lib/hsqldb.jar]
lib/mysql-connector.jar
[input] Enter JDBC driver class for your database [com.mysql.jdbc.Driver] [com.mysql.jdbc.Driver]
[input] Enter the JDBC URL for your database [jdbc:mysql:///test] [jdbc:mysql:///test]
jdbc:mysql:///oc4jexample
[input] Enter database username [sa] [sa]
username
[input] Enter database password [] []
password
[input] skipping input as property hibernate.default_schema.new has already been set.
[input] Enter the database catalog name (it is OK to leave this blank) [] []
[input] Are you working with tables that already exist in the database? [n]
(y, [n], )
y
[input] Do you want to drop and recreate the database tables and data in import.sql each time you
n
[input] Enter your ICEfaces home directory (leave blank to omit ICEfaces) [] []
[propertyfile] Creating new property file: /home/jbalunas/workspace/jboss-seam/seam-gen/build.properti
[echo] Installing JDBC driver jar to JBoss server
[copy] Copying 1 file to /home/jbalunas/jboss/jboss-4.2.2.GA/server/default/lib
[echo] Type 'seam create-project' to create the new project
BUILD SUCCESSFUL
*àY ./seam new-project à YB
cd /home/jbalunas/workspace/oc4j_example
m _[à YB
1^S1  ĉ {
S
] _ ö mJ m J YB
1^S1  
ė _m m eJ e[6
build.xml
ş
¢mJ m e[ J mC Æ_ ė JJ C Y[à
¢QÇ
<project name="oc4j_example" default="archive" basedir=".">
©C©
)hQ
¢Q
ş
¢Q [ö e m [ e[ /security.drl e[ m e m war e[ f
e m e m ear e[ _ mC m build.xml C m
[
`[ *m e[[_J ` m Y e m
<target name="war" depends="compile" description="Build the distribution .war file">
J
<copy todir="${war.dir}">
<fileset dir="${basedir}/resources" >
<include name="*.drl" />
</fileset>
</copy>
resources/META-INF/persistence-dev.xml
ş
#[ m jta-data-source ` jdbc/__oc4jexample Æ m m jndi-name
_m J m data-sources.xml [ J Y[àÇ
ş
# m YY Æ
` jee5/booking ZY[Ç6
<property name="hibernate.query.factory_class"
value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.OrionTransactionManagerLookup" />
<property name="hibernate.transaction.flush_before_completion"
value="true"/>
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
ş
IC m # Y
e
m e ZYJ m ^à|Jb
à6
<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/oc4j_exampleEntityManagerFactory">
ş
Őė[[ [ persistence-prod.xml _[[ e à _ Y[à ¢Q f
J m Y Ye[
resources/META-INF/jboss-app.xml
Ő [ m e[ _ ė Y[àJ # Æ jboss-app.xml `[ [[J [ #Ç
resources/*-ds.xml
Ő [ m e[ _ ė Y[àJ # Æm e[ e f
#ņ ¢Q à mC m data-sources.xml e[Ç
resources/WEB-INF/components.xml
ş
^`[
J
<transaction:ejb-transaction
/>
Yņ J
f
m
ė Y
[ xm-
lns:transaction="http://jboss.com/products/seam/transaction"
ş
#[ m jndi-pattern java:comp/env/oc4j_example/#{ejbName}/local
ş
] _ |J ~
¢Z YY[
Ae[à
©C©
)h\
¢Q
¢Q ė ZY m ^à|Jb
à ù€ņ ` YC `[f
J Y * C m e[[_J à6
<persistence:entity-manager-factory
auto-create="true"
name="oc4jEntityManagerFactory"
persistence-unit-name="oc4j_example" />
] m [[ ņ _ [ m managed-persistence-context f
B
J m ^à |J b
à m ZJ [6
<persistence:managed-persistence-context
name="entityManager"
auto-create="true"
entity-manager-factory="#{oc4jEntityManagerFactory}" />
resources/WEB-INF/web.xml
Ő m J J ^ à `[_ If
` e ¢QB à [ [[ à ^ m e à eà m YY[
em
<ejb-local-ref>
<ejb-ref-name>
oc4j_example/EjbSynchronizations/local
</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>
org.jboss.seam.transaction.LocalEjbSynchronizations
</local>
<ejb-link>EjbSynchronizations</ejb-link>
</ejb-local-ref>
resources/META-INF/orion-application.xml
ş
*m e[ m à m I
mb
#BZQe à[m _[[
_ö _m ¢Q *m e[ `
[[à [[ ¢Q e
_ m AI f
J
<?xml version = '1.0' encoding = 'utf-8'?>
<orion-application
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/
orion-application-10_0.xsd"
schema-major-version="10"
schema-minor-version="0"
component-classification="internal">
<imported-shared-libraries>
<remove-inherited name="oracle.xml"/>
</imported-shared-libraries>
</orion-application>
ş
ù_ à [[ m build.xml e[ m Yà m e[ m ear
mC b m <target name="ear" description="Build the EAR"> J eà
m <copy todir="${ear.dir}/META-INF"> [ö [ö m e[[_J6
<copy todir="${ear.dir}/META-INF">
<fileset dir="${basedir}/resources/META-INF">
©C©
)ha
¢Q
<include name="application.xml" />
<include name="orion-application.xml"/>
<include name="jboss-app.xml" />
</fileset>
</copy>
1^S11 ]Ä x *m YY[
m [ Ė m jee5/booking ZY[ `C
*m build.xml ` e m B [ `[_ m J mC
e[ ö e m <fileset dir="${basedir}"> `[_ m Y f
m m m [` `J Y
<target name="ear" description="Build the EAR">
<copy todir="${ear.dir}">
<fileset dir="${basedir}/resources">
<include name="*jpdl.xml" />
<include name="*hibernate.cfg.xml" />
<include name="jbpm.cfg.xml" />
<include name="*.drl" />
</fileset>
<fileset dir="${lib.dir}">
<include name="jboss-seam.jar" />
</fileset>
<fileset dir="${basedir}">
<include name="lib/jbpm*.jar" />
<include name="lib/jboss-el.jar" />
<include name="lib/drools-*.jar"/>
<include name="lib/janino*.jar"/>
<include name="lib/antlr-*.jar"/>
<include name="lib/mvel*.jar"/>
<include name="lib/richfaces-api*.jar" />
</fileset>
</copy>
<copy todir="${ear.dir}/META-INF">
<fileset dir="${basedir}/resources/META-INF">
<include name="application.xml" />
<include name="jboss-app.xml" />
</fileset>
</copy>
</target>
ş
ž`6
<include
<include
<include
<include
<include
<include
<include
<include
<include
ş
name="lib/hibernate.jar"/>
name="lib/hibernate-annotations.jar"/>
name="lib/hibernate-commons-annotations.jar"/>
name="lib/hibernate-entitymanager.jar"/>
name="lib/hibernate-search.jar"/>
name="lib/hibernate-validator.jar"/>
name="lib/commons-logging.jar"/>
name="lib/commons-collections.jar"/>
name="lib/jboss-common-core.jar"/>
€[ ő `
_ J €[ YC à [ņ _ ^
[Y €* Y[ Æà ė m #̽ J m ¢Qė
[[JÇ6
<include name="lib/core.jar"/>
©C©
)hg
¢Q
ş
*m Yà B ő e m [à `
e ¢Qė [[J6
<include
<include
<include
<include
<include
<include
<include
<include
<include
<include
<include
name="lib/javassist.jar"/>
name="lib/quartz.jar"/>
name="lib/dbunit.jar"/>
name="lib/jboss-embedded-api.jar"/>
name="lib/dom4j.jar"/>
name="lib/lucene-core.jar"/>
name="lib/cglib.jar"/>
name="lib/asm.jar"/>
name="lib/commons-beanutils.jar"/>
name="lib/commons-digester.jar"/>
name="lib/antlr.jar"/>
Ő m[ Y _m mJ [ö6
<fileset dir="${basedir}">
<include name="lib/jbpm*.jar" />
<include name="lib/jboss-el.jar" />
<include name="lib/drools-*.jar"/>
<include name="lib/janino*.jar"/>
<include name="lib/antlr-*.jar"/>
<include name="lib/mvel*.jar"/>
<include name="lib/richfaces-api*.jar" />
<include name="lib/hibernate.jar"/>
<include name="lib/hibernate-annotations.jar"/>
<include name="lib/hibernate-commons-annotations.jar"/>
<include name="lib/hibernate-entitymanager.jar"/>
<include name="lib/hibernate-search.jar"/>
<include name="lib/hibernate-validator.jar"/>
<include name="lib/commons-logging.jar"/>
<include name="lib/commons-collections.jar"/>
<include name="lib/jboss-common-core.jar"/>
<include name="lib/core.jar"/>
<include name="lib/javassist.jar"/>
<include name="lib/quartz.jar"/>
<include name="lib/dbunit.jar"/>
<include name="lib/jboss-embedded-api.jar"/>
<include name="lib/dom4j.jar"/>
<include name="lib/lucene-core.jar"/>
<include name="lib/cglib.jar"/>
<include name="lib/asm.jar"/>
<include name="lib/commons-beanutils.jar"/>
<include name="lib/commons-digester.jar"/>
<include name="lib/antlr.jar"/>
</fileset>
1^S2
 ĉ |Ĕ {
S
*m Cà [ m )a+ņ ů€Y[àJ m Yf
Y[
¢QŰ ` _m m e
e m oc4j_example YY[
ş
[ à YY[
`à [[J ant m ` à e à YB
ÆZ /
home/jbalunas/workspace/oc4j_example Ç *m J e m `[ _[[ ` dist/
oc4j_example.ear ş
¢Yà m mysql-connector.jar e[ m $ORACLE_HOME/j2ee/home/applib à m
B`
C C[`[
ş
$ORACLE_HOME/j2ee/home/config/data-sources.xml
<managed-data-source
©C©
)hh
¢Q
connection-pool-name="oc4j-example-connection-pool"
jndi-name="jdbc/__oc4jexample"
name="oc4j-example-managed-data-source" />
<connection-pool
name="oc4j-example-connection-pool">
<connection-factory
factory-class="com.mysql.jdbc.Driver"
user="username"
password="password"
url="jdbc:mysql:///oc4j" />
</connection-pool>
ş
$ORACLE_HOME/j2ee/home/config/server.xml
<application name="oc4j_example"
path="../../home/applications/oc4j_example.ear"
parent="default"
start="true" />
ş
$ORACLE_HOME/j2ee/home/config/default-web-site.xml
<web-app application="oc4j_example"
name="oc4j_example"
load-on-startup="true"
root="/oc4j_example" />
ş
½Y ¢Q e[[_J m Installation and operation of OC4J `C
ş
¢m
ö m YY 6 http://localhost:8888/oc4j_example
1^SS
]ĝ Ä ē Æ  j’} }
m _ Z m `
seam-gen YY[
e[[ `[_ ¢IA€ YY[
f
` ZJ ` ~[ _ _[[ Drools ` à _[[
1^SS
œÆ seam-gen  ĉ j’} *àY ./seam generate-entities m ` à e à ` *m _[[
m ņ m #YY[
b_ö [ m [C C_ e
m ¢IA€ YY[
*mė [[àmė [ Y[à `e e à[e
1^SS1
œĖ  ĉ ē j’} # `C m à ` m User `[ _m username password [ _m [ à e à ė mC m à à eà
m authenticate m `[_
[ö User à à `à öJ m
[ f
[ Æ¢Q ^+ e [[ŅÇ6
©C©
)hk
¢Q
ş
# m @Stateless m Authenticator [
ş
I m [ AuthenticatorAction
ş
¢ e
[[ Authenticator _m
m AuthenticatorAction Y[ Æ^+
Ė ` mC [
[ e
Ç # m e
_m
@Local ņ J[ m _m J m authenticate AuthenticatorAction @Name("authenticator") @Stateless public class
AuthenticatorAction implements Authenticator {
@Local public interface Authenticator {
public boolean authenticate();
}
)
A @PersistenceContext B
^à|J `à J m [ m AuthenticatorAction [6
@PersistenceContext private EntityManager entityManager;
+
Y[ m
6
public boolean authenticate() {
List <User> users = entityManager .createQuery("select u from User u where
u.username = #{identity.username} and
u.password = #{identity.password}") .getResultList();
if (users.size() == 1) {
identity.addRole("admin");
return true;
} else {
return false;
}
}
Q
# m m ^+ e
web.xml 6
<ejb-local-ref>
<ejb-ref-name>
oc4j_example/AuthenticatorAction/local
</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>
org.jboss.seam.tutorial.oc4j.action.Authenticator
</local>
<ejb-link>AuthenticatorAction</ejb-link>
</ejb-local-ref>
[ Y[à `e m _ [à [ Y_ f
Y
1^[ _ *mė ņ _ė mJm Ő _ mC J J Y e à ` YY[
f
Y[à ¢Q
©C©
)ko
1b ]+Ĕ \
]`[J
oå ^#ė ^^\ C eeJņ [à oo|~ m `[ [ņ
o+*~ m [ m YC_ [ YY[
` Y[à C[Y ]`[J
Cņ m mY _[[ m_ à m_ *m ö_
_m m ]`[J
C m _[[ ` _ö ņ eJ
mJ m b Y J ]`[J
_[ņ [[ J Æ [[ eÇ *m
_ė[[ [ö ` ė ^^\ ZY[ m m[ JJ Jņ _m
`[
ö Z #e m m ~# ZY[ _[[ ` e Y[à m C
*m e[[à _ _[[ seam-gen YY[
J Y J YC BY à YY[
1b \
b mJ e _ J m C [[ f m m
`
]`[J
oo|~ m `[ [ņ _m[ o+*~ m
[
YC_ C m eZ mJ `ö m
ş
ő
€_[
ŬmY6½½
`
½m_Y
BYće[à̾] άB̾oά̾ŭ
Weblogic
10.0.MP1
YJ
oo|~ m ö_ _m ^ m varargs m m Æ e
m transient Ç *m Z
Y _m ]`[J
Y Y[ m ^ varargs *m ` _ö m oo|~
e m [à m jpa ]#I ` seam-gen ZY[ _ö _m m C
m jee5/booking ZY[ e [
ş
10.3.TP
ő
€_[
YJ
ŬmY6½½
`
½m_Y
BYće[à̾] άB̾o+*
mά̾fά€ ̾___͘] ͘of+*
m~C_͘
ά]*
̾€ ͘___͘] ͘o+͘*
m~C_
ŭ
Weblogic
*m C [[ m eZ m varargs `Jņ m _ _m ^
m kodo Æ^#ė Y[ e ~#Ç m jee5/booking ZY[ e
[ ž_C e m varargs JJ J eZ _[[ [ö[à
` Y m C
b m [ `Cņ m e
m o+*~ J [ m J[ e
^+ YY ]`[J
ņ o+*~ _[[ ` e m ZY[ `[_
1b  i2y
ž m Ė
ö Y [[J ]`[J
o+*~ b [ e à mCJ à Y[ m
ö _m m ^# m *
m ~C_ €
¢
ŬmY6½½
`
½_[½Z½*
m~C_½ŭ ž _ [[ m Iž^ \ C J
m JYm
[ [[6
©C©
)k
^#ė ]`[J
b[[_ m [ö JC `C e o+*~ _[ m C e à f
C Ő _[[ J Y e _m ^# m
)
Ő à mJ m m server103tp_XX.bin e[ ` Z
`[6
chmod a+x server103tp_XX.bin
+
^Z
m [[6
./server103tp_XX.bin
Q
]m m JYm
[ [[ [ņ à m ^# m [
*m _m [[ ^# YY[
[[ *m [
_[[ ` ö_ $BEA_HOME m J6
/home/jbalunas/bea
\
[
Complete m [[ àY Ő [[ m Z e m f
Y[ [[ Æ
m `mC [`Çņ ` _[[ m
a
*m à [[ _m [[ m C Y6
$BEA_HOME/wlserver_10.3tp
1b1  ĉ \ # ]`[J
[ C eJ f [e C *m ]`[J
C à B [[ m ZY[ ņ ` _
JJ B e m ZY[ Ő m ZJ e
à _m Æeà m Ç
Y m ]`[J
eJ _č6
$BEA_HOME/wlserver_10.3tp/common/bin/config.sh
)
¢m _ ņ eJ YY Weblogic Server TP ù m
m m e[ Y
+
Y_ e m Q
ùZ m Development Mode m e[ €ʭ _m JC m Y
\
*m Z ö e à _ č à J [
No
a
b[[à m e m seam_examples [C m e[ [
f
1b2 œē ºº+ ĉ ù_ m m C [[ m à ö_ m_ ©C©
)k)
^#ė ]`[J
Y ņ Y[ m_ eJ [
ş
J m 6
*m m à Y f J m $BEA_HOME/user_projects/domains/seam_examples/bin f
à m ./startWeblogic.sh Y
ş
#
J m eJ [6
m http://127.0.0.1:7001/console à _` `_ _[[ ö e à Y_ m à `e ] _ė J m m _ņ ` m m
J Y e [ e m C eJ m [
ş
YYJ m 6
*m Y[ e Y m6
ş
ş
*m _à mJm m eJ [6
[
seam-examples m [e m e m [
)
¢m m Control ` m [ e m YJ
+
[
m m
ö `Z AdminServer m `[
Q
¢m Shutdown B `C m `[ņ [
m When work completes Force shutdown now YYY
\
*m e[[à e m à _ m m C _
žJ Ctrl-C m [ _m à m ù JC ee
mC ` ņ ` _ _[ J m _m[ m [ e eJ mJ m [
ş
# ]`[J
[[J
]m J m @DOMAIN/autodeploy à ` m mY à à
NoClassDefFound Z
Y e à m à J m ]`[J
C
e à [[ C m fY[à ^#I½]#I e[ņ m Cņ Y[à ] [ e Y
e
e mņ ` m ` mCf
J m _[[
1b1
jee5/booking
Ä
€ à _ J ^ė ]`[J
ć e m `[
ö m öY
e _öJ *m ` _m mJ m jee5/booking Zf
Y[ J [ Y[àJ Y`[ b _ė[[ [ö ` m `[
ö
_m mà ee
©C©
)k+
^#ė ]`[J
1b1 ] Ė ē \
b C[ [ e ]`[J
m m ` _m Y[J ^ė m C`[ J m m *m e m ]`[J
kå oå Cf
] m mY m m _[ ` [C m m YC_ [ņ ` C`[ J [ ^ė [ m eZ
_m ^ė _[[ _ö
*m J e m m m ]`[J
^ Y[ `[C m m m varargs transient m Y[à _[[ e[ _m Z
Y [ö `[_6
java.io.IOException: Compiler failed executable.exec:
/home/jbalunas/bea/wlserver_10.3tp/user_projects/domains/seam_examples/servers/AdminServer
/cache/EJBCompilerCache/5yo5dk9ti3yo/org/jboss/seam/async/
TimerServiceDispatcher_qzt5w2_LocalTimerServiceDispatcherImpl.java:194: modifier transient
not allowed here
public transient javax.ejb.Timer scheduleAsynchronousEvent(java.lang.String arg0,
java.lang.Object[] arg1)
^
/home/jbalunas/bea/wlserver_10.3tp/user_projects/domains/seam_examples/servers/AdminServer
/cache/EJBCompilerCache/5yo5dk9ti3yo/org/jboss/seam/async/
TimerServiceDispatcher_qzt5w2_LocalTimerServiceDispatcherImpl.java:275: modifier transient
not allowed here
public transient javax.ejb.Timer scheduleTimedEvent(java.lang.String arg0,
org.jboss.seam.async.TimerSchedule arg1, java.lang.Object[] arg2)
^# à m m `J _m C Y
e
m ņ YC _ö ņ _[[ eZ m ş
^# e ŬmY6½½e`
½mBYćm€̾+oooo)ogQŭ ő €
m JJ _J e _ [ e oå
ş
^# e ŬmY6½½e`
½mBYćJ€̾+ooooa)koŭ ő €
Y
e ^# YY m ^# àJ _m m Y
_m [ö m
`J
ş
`J Y ŬmY6½½`J
½`J`½C_͘`Jć`J̾͘a\ahk\ŭ ő €f
` [ e m ņ ` à m _[[ ` eZ
_m m ć # [ e _ ^ė _m C`[ J _[[ ]`[J
1b1 ĉ ē yÆē
# [ C [ Y m m YC_ C e ]`[J
Ő à ~# YC _m ^ė Z
Y e m e[ kodo openJPA Y[ #
à Y m ZY[ à _[[ m `e m varargs Y`[ Aef
[à J kodo openJPA m[Y _m m `[
ö ` `C ` Yf
ö_
m mC m _m m m YC_ _[ mY½ZY
m _[[
`
eZ
e
[
Æ
^#
b
ŬmY6½½e`
½mBYćm€̾+ooooQQo+ŭÇ *m e à m m Z
ö ņ m Y e ^#
©C©
)kQ
^#ė ]`[J
1b11 jee5/booking
Ä
m _[[ _[[ Ė
ö[à J C m Y J m jee5/booking ZY[
m Y m `[
ö m_ [e
1b11  è *m ZY[ m à màY
`ņ m ` Y *m [ _č [ö e YJ eJ ¢Yà
hsqldb.jar
_`[J
ė
m
[`à
à6
cp
../../seam-gen/lib/hsqldb.jar /home/jbalunas/bea/user_projects/domains/seam_examples/lib
)
Y m C CJ m [ e[[_J f
)g+ņ ůž_ ½Y½#
à Ű
+
 m [e CJ seam_examples - Services- JDBC - Data Sources
Q
Ő [
ö m eJ J m ` m YY [e `Z
\
*m [
` New ` m Y e m `[
a
b[[ m e[[_J6
ù6 seam-jee5-ds
`
ù€ ù6 seam-jee5-ds
€` *àY €C6 other
[
Next `
g
[
Next ` m Transaction Options YJ
h
b[[ m e[[_J m Connection Properties YJ6
k
€` ù6 hsqldb
`
ž ù6 127.0.0.1
~6 9001
A6 sa _[[ Yà Y_ e[
[
Next `
b[[ m e[[_J m Connection Properties YJ6
€C ¢[ ù6 org.hsqldb.jdbcDriver
`
AI 6 jdbc:hsqldb:.
©C©
)k\
^#ė ]`[J
A6 sa _[[ Yà Y_ e[
C m e m e[ Yà
[
Next `
o ¢m m J e m m [à AdminServer
¢[
ö Next
b[[à f YY[à m mJ `à [
J m Apply Changes ` m YY [e
1b111  
resources/META-INF/persistence.xml
ş
m m YC_ C _[[ [à _ö _m kodo openJPA m ~#
YC à mJ m YC 6
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
ş
ùZ à mJ m jta-data-source _m à `C 6
<jta-data-source>seam-jee5-ds</jta-data-source>
ş
*m m YY m e[ m` Y
e
`à openJPA
` ` [e 1b112 }ĉ +
*m mJ m `[ Y m _ Y Y[à m
YY
build.xml
]`[J
mY _m e[ b Y[ _ m b
[` m ]#I # m e[[_J m build.xml m _[[ m B ù m richfaces-api.jar [à e J m [ Y[à
b ]`[J
m WAR _m m YY[
<fileset id="war.lib.extras" dir="${seam.dir}">
<include name="lib/jsf-api.jar" />
<include name="lib/jsf-impl.jar" />
<include name="lib/richfaces-api.jar" />
</fileset>
ù_ _ `[ m YY[
`à J ant archive m ` e m ZY[ f
à
_ m ]`[J
C[Y _ Y[à m Yf
Y[
`à YJ m ^#I e[ m Y[à à
©C©
)ka
^#ė ]`[J
cp
./dist/jboss-seam-jee5.ear
/home/jbalunas/bea/user_projects/domains/seam_examples/autodeploy
ž _m _ m varargs m [ Y à _[[ ʭ _f
Jņ m Z
Y Y[ [ö m `[_
<Error> <EJB> <BEA-012036> <Compiling generated EJB classes produced
the following Java compiler error message:
/home/jbalunas/bea/user_projects/domains/seam_examples/servers/AdminServer/cache/
EJBCompilerCache/5yo5dk9ti3yo/org/jboss/seam/async/
TimerServiceDispatcher_qzt5w2_LocalTimerServiceDispatcherImpl.java:32:
modifier transient not allowed here
public transient void scheduleTransactionSuccessEvent(java.lang.String arg0,
java.lang.Object[] arg1)
^
/home/jbalunas/bea/user_projects/domains/seam_examples/servers/AdminServer/cache/
EJBCompilerCache/5yo5dk9ti3yo/org/jboss/seam/async/
TimerServiceDispatcher_qzt5w2_LocalTimerServiceDispatcherImpl.java:113:
modifier transient not allowed here
public transient javax.ejb.Timer scheduleAsynchronousEvent(java.lang.String arg0,
java.lang.Object[] arg1)
...
*m e _ J _m ]`[J
J ^ė _m [ m varargs [C
1b2
jpa
Ė Ä
*m m ž[ öJ ZY[ Y[ ~ ž` ~# Ė ^+ YY *m ZY[ [à m `ö e eJ `[ Y e à e m [J ]`[J
oå
b _ė[[ `[ m ZY[ e ]`[J
oZ m Y Y[à *m
_ė[[ [ö ` _m ee `_ m ]`[J
Cņ _m m #
C
1b2  ĉ
jpa
Ė Ä
Y Y m ņ Y _ `[ m YYņ Y m Y[à
1b2  *m ]`[J
oå C e m ZY[ m à mĖ[ ` e m
`[ ~ ` e à _m m ~ ` à Y ~ ņ B m m` J persistence.xml m
~ [
b e
m jpa/weblogic92 ZY[ ~
¢eJJ m Cà [ m B\ )g))ņ ůJ Y m
mĖ[ Ű b[[_ m Y m ņ ` m e[[_J _m
©C©
)kg
^#ė ]`[J
ş
€
ù6 seam-jpa-ds
ş
ù€ ù6 seam-jpa-ds
1b21  Ä
[J [à Ė J m 6
ant -f build-weblogic10.xml
*m _[[ Y
e
` ZY[ mC 1b22 }ĉ Ä
]m _ [[ ]`[J
e[[_J )g)ņ ů¢J à ]`[J
Ű _
m mC m C[Y *m Y[à m YY[
[[ _
Yà m Y[à à
cp
./dist-weblogic10/jboss-seam-jpa.war
/home/jbalunas/bea/user_projects/domains/seam_examples/autodeploy
¢m
ö m YY[
m e[[_J http://localhost:7001/jboss-seam-jpa/ 1b21 \Ĕ ē \ iÄ
ş
_ m m ]`[J
oZ k) ZY[ m C[ ee
6
ş
META-INF/persistence.xml
ő *m k) C eJ m PointBase f
` Yf[[ *m oZ C m hsql ` ş
WEB-INF/weblogic.xml
ő *m e[ [C _m [ Cf
e m ANTLR [` m ]`[J
oZ [[à ¢Q mC m _[[
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app
xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
*m e[ ö ]`[J
[ [` m _` YY[
`e
m [` m [Ym ]m m mJ m` Ė [ņ [_ Ėà e
à `à J m e[[_J YYà m METAINF/persistence.xml e[
<property name="hibernate.query.factory_class"
value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
©C©
)kh
^#ė ]`[J
ş
WEB-INF/components.xml
ő m ]`[J
oZ C ~# à f
`[ `à J6
<transaction:entity-transaction entity-manager="#{em}"/>
ş
_ m ]`[J
oZ C m C m mJ ž
m _6
ş
META-INF/persistence.xml
ő ^Z
Y e m ]` J
C 6
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
ş
WEB-INF/jboss-web.xml
ş
WEB-INF/lib
ő *m C m e weblogic.xml
ő *m ]`[J
C Ė C[ [`à Y
öJ `
mà
[ mà _m # *m Y[à e m`ņ bf
I YY m Y
ş
ş
ş
* ž` à ~# YC à m e[[_J B6
ş
hibernate.jar
ş
hibernate-annotations.jar
ş
hibernate-entitymanager.jar
ş
hibernate-validator.jar
ş
jboss-common-core.jar
ş
commons-logging.jar
ş
commons-collections.jar
ş
jboss-archive-browsing.jar
Ė b ) m B e m ]`[J
o+*~ mY b [` [[ `à e[
ş
jsf-api.jar
ş
jsf-impl.jar
 m Yà B m ]`[J
6
ş
antlr.jar
ş
cglib.jar
©C©
)kk
^#ė ]`[J
ş
asm.jar
ş
dom4j.jar
ş
el-ri.jar
ş
javassist.jar
1bS }ĉ 
\ iÄ
seam-gen
Cà e[ [ e C[Y Ė
ö[à J YY[
Y f
Jņ YC e à _ e
[à  e `Z seam-gen _[[
Y
YY[
eJ # *m _[[ m_ m
Y J ]`[J
seam-gen
_ `[ e Y[
à ņ à Jņ Y[àJ YY[
Jf
`à seam-gen ]`[J
oZ m [[à e YJ CJ eJ e[ņ J Y B m ]`[J
oZ mY _m
seam-gen
] [[ [C _m m Y `à ]`[J
ņ `
e
m m ZY[ _[[ J WAR ` YY[
e EAR f
)g)ņ ů^ [
ö _m ]`[J
Ű e [
*m ZY[ _[[ C m `
seam-gen WAR Y[à *m _[[ ~
Yņ ž` ~#ņ b
[ņ €[ àņ I
mb
ņ eJ`[ €f
1bS j
seam-gen
*m e mJ _ [[ seam-gen ` m YB
_ _ ö *m `à J ./seam setup m ` à e m ` ù m
Ym m à _ņ e[ e mJ e à C
./seam setup
Buildfile: build.xml
init:
setup:
[echo] Welcome to seam-gen :-)
[input] Enter your Java project workspace (the directory that contains your Seam projects) [C:/Pro
/home/jbalunas/workspace
[input] Enter your JBoss home directory [C:/Program Files/jboss-4.2.2.GA] [C:/Program Files/jboss/home/jbalunas/jboss/jboss-4.2.2.GA
[input] Enter the project name [myproject] [myproject]
weblogic-example
[echo] Accepted project name as: weblogic_example
[input] Select a RichFaces skin (not applicable if using ICEFaces) [blueSky] ([blueSky], classic,
©C©
+oo
^#ė ]`[J
[input] Is this project deployed as an EAR (with EJB components) or a WAR (with no EJB support) [e
war
[input] Enter the Java package name for your
org.jboss.seam.tutorial.weblogic.action
[input] Enter the Java package name for your
org.jboss.seam.tutorial.weblogic.model
[input] Enter the Java package name for your
org.jboss.seam.tutorial.weblogic.test
[input] What kind of database are you using?
session beans [com.mydomain.weblogic_example] [com.my
entity beans [org.jboss.seam.tutorial.weblogic.action
test cases [org.jboss.seam.tutorial.weblogic.action.t
[hsql]
([hsql], mysql, oracle, postgres, mssql, db2,
[input] Enter the Hibernate dialect for your database [org.hibernate.dialect.HSQLDialect] [org.hib
[input] Enter the filesystem path to the JDBC driver jar [lib/hsqldb.jar] [lib/hsqldb.jar]
[input] Enter JDBC driver class for your database [org.hsqldb.jdbcDriver] [org.hsqldb.jdbcDriver]
[input] Enter the JDBC URL for your database [jdbc:hsqldb:.] [jdbc:hsqldb:.]
[input] Enter database username [sa] [sa]
[input] Enter database password [] []
[input] Enter the database schema name (it is OK to leave this blank) [] []
[input] Enter the database catalog name (it is OK to leave this blank) [] []
[input] Are you working with tables that already exist in the database? [n]
(y, [n], )
[input] Do you want to drop and recreate the database tables and data in import.sql each time you
[input] Enter your ICEfaces home directory (leave blank to omit ICEfaces) [] []
[propertyfile] Creating new property file: /rhdev/projects/jboss-seam/cvs-head/jboss-seam/seam-gen/bui
[echo] Installing JDBC driver jar to JBoss server
[copy] Copying 1 file to /home/jbalunas/jboss/jboss-4.2.2.GA/server/default/lib
[echo] Type 'seam create-project' to create the new project
BUILD SUCCESSFUL
*àY
./seam
new-project
home/jbalunas/workspace/weblogic_example
à
YB
m _[à YB
cd
/
1bS1 \  \ iã
b _ mJ [ eJ e[ņ m _ Y m [` m
Y[à _m m YY[
1bS1  
build.xml
ş
¢mJ m e[ J archive
<project name="weblogic_example" default="archive" basedir=".">
resources/META-INF/persistence-dev.xml
ş
#[ m jta-data-source ` seam-gen-ds Æ m m jndi-name _m f
©C©
+o
^#ė ]`[J
J m ]`[J
ė [Ç
ş
¢mJ m àY RESOURCE_LOCAL m _ ~# <persistence-unit name="weblogic_example" transaction-type="RESOURCE_LOCAL">
ş
#½eà m YY `[_ e ]`[J
YY6
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
ş
IC m # Y
e
m e ZYJ m ^à|Jb
à6
<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/weblogic_exampleEntityManagerFactory">
ş
Őė[[ [ persistence-prod.xml _[[ e à _ Y[à ]`[J
J m Y Ye[
resource/WEB-INF/weblogic.xml
Ő _[[ m e[ YY[ e[[_J Y e ]^f
ùb½_`[J
Z[ Ŭ)khŭ
resource/WEB-INF/components.xml
] _ ~# _ m e[[_J [ ö_
<transaction:entity-transaction entity-manager="#{entityManager}"/>
Ő _[[ [ m Y
m [
m Y e
m xmlns:transaction="http://jboss.com/products/seam/transaction"
http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
resources/WEB-INF/jboss-app.xml
Ő [ m e[ _ ė Y[àJ # Æ jboss-app.xml `[ [[J [ #Ç
resources/*-ds.xml
Ő [ m e[ _ ė Y[àJ # *m e[ e
#ņ ]`[J
_ _[[ m [
1bS11 Ÿĉ 
*m seam-gen YY[
m Cà [ [`à Y
m jpa ZY[ `C
)g+)ņ ů]mė ee _m ]`[J
oZŰ [_ m mJ m
J m m YY[
ş
|J B ő *m _ [` m seam-gen YC `à e[
©C©
+o)
^#ė ]`[J
*m ` Y à YB
lib à [[à
ş
ş
B`f
mCf`_JB ő ` e m @SEAM_DIST/examples/jpa/lib f
à
ş
[fB ő [ e m @SEAM_DIST/examples/jpa/lib à
`[Z[ ő ù_ _ B m build.xml b m J war m e[f
[_J m e m J
<copy todir="${war.dir}/WEB-INF/lib">
<fileset dir="${lib.dir}">
<!--JSF implementation -->
<include name="jsf-api.jar" />
<include name="jsf-impl.jar" />
<!-- Misc 3rd party -->
<include name="commons-logging.jar" />
<include name="dom4j.jar" />
<include name="javassist.jar" />
<include name="cglib.jar" />
<include name="antlr.jar" />
<!-- Hibernate -->
<include name="hibernate.jar" />
<include name="hibernate-commons-annotations.jar" />
<include name="hibernate-annotations.jar" />
<include name="hibernate-entitymanager.jar" />
<include name="hibernate-validator.jar" />
<include name="jboss-archive-browsing.jar" />
<!-- Needed for Drools -->
<include name="core.jar"/>
</fileset>
</copy>
1bS12 seam-gen Æ *m [à _m m `mC e m seam-gen WAR YY[
_m `[
J m C[Y Ye[ Æm e[Ç Y[à ]`[J
*m àY m
m [J YJ e m YY[
_[[ [_à m_ login failed J
]m m YY[
`[ J m C[Y Ye[ m action [ e[ Y[
m WEB-INF/dev à ù[[à m [ e[ m Y[à`[ J `à *m mYY ]`[J
Æ B ^#|f)Q\\
ŬmY6½½BB`
½B½`_½^#|f)Q\\ŭ e [ Ç
* _ö m à eà m build-dev.properties e[ Y[à C m
YYà action.dir=WEB-INF/dev
1bS2  }ĉ ĉ b[[à [[ mė [e Y[àJ m YY[
*m C[C J Y ņ `[J m YYņ Y[àJ 1bS2  ©C©
+o+
^#ė ]`[J
¢eJJ m Cà [ m B\ )g))ņ ůJ Y m
mĖ[ Ű ^Z
Y e _m [ m e[[_ m e m [ö
ş
€
ù6 seam-gen-ds
ş
ù€ ù6 seam-gen-ds
1bS21  *m à àYJ ant m YB
` à
1bS22 }ĉ Ä
]m _ [[ ]`[J
e[[_J )g)ņ ů¢J à ]`[J
Ű _
m mC m C[Y *m Y[à m YY[
[[ _
Yà m Y[à à
cp
./dist/weblogic_example.war /home/jbalunas/bea/user_projects/domains/seam_examples/autodeploy
¢m
ö m YY[
m e[[_J http://localhost:7001/weblogic_example/ ©C©
+oQ
1c zĔ \
]`Ym aZ |ė YY[
C eeJ *m [ [ ao+
_m
m mC EJB3 JEE5 YY *m [à [ ÆùC ogÇ EJB3 ef
Y
ö _m
m YC YY e EJB3 JPA ¢[à m JEE5
eeJ e | *m _m J _m YY[
m
^+
b _ _[[ J C `
e ` m ]`Ym C m _ e m ZY[ #e J [ e m _ö _ _ `[ J ^+ Yf
Y[
e
[à ] _[[ J C m [ e m Y _m m
B\ ZY[ ] _[[ [ Y[à m m ~# ZY[ YY[
1c \ Æ ĉ ]`Ym [ Y
_ _[[ m [ e [[f
m m à e[[_ m YC `à à Y
[ [[
àY [
*m _[[ [ m Z
C C ņ [[
Yņ YY m e [[ e m ZY[
1c Æ #[[ e m ZY[ e m mY ` m m [ C
e ]`Ym m e m _J
ş
]`Ym
#YY[
C
ŬmY6½½___`
½C[Y_ö½_`Ym½č½_½ŭ
ao+
ş
b ~
ö e ^ +o e ]`Ym #YY[
C a Æ+oao+Ç
ŬmY6½½___f`
½YY½
C__ć̾hoά̾_J))hg\gkŭ
*m ^+ e Y
ö m _ [[ _m m ao+ Y
m C e ]`f
Ym [[J m e Y
ö m à C _[[ mC m YY
C e ^+ YY[
m Y e m [[ e m ef
Y
ö à e[[_ m _ C Ye[ _m m ^+ ef
Y
ö `[ņ J e à ZJ *m [ ` e m
[[ `à J m Ye[ J [
# ` J m C
*m m J m C _[[ ` Ė e Y[àJ mJ m ZY[ m mY [ö Cà mJ Ė
e à J Z
Y e eJ YYà Y[àJ
YY[
à m C
1c1 jè ©C©
+o\
|ė ]`Ym
*m Y[ e ]`Ym YY m Ė e J
*m YY Y
e
[[à e ņ ` _ö _m
]`Ym *m e[[_J m m 6 J _` YY ŬmY6½½___f`
½YY½
C__ć̾hoά̾_J))hQ+k\ŭ
ş
ő *m [C e[à _m ]`Ym
_m YY[
J [J Ÿ½Ÿ _m YJ e
m m java.net.MalformedURLException _[[ ` m_ ]m m YYf
à à _[[ [[ _Jņ ` m _[[ ` C ZY
prependSlashToResource = "true"
€[ ` e 6
I^o)+h^6
I
Ym
mC
ŬmY6½½___f`
½YY½
C__ć̾_J)ko)+Qŭ
ş
[J
[m
ő *m [C _m
]`Ym _m m_ FileNotFoundException _m _` YY[
Y e[ m [[à Z ö *m Y
_` YY[
_m e[ C[ Y
f
Ė [ö m *m e [e e[ C C
Yņ
¢ņ Jņ _m ĖJ _` YJ
com.ibm.ws.webcontainer.invokefilterscompatibility = "true"
€[ ` e 6
~ʭ++oko̽ a6 # e[ m C e[ YYfY [ J
ŬmY6½½___f`
½YY½
C__ć̾_J)QoQg\hŭ
1c1
jee5/booking
Ä
*m jee5/booking ZY[ ` m ž[ öJ ZY[ Æ_m
m #Ç
 e m `Z J ó[emņ ` _m m Y `[_ ` f
Y[à ]`Ym [
m $SEAM_DIST/examples/jee5/booking à
# `e m EJB3 e Y
ö YC e[[ jee5 Y[ *m
m m ö JJ YY[
Y[à e
J
1c1  
[_ m eJ e[ mJ m m ` ZY[
resources/WEB-INF/components.xml
] mJ m _à m _ [ö Y ^ e ]`Ym ] C m /
local e m e m jndi-pattern ` m[ [ö [ö m6
<core:init jndi-pattern="java:comp/env/jboss-seam-jee5/#{ejbName}" debug="true"/>
©C©
+oa
|ė ]`Ym
resources/WEB-INF/web.xml
*m m e Y[
m _ ZY
mJ `
m e[[
jee5 Y[
]`Ym YY Servlet 2.5ņ Ė Servlet 2.4 b m mJ _
B m Y e m web.xml e[ [ö [ö m e[[_J6
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
ùZ _ mC ö mJ m ^ e
m web.xml *m mJ
_m _[[ [[_ ]`Ym ` m ^) e
m _` [ m m
[ ^+ ` m ^#I [ IY[
[[ e m ejb-local-refs _m m C[
`[_
<!-- JEE5 EJB3 names -->
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/AuthenticatorAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.example.booking.Authenticator</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/BookingListAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.example.booking.BookingList</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/RegisterAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.example.booking.Register</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/ChangePasswordAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.example.booking.ChangePassword</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/HotelBookingAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.example.booking.HotelBooking</local>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>jboss-seam-jee5/HotelSearchingAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.example.booking.HotelSAll of the examples and informaearching</local>
</ejb-local-ref>
<ejb-local-ref>
©C©
+og
|ė ]`Ym
<ejb-ref-name>jboss-seam-jee5/EjbSynchronizations</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
</ejb-local-ref>
*m Y mJ m m Yà local-home [ e m ^ *m
[[ ]`Ym ö m `J `_ m _` [ m ^+
` *m ejb-link [ Y[à resources/META-INF/persistence.xml
b m ZY[ _ _[[ ` J m e[ m _m ]`Ym *
m mJ m jta-data-source [6
<jta-data-source>DefaultDatasource</jta-data-source>
*m _ B e m m` YY b m
ó[em YY ùZ à ½
mJ m YY6
<!--<property name="hibernate.transaction.flush_before_completion" value="true"/>-->
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.dialect" value="GlassfishDerbyDialect"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
ş
hibernate.transaction.manager_lookup_class
ő ž` J
YYà e ]`Ym aå
ş
ő *m `
_ _
m J m #[ e m true Z
Y
_[[ ` m_ `à ]`Ym _m m ^¢Z [ö Y
hibernate.transaction.flush_before_completion
com.ibm.wsspi.injectionengine.InjectionException:
EJBContext may only be looked up by or injected into an EJB
ş
ő b ]# aok m ` € _ _
m m €`à € ó[em
hibernate.dialect
resources/GlassfishDerbyDialect.class
Ő _[[ J m GlassfishDerbyDialect.class Yà m /resources
à *m [ Z m ~# ZY[ ` Y J m `f
[_ J à jee5/booking à6
cp ../../jpa/resources-websphere61/WEB-INF/classes/GlassfishDerbyDialect.class
./resources
*m [ _[[ ` Y m jboss-seam-jee5.jar e[ J mJ m `[Z[
[
©C©
+oh
|ė ]`Ym
resources/import.sql
*m e[ [ ` Y e m ~# ZY[ `
m m €`à € m
[
YY mJ m ID [ *m e[ [ Z
Y e
m [ ee
A m e[[_J ö m Yà
cp ../../jpa/resources-websphere61/import.sql ./resources
1c11  jee5/booking
Ä
J m mJ _ mC YY[
_ ö mJ m build.xml *m [ [ B m Ė `à Yf
Y[
_ö _m ]`Ym *m _[[ C _m mJ m build.xml
1c11 õē ş
ş
b [` ő ]`Ym a _m m _ C e b Æ Ė
b )Ç _ m B YY[
ş
jsf-api.jar
ş
jsf-impl.jar
]`Ym e[[à Y[ JEE5 Y[ _ m ^ [`6
ş
el-api.jar
ş
el-ri.jar
ş
jboss-seam.jar
ő e _m Y[àJ m YY[
mJm m ]`Ym
[ e m jboss-seam.jar m ` e m ^#I
mC *m m _ m /lib e m ^#I
ş
b[[à _ C m log4j.jar m [[ e m [J Y e YY[
_[[
` m ]`Ym [J #[ Y Ė e[[à eJ [JQB
m e m Y e m 1c111 ’ build.xml # m e[[_J à m ` e m build.xml e[ *m C m e[
e[ m YY[ m jboss-seam-jee5.jar *m Yà mJ m f
e m GlassfishDerbyDialect.class6
<fileset id="jar.resources" dir="${resources.dir}">
<include name="import.sql" />
<include name="seam.properties" />
<include name="GlassfishDerbyDialect.class" />
©C©
+ok
|ė ]`Ym
<include name="META-INF/persistence.xml" />
<include name="META-INF/ejb-jar.xml" />
</fileset>
ùZ _ m [`à Y
`C b m m e[[_J
` e m ear.lib.extras e[ à6
<!--<include name="lib/log4j.jar" />-->
<include name="lib/el-api.jar" />
<include name="examples/jpa/lib/el-ri.jar" />
<include name="lib/jsf-api.jar" />
<include name="lib/jsf-impl.jar" />
<include name="lib/jboss-seam.jar" />
</fileset>
ù_ [[ m [e Z
m ant archive ö m `[ YY[
_[[ `
m jee5/booking/dist à
1c12 }ĉ \
_ _ mC CàmJ _ Y[
#[[ m [e Y[à f B e_
Y b m _ _[[ ]`Ymė [ # `e m ö
Y m ` e[[_
*m Y `[_ e m ]`Ym C `Cņ à à ` [Jm[à eef
J m [
https://localhost:9043/ibm/console
)
#
m Enterprise Application Y m Applications Y +
# m Y e m Enterprise Application `[ [
Install [_ [[
_č YJ _m m6
ş
ş
Preparing for the application installation
ş
_ m examples/jee5/booking/dist/jboss-seam-jee5.ear e[ J m e[
Y[ _J
ş
[
m Next `
Select installation options
ş
[
m Deploy enterprise beans m
ö `Z *m [ à ]`Ym [ Y
öJ m YY[
©C©
+o
|ė ]`Ym
ş
ş
Map modules to servers
ş
ş
[
m Next `
ù mJ m _ [à mC C [
m Next `
Map EJB references to beans
*m YJ _[[ [ [[ e m ` m _ m _`Z[
ş
ş
|ö m Allow EJB reference targets to resolve automatically m
ö `Z [
*m _[[ [[ ]`Ym ` ^+ ` m ^ e
m _` [
ş
[
m Next `
Map virtual hosts for Web modules
ş
ş
Summary
ş
ş
Q
ù mJ m [
m Next `
ù mJ m [
m Finish `
Installation
ş
ù_ à _[[ [[J Y[àJ à YY[
ş
]m e em [
m Save [ö à _[[ ` m Enterprise
Applications `[
ù_ m _ mC YY[
[[ _ ö B `f
e _ 6
ş
J e m Enterprise Applications `[ [
m Seam Booking [ö
ş
[
m Manage Modules [ö
ş
[
m jboss-seam-jee5.war [ö
ş
¢mJ m Class loader order ` `Z Classes loaded with application class
loader first
ş
[
Apply m Save Y
ş
I m Seam Booking YJ
ş
 m YJ [
m Class loading and update detection [ö
ş
[
m ` e Classes loaded with application class loader first
©C©
+
|ė ]`Ym
ş
^C mJm _ `[J [ [ à [ C[ ` m Polling interval for updated files Z Æč _ö eÇ
ş
[
Apply m Save Y
ş
Ő m[ Ceà m m mJ à B m ` ` ] mC m
Y`[ _m m [ [ [ mJ öJ ee
f C e f
e m mJ ö à _[[ [[àņ e[[_J m
6
ş
Y m e[[_J e[ Z e à m
6
$WebSphereInstall/$yourServerName/profiles/$yourProfileName/config/cells/
$yourCellName/applications/Seam Booking.ear/deployments/
Seam Booking/deployment.xml
ş
|eà m e[[_J [ m PARENT_FIRST _ PARENT_LAST6
<classloader xmi:id="Classloader_#######" mode="PARENT_FIRST"/>
ş
C m e[ _ _m J m Class loading and update detection YJ à
m[ Classes loaded with application class loader first [
\
* m YY[
m Enterprise Applications `[ [
YY[
m [ *m m m Start ` m Y e m `[
a
Ő _ m YY[
http://localhost:9080/seam-jee5/ # ` ]`Ym e[ ` *m e[ Y e ]`Ym a e[ ^ o *m
m à à ^ Z
Y e [ Yf
`[ B m e m e[ ^ C[ `ņ ` m
`à m Y e m m ]`Ym e [
1c2
jpa
Ė Ä
*möe[[à JJ m jpa ZY[ _ö m m m jee5 ZY[ *m m ž[ öJ ZY[ Y[ ~ J ž` ~# _m ~#
Ė ^+ YY *m ZY[ [à m `ö e eJ `[ Y e à e m
[J ]`Ym
b mJ _ JJ `[ Y[à m ZY[ *m _ė[[ J C öà mJ m _ ©C©
+)
|ė ]`Ym
1c2  Ä
jpa
[J [à Ė J m 6
ant websphere61
*m _[[ Y
e
` ZY[ mC _m
m websphere61 [`[
1c21 }ĉ jpa
Ä
*m [ m jee5 ZY[ )h)+ņ ů€Y[àJ m YY[
]`YmŰņ ` _m à Y
ş
b m Enterprise Applications `[ [
m Install `
ş
Preparing for the application installation
ş
_ m examples/jpa/dist-websphere61/jboss-seam-jpa.war e[ J m e[
Y[ _J
ş
m Context root Z `Z jboss-seam-jpa
ş
[
m Next `
ş
[
m Next ` e m Z m YJņ mJ ş
Summary
ş
YJ
IC_ m J e à _m [
m Finish ` [[ m Yf
Y[
]m [[ em [
m Save [ö à _[[ ` f
m Enterprise Applications `[
ş
# _m m jee5 ZY[ m [ [ mJ `e _ m YY[
b[[_ m [[ B e B\ ZY[
` Z
mJ jboss-seam-jpa e Seam Booking
ş
b[[à m YY[
`à [
J m Enterprise Applications `[ [
öJ m Start `
ş
Ő
_
m
YY[
m
ht-
tp://localhost:9080/jboss-seam-jpa/index.html
1c22 \ \ ^
*m ee
`_ m ~# ZY[ m Y[à Q) ]`Ym a [à ZY
̽ [`à eJ e[ mJ
ş
¢eJ e[ mJ
©C©
++
|ė ]`Ym
ş
ő m [à Je
mJ m ]`Ym a [à YY
m Y e m e[ _ mJ
WEB-INF/web.xml
Servlet 2.4
ş
META-INF/persistence.xml
ő m mJ m e m ù€ Ymņ
_
mJ m ]`Ym a J [ö Y [ņ mJJ m
m` [
` GlassfishDerbyDialect ş
WEB-INF/classes/GlassfishDerbyDialect.class
ő m [ e m m`
[
mJ GlassfishDerbyDialect
ş
ş
ő m e m [
€`à € m ID [ ` YY[
`à m e[ _ C
import.sql
¢mJ e Y [`
ő *m ]`Ym C Ė C[ [`à Y
öJ `
mà [ mà _m # *m Y[à e m`ņ bfI Yf
Y m Y
[_ [ [à m [ B `C
`à m JPA ZY[
WEB-INF/lib
ş
ş
ş
* ž` à ~# YC à m e[[_J B6
ş
hibernate.jar
ş
hibernate-annotations.jar
ş
hibernate-commons-annotations.jar
ş
hibernate-entitymanager.jar
ş
hibernate-validator.jar
ş
commons-collections.jar
ş
jboss-archive-browsing.jar
Ė b ) m m B e m ]`Ym a mY
_m _ Y[ e b ş
jsf-api.jar
ş
jsf-impl.jar
ş
el-ri.jar
ş
el-api.jar
 m Yà B m ]`Ym 6
ş
antlr.jar
©C©
+Q
|ė ]`Ym
ş
cglib.jar
ş
asm.jar
ş
dom4j.jar
ş
javassist.jar
1cS }ĉ 
\ ^i2
seam-gen
Cà e[ [ e C[Y Ė
ö[à J YY[
Y f
Jņ YC e à _ e
[à  e `Z seam-gen _[[
Y
YY[
eJ # *m _[[ m_ m
Y J ]`Ym # `C )h)ņ ů *m
B\½`öJ ZY[ Ű m öà mJ J ^+ YY[
J *m _[[ ö à mJm m Z
Y
seam-gen
*m e Y J Y seam-gen m ` YB
*m C[
m
`[_ņ Y
e
[[à m m` C[ m _ _[[ B
m YB
./seam setup
Buildfile: build.xml
init:
setup:
[echo] Welcome to seam-gen :-)
[input] Enter your Java project workspace (the directory that contains your Seam projects) [C:/Pro
/home/jbalunas/workspace
[input] Enter your JBoss home directory [C:/Program Files/jboss-4.2.2.GA] [C:/Program Files/jboss/home/jbalunas/jboss/jboss-4.2.2.GA
[input] Enter the project name [myproject] [myproject]
websphere_example
[echo] Accepted project name as: websphere_example
[input] Do you want to use ICEFaces instead of RichFaces [n] (y, [n], )
[input] skipping input as property icefaces.home.new has already been set.
[input] Select a RichFaces skin [blueSky] ([blueSky], classic, ruby, wine, deepMarine, emeraldTown
[input] Is this project deployed as an EAR (with EJB components) or a WAR (with no EJB support) [e
[input] Enter the Java package name for your
org.jboss.seam.tutorial.websphere.action
[input] Enter the Java package name for your
org.jboss.seam.tutorial.websphere.model
[input] Enter the Java package name for your
org.jboss.seam.tutorial.websphere.test
[input] What kind of database are you using?
session beans [com.mydomain.websphere_example] [com.m
entity beans [org.jboss.seam.tutorial.websphere.actio
test cases [org.jboss.seam.tutorial.websphere.action.
[hsql]
([hsql], mysql, oracle, postgres, mssql, db2,
[input] Enter the Hibernate dialect for your database [org.hibernate.dialect.HSQLDialect] [org.hib
[input] Enter the filesystem path to the JDBC driver jar [lib/hsqldb.jar] [lib/hsqldb.jar]
[input] Enter JDBC driver class for your database [org.hsqldb.jdbcDriver] [org.hsqldb.jdbcDriver]
©C©
+\
|ė ]`Ym
[input] Enter the JDBC URL for your database [jdbc:hsqldb:.] [jdbc:hsqldb:.]
[input] Enter database username [sa] [sa]
[input] Enter database password [] []
[input] Enter the database schema name (it is OK to leave this blank) [] []
[input] Enter the database catalog name (it is OK to leave this blank) [] []
[input] Are you working with tables that already exist in the database? [n]
(y, [n], )
[input] Do you want to drop and recreate the database tables and data in import.sql each time you
[propertyfile] Creating new property file: /rhdev/projects/jboss-seam/svn-seam_2_0/jboss-seam-2_0/seam
[echo] Installing JDBC driver jar to JBoss server
[copy] Copying 1 file to /home/jbalunas/jboss/jboss-4.2.2.GA/server/default/lib
[echo] Type 'seam create-project' to create the new project
BUILD SUCCESSFUL
Total time: 3 minutes 5 seconds
*àY
à
YB
home/jbalunas/workspace/websphere_example m _[à ./seam
new-project
cd
/
1c[  ĉ \
] _ ö mJ m J YB
1c[  
resources/META-INF/persistence-dev.xml
ş
#[ m jta-data-source ` DefaultDatasource ] JJ ` J m f
J ]`Ym €
ş
# mJ m YY `[_ *m ` [ )h)ņ
ů *m B\½`öJ ZY[ Ű6
<property
<property
<property
<property
<property
name="hibernate.dialect" value="GlassfishDerbyDialect"/>
name="hibernate.hbm2ddl.auto" value="update"/>
name="hibernate.show_sql" value="true"/>
name="hibernate.format_sql" value="true"/>
name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
ş
IC m # Y
e
m e ZYJ m ^à|Jb
à6
<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/websphere_exampleEntityManagerFactory">
ş
Őė[[ [ persistence-prod.xml _[[ e à _ Y[à ]`Ym
J m Y Ye[
©C©
+a
|ė ]`Ym
resources/GlassfishDerbyDialect.class
# _m m ZY[ _ [ m [ e € YY ` Y
e m jpa ZY[ m websphere_example/resources à
cp $SEAM/examples/jpa/resources-websphere61/WEB-INF/classes/GlassfishDerbyDialect.class
./resources
resources/META-INF/jboss-app.xml
Ő [ m e[ _ ė Y[àJ # Æ jboss-app.xml `[ [[J [ #Ç
resources/*-ds.xml
Ő [ m e[ _ ė Y[àJ # Æm e[ e f
#ņ _ J ]`Ymė e[ Ç
resources/WEB-INF/components.xml
ş
^`[
J
<transaction:ejb-transaction
/>
Yņ J
f
m
ė Y
[ xm-
lns:transaction="http://jboss.com/products/seam/transaction"
ş
#[ m jndi-pattern java:comp/env/websphere_example/#{ejbName}
ş
] managed-persistence-context e m ZY[ [ à
<persistence:managed-persistence-context name="entityManager"
auto-create="true"
persistence-unit-jndi-name="java:/websphere_exampleEntityManagerFactory"/>
resources/WEB-INF/web.xml
]`Ym YY Servlet 2.5ņ Ė Servlet 2.4 b m mJ _
B m Y e m web.xml e[ [ö [ö m e[[_J6
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
# _m m jee5/booking ZY[ _ ^ e
m _`Z[ *m
e
Ė m Yà local-home e[J m e ]`Ym Ye m
YY `J
<ejb-local-ref>
<ejb-ref-name>websphere_example/AuthenticatorAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.tutorial.websphere.action.Authenticator</local>
</ejb-local-ref>
©C©
+g
|ė ]`Ym
<ejb-local-ref>
<ejb-ref-name>websphere_example/EjbSynchronizations</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
<local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
</ejb-local-ref>
1c[1  AuthenticatorAction
]
] _ ö m ZJ Authenticator ~ Y ^+ e
ş
I m [ AuthenticatorAction
ş
# m @Stateless m _ AuthenticatorAction [
ş
¢ e
[[ Authenticator _m
m AuthenticatorAction Y[ Æ^+
Ė ` mC [
[ e
Ç # m e
_m
@Local ņ J[ m _m J m authenticate AuthenticatorAction @Name("authenticator") @Stateless public class
AuthenticatorAction implements Authenticator {
@Local public interface Authenticator {
public boolean authenticate();
}
)
]ėC [à e
m web.xml e[ J J
1c[2 ]Ä x  build.xml
*m YY[
m [ Ė m jee5/booking ZY[
ş
¢mJ m e[ J archive Æ_ ė JJ C Y[à ]`YmÇ
<project name="websphere_example" default="archive" basedir=".">
ş
]`Ym [ö e m [ /security.drl e[ m e m war e[ e m e m websphere_example.jar _ mC m build.xml C m [
`[ *m e[[_J ` m Y e m
<target name="war" depends="compile" description="Build the distribution .war file"> f
J
<copy todir="${war.dir}">
<fileset dir="${basedir}/resources" >
<include name="*.drl" />
©C©
+h
|ė ]`Ym
</fileset>
</copy>
ş
] J m GlassfishDerbyDialect.class YY[
B * m e
m jar ö eà m Y e m [ö [ö m6
<target name="jar" depends="compile,copyclasses"
description="Build the distribution .jar file">
<copy todir="${jar.dir}">
<fileset dir="${basedir}/resources">
<include name="seam.properties" />
<include name="*.drl" />
<include name="GlassfishDerbyDialect.class" />
</fileset>
</copy>
...
ş
ùZ _ J m jboss-seam.jar m ` e m EAR e[ b Y[à
]`Ym Ė m B ` `m m /lib à m ` e m
EAR Ő m e[[_J m archive ö6
<fileset dir="${lib.dir}">
<include name="jboss-seam.jar" />
</fileset>
m m _m[ archive ö [ö [ö6
<target name="archive" depends="jar,war,ear"
description="Package the archives">
<jar jarfile="${dist.dir}/${project.name}.jar" basedir="${jar.dir}"/>
<jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
<jar jarfile="${dist.dir}/${project.name}.ear">
<fileset dir="${ear.dir}"/>
<fileset dir="${dist.dir}">
<include name="${project.name}.jar"/>
<include name="${project.name}.war"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="jboss-seam.jar" />
</fileset>
</jar>
</target>
ş
ù_
_
J Z B m build.xml ö e m <fileset
dir="${basedir}"> e m ö `[_ # m _ [ m ` e m
e[
<target name="ear" description="Build the EAR">
<copy todir="${ear.dir}">
<fileset dir="${basedir}/resources">
<include name="*jpdl.xml" />
<include name="*hibernate.cfg.xml" />
<include name="jbpm.cfg.xml" />
</fileset>
<fileset dir="${lib.dir}">
<include name="jboss-seam.jar" />
</fileset>
<fileset dir="${basedir}">
©C©
+k
|ė ]`Ym
<include name="lib/jbpm*.jar" />
<include name="lib/jboss-el.jar" />
<include name="lib/drools-*.jar"/>
<include name="lib/core.jar"/>
<include name="lib/janino*.jar"/>
<include name="lib/antlr-*.jar"/>
<include name="lib/mvel*.jar"/>
<include name="lib/richfaces-api*.jar" />
</fileset>
</copy>
<copy todir="${ear.dir}/META-INF">
<fileset dir="${basedir}/resources/META-INF">
<include name="application.xml" />
<include name="jboss-app.xml" />
</fileset>
</copy>
</target>
ş
ž` Y
<!-- Hibernate and deps -->
<include name="lib/hibernate.jar"/>
<include name="lib/hibernate-commons-annotations.jar"/>
<include name="lib/hibernate-annotations.jar"/>
<include name="lib/hibernate-entitymanager.jar"/>
<include name="lib/hibernate-validator.jar"/>
<include name="lib/jboss-common-core.jar" />
ş
b
Ő
_[[
$SEAM/examples/jpa/lib à
<!-- jsf
<include
<include
<include
<include
ş
Y
Yà
m
el-ri.jar
e
m
libs -->
name="lib/jsf-api.jar" />
name="lib/jsf-impl.jar" />
name="lib/el-api.jar" />
name="lib/el-ri.jar"/>
*m Yà Y
Ő _[[ Yà m jboss-archive-browsing.jar e
m $SEAM/examples/jpa/lib à m m YB
/lib à Ő _[[
[ Ė m concurrent.jar Y[
m à Ő J m e à B` ` B m e <!-- 3rd party and supporting jars -->
<!--<include name="lib/log4j.jar" />-->
<include name="lib/javassist.jar"/>
<include name="lib/dom4j.jar" />
<include name="lib/jboss-archive-browsing.jar" />
<include name="lib/concurrent.jar" />
<include name="lib/cglib.jar"/>
<include name="lib/asm.jar"/>
<include name="lib/antlr.jar" />
<include name="lib/commons-logging.jar" />
<include name="lib/commons-collections.jar" />
ş
jboss-seam.jar
f m `m m ear ` /lib à
<!-- seam jar -->
<include name="lib/jboss-seam.jar" />
©C©
+)o
|ė ]`Ym
Ő m[ Y _m mJ [ö6
<fileset dir="${basedir}">
<include name="lib/jbpm*.jar" />
<include name="lib/jboss-el.jar" />
<include name="lib/drools-*.jar"/>
<include name="lib/core.jar"/>
<include name="lib/janino*.jar"/>
<include name="lib/antlr-*.jar"/>
<include name="lib/mvel*.jar"/>
<include name="lib/richfaces-api*.jar" />
<!-- Hibernate and deps -->
<include name="lib/hibernate.jar"/>
<include name="lib/hibernate-commons-annotations.jar"/>
<include name="lib/hibernate-annotations.jar"/>
<include name="lib/hibernate-entitymanager.jar"/>
<include name="lib/hibernate-validator.jar"/>
<include name="lib/jboss-common-core.jar" />
<!-- jsf
<include
<include
<include
<include
libs -->
name="lib/jsf-api.jar" />
name="lib/jsf-impl.jar" />
name="lib/el-api.jar" />
name="lib/el-ri.jar"/>
<!-- 3rd party and supporting jars -->
<!--<include name="lib/log4j.jar" />-->
<include name="lib/javassist.jar"/>
<include name="lib/dom4j.jar" />
<include name="lib/jboss-archive-browsing.jar" />
<include name="lib/concurrent.jar" />
<include name="lib/cglib.jar"/>
<include name="lib/asm.jar"/>
<include name="lib/antlr.jar" />
<include name="lib/commons-logging.jar" />
<include name="lib/commons-collections.jar" />
<!-- seam jar -->
<include name="lib/jboss-seam.jar" />
</fileset>
1c[S
 ĉ |Ĕ \
ş
[ à YY[
`à [[J ant m ` à e à YB
ÆZ /
home/jbalunas/workspace/websphere_example Ç *m J e m `[ _[[ ` dist/
websphere_example.ear ş
* Y[à m YY[
e[[_ m m 6 )h)+ņ ů€Y[àJ
m YY[
]`YmŰ ` e
m YB
websphere_example f
e jboss-seam-jee5
ş
¢m
ö m YY 6 http://localhost:9080/websphere_example/index.html
©C©
+)
1f "î3;<%
345VW´¬ŷĆnƒƾţ&ï,45š£´¬Œ}vûŖ´ŗ
%Žï,45š£¯2ƎƏŠvK™HĴ™'ǹ´¬Œ}s%ÞŖ´ŗš£´¬ï
,45&ź}ŻŠŽ ^ +o ƞƟ%dÓñò2°Ŗ´ŗ—N¥ƍ£&ï,45Ž žf
`
[
âF3‚%dÓñò2°Ŗ´ŗ!¯2n
Ž
ǯ¼&ï,45EF՛2ëûnŒòÖ°2ŽŒ&ɽ%ɾǂ¯Ŗ´ŗ
´ƚ2& &ï,45ŽâF3‚ org.jboss.seam.annotations %dÓñòŖ´ŗ
1f B%TU%
aÒ¡"î3;<%
ï,45&š0&™Žn
;RSdÓ´¬Ŕ&%´ŗŒò»&ï,45Ž;RSGH-%šľòŖ
´ŗ
@Name
@Name("componentName")
GH-“¯2
;RSÒdÓ¯Ŗ´ŗ
&;RSŽŒ&ï,45sŲų%´ŗ
@Scope
@Scope(ScopeType.CONVERSATION)
;RS&—O¶;,Ã-dÓ¯Ŗ´ŗ
ǚǛtuvƜŽ
ScopeType
dz˹¡%dÓñò2°Ŗ´6 EVENT, PAGE, CONVERSATION, SESSION, BUSINESS_PROCESS, APPLICATION, STATELESSŗ
-;sǂzŠƓdñò2°v°ŷĆn
—O¶Ž;RSNM«ûɂv›2ÞŖ´ŗ
-,D-EF45
&ŷĆn
—O¶Ž
STATELESS
vûŖ´ŗ
?,@,@
ë«ì-,OEF45 v»n —O¶Ž CONVERSATION vûn C
&—O¶Ž EVENT vûŖ´ŗ
@Role
@Role(name="roleName", scope=ScopeType.SESSION)
;RSԃ&;,Ã-ȃ˜M<%Þ¬«"¯Ŗ´ŗ @Name½@Scope
ï,45ŽĐ—O¶KđdÓ¯Ŗ´ŗ
Ś
@Role
ï,45ŽĐǣǤKđ&dÓ}vûŖ´ŗ
ş
name
ş
scope
ő ;,Ã-ȃÒ%´ŗ
ő
;,Ã-ȃ-;%´ŗ
©C©
-;sǂzŠƓdñòv°ŷĆn
+))
ï,45
—O¶Ž$V&}ëû;RSNM«ûɂvûŖ´ŗ
@Roles
@Roles({
@Role(name="user", scope=ScopeType.CONVERSATION),
@Role(name="currentUser", scope=ScopeType.SESSION)
})
ԃ&ǣǤKƓd´¬Œ}s%Þ¬«"vûŖ´ŗ
@BypassInterceptors
@BypassInterceptors
€`[ [[ Y Y
[ Y m e Y
@JndiName
@JndiName("my/jndi/name")
s ^ ;RS&FGFš£´¬ ù€ ÒƓd¯Ŗ´ŗ ù€
ÒsǂzŠƓdñòv°ŷĆn
Ž
org.jboss.seam.core.init.jndiPattern
%Ɠdñò¬ ù€ âNš£¯Ŗ´ŗ
@Conversational
@Conversational
Y
e m C Y Y C[ņ J m mf
e m Y à ` [[ [ [JfJ C C
@PerNestedConversation
@PerNestedConversation
m Y e ¢ù^I#*ùf
Y Y B m Y C _m
m _ *m Y _[[ ` C`[ m[
Cņ _m
m _[[ J m _ ]J6 m [[feņ Y[ m Y _[[ ` C`[ e
Y e Ė à
[ņ C`[ e m m Yf
Y[
m eŅ
@Startup
@Scope(APPLICATION) @Startup(depends="org.jboss.seam.bpm.jbpm")
Y
e m YY[
Y Y [à [č
*m [à e `[f Y m `Y [ f
e
m ù€ņ ņ @Scope(SESSION) @Startup
©C©
+)+
ï,45
Y
e m Y Y [à ş
ő Y
e m m Y ` eņ e mà [[
depends
@Install
@Install(false)
;RSs—O¶%M-ñò¬Ų’sµ¬ºŠ"ºƓd¯Ŗ´ŗ
©[[
ï,45sȳ°ŷĆn;RSŽM-sŲ’%µ¬}°"ƬȘvûŖ´
ŗ
@Install(dependencies="org.jboss.seam.bpm.jbpm")
;RSsnĸŋʂ}¯2Ɠdñò¬;RSsM-ñò¬ŷƐ&Ø
M-ñò¬Œ}Ɠd¯Ŗ´ŗ
@Install(genericDependencies=ManagedQueueSender.class)
;RSsn
Ğd&GH-«û'Ɗñò¬;RSsM-ñò¬ŷƐ&ØM-ñ
ò¬Œ}Ɠd¯Ŗ´ŗ ĸ´¬;RS&Ò­sƄd%µ¬ŷƐưĮ%´ŗ
@Install(classDependencies="org.hibernate.Session")
;RSsnƓdñòœGH-sGH-â-qµ¬ŷƐ&ØM-ñò¬Œ}
Ɠd¯Ŗ´ŗ
@Install(precedence=BUILT_IN)
!&;RS&ÉÊƂƓd¯Ŗ´ŗ ͏ҭ&;RSsԃ¸ǰ´¬ŷĆn
«ûƁ°ÉÊƂÕÖ;RSsM-ñòŖ´ŗ
dÓñò¬ÉÊƂ&ƜŽŧ&}ëû%´ Æ̀ËÇ 6
ş
BUILT_IN
ő ´ƚ2&×ØÙØ ;RSsÕÖÉÊƂ
ş
FRAMEWORK
ş
APPLICATION
ş
DEPLOYMENT
ő ȁȂ´¬OD‡ðG&;RS“¯2š£´¬ÉÊƂ
ő 345;RS&ÉÊƂ ƗO¶&ÉÊƂÇ
ő
Ğd&—KMë°2345;RS$ɆÞ´¬;RS
“¯2š£´¬ÉÊƂ
ş
MOCK
ő ,-%š£ñò¬ |
ö Ċ–‚PG&ÉÊƂ
@Synchronized
@Synchronized(timeout=1000)
©C©
+)Q
ï,45
;RSsԃ&GHM«›2ÍΐGE-ñò¬Œ}n
ŽG?-4HMƛ´¬Œ}Ɠd¯Ŗ´ŗ
G?-sĞd&NM‡œĈçq;RS%KFGIJǁ%Þv°}èésǶ²
¯Ŗ´ŗ
@ReadOnly
@ReadOnly
C
;RSŖœŽ;RSÂÚF<sƭìƗ¯&Ąľû%ƪƫ&ÔɮŲ’}¯v°
Œ}Ɠd¯Ŗ´ŗ
@AutoCreate
@AutoCreate
Y
e m Y _[[ ` [[à ņ C e m [ Y
eà create=true
1f1 –ORK;<%¡"î3;<%
ŧ&
)
Ö&ï,45Ž˜M‚PG45Ăă¯Ŗ´ŗ
Œò»&ƙĬŽ;RSM-N-ȃŖœŽKâ,@&GEÂÚF<Ɠd%Þ
Ŗ´ŗ
@In
@In
;RS&ƙĬsŚ;RSƭìƗ¯&ôªÎ;,Ã-ȃº»M‚PG
ñò¬Œ}Ɠd¯Ŗ´ŗ ;,Ã-ȃs [[ &ŷĆn èésǶ²¯Ŗ´ŗ
@In(required=false)
;RS&ƙĬsŚ;RSƭìƗ¯&ôªÎ;,Ã-ȃº»M‚PG
ñò¬Œ}Ɠd¯Ŗ´ŗ ;,Ã-ȃŽ [[ %ŔŞ°ŖĿŻŗ
@In(create=true)
;RSƙĬs;RSƭìƗ¯&ôªÎ;,Ã-ȃº»M‚PGñ
ò¬Œ}Ɠd¯Ŗ´ŗ
@In(value="contextVariableName")
ï,45ÝŨ»òœM-N-ȃҚ£ĿŴn
;,Ã-ȃÒǂzŠƓd¯Ŗ´ŗ
@In(value="#{customer.addresses['shipping']}")
©C©
+)\
ï,45
;RSƙĬsŚ;RSƭìƗ¯&ôªÎ
¿Ȣȣ´¬Œ}%M‚PGñò¬Œ}Ɠd¯Ŗ´ŗ
ş
value
ş
create
b
^ ő ;,Ã-ȃÒƓd¯Ŗ´ŗ —O¶Ž;RS&ƙĬÒ%´ŗ
µ¬°Žn #{...} %̀»òœ b ^ ¿Ɠd¯Ŗ´ŗ
ő
;,Ã-ȃs´ƚ2&;,Ã-%dÓñò2°v°
Æ[[Ç
ŷƐ
s;,Ã-ȃ}͏ҭ%;RSM-N-ä´¬Œ}Ɠd¯Ŗ´ŗ
—O¶Ž e[ %´ŗ
ş
ő ;,Ã-ȃs´ƚ2&;,Ã-%dÓñò2°v°ŷƐ
sèéǶ²ñĿ¬Œ}Ɠd¯Ŗ´ŗ
required
@Out
@Out
;RS%µ¬;RS&ƙĬsƭìƗ¯&Ąľû%!&;,Ã-ȃœ
‚PGñò¬Œ}Ɠd¯Ŗ´ŗ ƙĬs [[ &ŷĆn èésǶ²¯Ŗ´ŗ
@Out(required=false)
;RS%µ¬;RS&ƙĬsƭìƗ¯&Ąľû%!&;,Ã-ȃœ
‚PGñò¬Œ}Ɠd¯Ŗ´ŗ ƙĬŽ [[ %ŔŞ°ŖĿŻŗ
@Out(scope=ScopeType.SESSION)
;RSNM%Žv°;RS&ƙĬsƭìƗ¯&Ąľû%Ğd-;œ
‚PGñò¬Œ}Ɠd¯Ŗ´ŗ
ǂzŠ-;sƓdñò2°v°ŷĆn
ƙĬÕÖ;RS¼Ȕ&-;sš£ñòŖ´
ÆŖœŽ;RSs-,D-%µòũ EVENTÇ ŗ
Ĥľû
@Out
@Out(value="contextVariableName")
ï,45ÝŨ»òœM-N-ȃҚ£ĿŴn
;,Ã-ȃÒǂzŠƓd¯Ŗ´ŗ
ş
value
ő ;,Ã-ȃÒƓd¯Ŗ´ŗ —O¶Ž;RS&ƙĬÒ%´ŗ
ş
required
ő œ‚PG45(›œ}ސ;RSƙĬs [[ Ŧ›œŷĆn
sèéǶ²ñĿ¬Œ}Ɠd¯Ŗ´ŗ
Œò»&ï,45ŽÍΐĮ£ñòŖ´ŗ è6
@In(create=true) @Out private User currentUser;
©C©
+)a
ï,45
ŧ&ï,45Ž
¤S‚ĭ;RS
âNR¯Ŗ´ŗ
Œ&ï,45ŽnM‚PGñò¬ĩ&°ţÖº&GH-&M-N-&HMOMG
•=´¬
;RS%Į£ñòn;RS&
J
ÂÚF<ÝʫñòŖ´ŗ
@Unwrap
@Unwrap
Œ&ï,45sÝ°2°¬
J
ÂÚF<«ûĺñò¬Ċ–‚PGsn;RSM-N-¼Ȕ&ĤľûM‚P
GñòŖ´ŗ
*m Z YY m e
à Y Yņ _m Y f
Y`[ e [čJ m C[ e Z C`[ *m Y
[[à e[ e
[čJ à e J m Y fe
Ė Yf
Y Y m
@Factory
@Factory("processInstance") public void createProcessInstance() { ... }
;,Ã-ȃƜsv°ŷƐn
Œ&;RS&ÂÚF<sƓd;,Ã-ȃ&Ɯ&0Ĉ䐚£ñò¬Œ}Ɠd¯
Ŗ´ŗ Œ&-NMŽ void ĺ´ÂÚF<}Ŋ£¯Ŗ´ŗ
@Factory("processInstance", scope=CONVERSATION) public ProcessInstance createProcessInstance() { ... }
;,Ã-ȃƜsv°ŷĆn
sƓd;,Ã-ȃ&Ɯ&0Ĉ䐚£´¬ƜŒ&ÂÚF<sĺ´Œ}Ɠd¯Ŗ´ŗ
Œ&-NMŽƜĺ´ÂÚF<}Ŋ£¯Ŗ´ŗ ǂzŠ-;sƓdñò2°v°ŷĆn
@Factory
ÂÚF<ÕÖ;RS¼Ȕ&-;sš£ñòŖ´
Æ!&;RSs-,D-%Žv°ŷĆŗ
;RSs-,D-%µ¬ŷƎEVENT ;,Ã-sš£ñò¬Ç ŗ
Log
ş
value
ő
;,Ã-ȃÒƓd¯Ŗ´ŗ
ÂÚF<s
—O¶Ž C Kâ,@Ò}vûŖ´ŗ
ş
scope
ş
autoCreate
J
ÂÚF<v»n
ő
sĺñòœƜ˜M<´¬Ê&-;Ɠd¯Ŗ´ŗ
Ɯĺ´OáGÂÚF<“¯2¯ºƬȘsµûŖĿŻŗ
ő Y
e m m e
à m m[ ` [[à [[
_mC m C`[ ö eņ C e © Y
eà ̾
M‚PG´¬ï,456
@Logger
@Logger("categoryName")
©C©
+)g
ï,45
;RSO@<
org.jboss.seam.log.Log
&M-N-M‚PG¯Ŗ´¯Ŗ´ŗ ?,@,@ &ŷĆn Œ&O@<Ž
}¯2ƎƏñòvŨòũvûŖĿŻŗ
ş
value
ő K™L,̇ÒƓd¯Ŗ´ŗ —O¶Ž;RSGH-Ò%´ŗ
šŶ&ï,45nG?-âHÂNƜ&M‚PG6
@RequestParameter
@RequestParameter("parameterName")
;RS&ƙĬG?-âHÂNƜM‚PG¯Ŗ´ŗ
ĜˆŠv“”Ž¼/ŠôªñòŖ´ŗ
ş
value
ő G?-âHÂNÒƓd¯Ŗ´ŗ —O¶Ž;RSƙĬÒ%´ŗ
1f2 B%TU%
%
.LOQ$OK#¿ÙJC¡"î3;<
Œò»&ï,45«ûn
;RSs!&;RS¼Ȕ&HMOMGM¹“¯2Dzż´¬Œ}s%Þ
¬«"vûŖ´ŗ
Ś;RSGH-Ȧ}!òɇò
Ö&ï,45&ØdÓ%ÞŖ´ŗ
@Create
@Create
;RS&M-N-s
«›2M-N-äñòœ}ސƭìƗñò¬ÂÚF<Ɠd¯Ŗ´ŗ ÂÚF<Ž
C
ë«ì-,OEF45
“¯2¯ºRñòv°&%ơƬ¯2ţŦñ°ŗ
@Destroy
@Destroy
;,Ã-sĄą¯n!&;,Ã-ȃsȒȓñò¬}Þ&ƭìƗñò¬ÂÚF<Ɠd
¯Ŗ´ŗ
à
ÂÚF<Ž
C
ë«ì-,OEF45
“¯2¯ºRñòv°&%ơƬ¯2ţŦñ°ŗ
€à ÂÚF<ŽGF&ؚ£´¬«"¯2ţŦñ°ŗ Ž
ÂÚF<º»ʋʌ´¬è鎴ƚ2ÃĭF¯2K™Ɨū¯nέ22¯Ŗ°Ŗ´ŗ
à
@Observer
@Observer("somethingChanged")
©C©
+)h
ï,45
ƓdñòœNM&;RSÑ/M¹sǶ²´¬}nŒ&ÂÚF<sƭìƗñòŖ´
ŗ
@Observer(value="somethingChanged",create=false)
ƓdñòœNM&M¹sǶ²´¬}Œ&ÂÚF<sƭìƗñòŖ´sn
M-N-s¸ǰ¯v°ŷƎM-N-p³¯v°Œ}Ɠd¯Ŗ´ŗ
M-N-s¸ǰĿŴ s e[ &ŷƎn !&M¹ŽʦήñòŖĿŻŗ f
&—O¶ƜŽ %´ŗ
1fS B%3À4
ņŇ¡"î3;<%
Œò»&ï,45ŽƎƏŠ“”&Ňňcd¯Ŗ´ŗ
Œò»Ž
;RS&ÂÚF<$nĻļŽG45-êÂÚF<ÝʫñòŖ´ŗ
´ƚ2&
]^
G?-Ž!òŋŌ´¬“”Š;,Ã-՛2°Ŗ´ŗ
ź}ŻŠ&“”ŽG?-&Ąą}ÍΐĄą¯Ŗ´ŗ
ԃ&G?-ľœ¬“”sŲ’%µòũn©J
ÝŨœÂÚF<ƭìƗ´Œ}%n
ɐĈ“”̀‰ñĿvŨòũvûŖĿŻŗ
@Begin
@Begin
Y
e m [JfJ C `J _m m m f[[
_m Z
Y
@Begin(join=true)
ɐĈ“”s´%ôªñò2°¬ŷĆn
“”;,Ã-sſʋʌñò¬Œ}Ɠd¯Ŗ´ŗ
@Begin(nested=true)
ɐĈ“”s´%ôªñò2°¬ŷĆn
®œS-ñòœ“”;,Ã-sôª´¬Œ}Ɠd¯Ŗ´ŗ
ŧ&
@End
sƗǹ¯œ}ސS-ñòœ“”sĄą¯n
éˬ&“”sƲô¯Ŗ´ŗ
͏éˬ&“”ë°2n
ԃ&S-ñòœ“”sÍΐ¸ǰ´¬Œ}ŽŹţƺƻµûŖĿŻŗ
@Begin(pageflow="process definition name")
Œ&“”&œ1&‚OKdÓ´¬ B~| KE-dÓ&Ò­dÓ¯Ŗ´ŗ
@Begin(flushMode=FlushModeType.MANUAL)
•=&ij;,Ã-&OHF4Å<Ɠd¯Ŗ´ŗ
flushMode=FlushModeType.MANUAL Ž C R¯Ŗ´ŗ Œ&ŷĆn flush
()
ÆĻļn
“”ĄąÎƭìƗñò¬Ç
&ǂzŠv;s.Þ¬Ŗ%n
©C©
+)k
ï,45
´ƚ2&ɆÞÙØ/pŽ“”;,Ã-qÃM™ñòŖ´ŗ
ş
join
ő ɐĈ“”s´%ôªñò2°¬ŷĆ&/pƓd¯Ŗ´ŗ true %µòũn
;,Ã-ŽʋʌñòŖ´ŗ false %µòũn èésǶ²¯Ŗ´ŗ —O¶Ž false
%´ŗ nested=true sƓdñò¬ŷƎn Œ&cdŽȳɀñòŖ´ŗ
ş
nested
ş
flushMode
ş
pageflow
ő
ɐĈ“”s´%ôªñò2°¬ŷĆn
S-ñòœ“”sôªñò¬Œ}Ɠd¯Ŗ´ŗ
ő Œ&“”%p³ñò¬ •=& ž` EF45nŖœŽ ~#
ij;,Ã-&OHF4Å<EF¯Ŗ´ŗ
ő org.jboss.seam.core.jbpm.pageflowDefinitions. «›2—KMñòœ B~|
KE-dÓ&KE-dÓÒ%´ŗ
@End
@End
Œ&ÂÚF<sèéë«ì
[[
ɐĈ“”sĄą´¬Œ}Ɠd¯Ŗ´ŗ
ş
śé&
ĺ´ŷĆn
ő `à e[ņ m C _[[ [[à ` à [
e à m J beforeRedirect=true Y
e m m f
C m[ ` à m e m Ėņ m m f
_[[ ` Y
_ Yà C Z
beforeRedirect
@StartTask
@StartTask
B~|
N-GĐôªđ¯Ŗ´ŗ
Œ&ÂÚF<sèéë«ì
[[
śé&
ĺ´}Þn
ɐĈ“”ôª´¬Œ}Ɠd¯Ŗ´ŗ
Œ&“”ŽƓd&G?-âHÂNŀ%Ɠdñò¬
B~|
N-G}ŋŌ¯2°Ŗ´ŗ
Œ&“”&;,Ã-q%n
N-GM-N-&l‚S-KE-M-N-“¯2n
l‚S-KE-;,Ã-ŔdÓñòŖ´ŗ
B~|
TaskInstance
Žn
taskInstance
}°"Ò­&G?-;,Ã-ȃ}¯2Į£tu}vûŖ´ŗ B~| ProcessInstance
Žn
processInstance
}°"Ò­&G?-;,Ã-ȃ}¯2Į£tu%´ŗ
ÆŔnjȅŻnŒò»&Ċ–‚PGŽ @In %M‚PG45stu%´ŗÇ
ş
taskIdParameter
ő N-G& € ÕÖG?-âHÂN&Ò­%´ŗ —O¶Ž
[[÷ŸöŸ
ş
ő Œ&“”%p³ñò¬ •=& ž` EF45nŖœŽ ~#
ij;,Ã-&OHF4Å<EF¯Ŗ´ŗ
flushMode
@BeginTask
©C©
++o
ï,45
@BeginTask
Ÿą¯2°v° B~| N-G&Ð=Ʋô¯Ŗ´ŗ Œ&ÂÚF<sèéë«ì [[ śé&
ĺ´}Þn
ɐĈ“”sôª´¬Œ}Ɠd¯Ŗ´ŗ
Œ&“”ŽƓd&G?-âHÂNŀ%Ɠdñò¬
B~|
N-G}ŋŌ¯2°Ŗ´ŗ
Œ&“”&;,Ã-q%n
N-GM-N-&l‚S-KE-M-N-“¯2n
l‚S-KE-;,Ã-ŔdÓñòŖ´ŗ
Ÿą¯2°v° B~| N-G&Ð=Ʋô¯Ŗ´ŗ Œ&ÂÚF<sèéë«ì [[ śé&
ĺ´}Þn
ɐĈ“”sôª´¬Œ}Ɠd¯Ŗ´ŗ
Œ&“”ŽƓd&G?-âHÂNŀ%Ɠdñò¬
B~|
N-G}ŋŌ¯2°Ŗ´ŗ
Œ&“”&;,Ã-q%n
N-GM-N-&l‚S-KE-M-N-“¯2n
l‚S-KE-;,Ã-ŔdÓñòŖ´ŗ
B~|
org.jbpm.taskmgmt.exe.TaskInstance
Ž
n
}°"Ò­&G?-;,Ã-ȃ}¯2Į£tuvûŖ´ŗ
org.jbpm.graph.exe.ProcessInstance
Žn
}°"Ò­&G?-;,Ã-ȃ}¯2Į£%ÞŖ´ŗ
ş
taskIdParameter
taskInstance
B~|
processInstance
ő N-G& € ÕÖG?-âHÂN&Ò­%´ŗ —O¶Ž
[[÷ŸöŸ
ş
ő Œ&“”%p³ñò¬ •=& ž` EF45nŖœŽ ~#
ij;,Ã-&OHF4Å<EF¯Ŗ´ŗ
flushMode
@EndTask
@EndTask
B~|
N-GĐĄąđ¯Ŗ´ŗ
Œ&ÂÚF<s
[[
śé&§¨ĺ´}Þn
ɐĈ“”ŽĄą¯n
ǹǰ&N-GsŸą´¬Œ}Ɠd¯Ŗ´ŗ
B~|
H‚45ȽÞ.Œ¯Ŗ´ŗ
345s
transition
}ƭũò¬×ÙØ;RS&
Transition.setName
()
ƭŻ%°v°ȃûn
ȽÞ.Œñò¬'ę&H‚F45Ž—O¶&H8G45vûŖ´ŗ
@EndTask(transition="transitionName")
Ɠdñòœ B~| H‚45ȽÞ.Œ¯Ŗ´ŗ
@EndTask(ifOutcome={"success", "continue"})
Œ&ÂÚF<sƓdñòœ
&°Ŵòºĺ´}ÞnN-GsĄą´¬Œ}Ɠd¯Ŗ´ŗ
ş
transition
ş
beforeRedirect
ő N-GsĄą´¬}ސȽÞ.Œñò¬ B~| H‚45&Ò­%´ŗ
ȇȈñòœŷƎ—O¶H‚45}vûŖ´ŗ
©C©
ő
—O¶%Žn
++
ï,45
vŻ»º&ĕMDGsǶ²´¬Ŗ%“”Ž'ꐎȒȓñòŖĿŻŗ
beforeRedirect=true
}cd´¬}n
ǹǰ&G?-&Ąą%“”sȒȓñòn
ĕMDGs®¯°,RH“”;,Ã-%Ð=ñò¬«"Ɠd´¬Œ}vûŖ
´ŗ
@CreateProcess
@CreateProcess(definition="process definition name")
ÂÚF<sèéë«ì
[[
śé&
KE-M-N-p³¯Ŗ´ŗ
ProcessInstance
}°";,Ã-ȃ}¯2š£%ÞŖ´ŗ
ş
ĺ´}Þn
Ċ–‚PGŽ
®¯°
B~|
processInstance
ő org.jboss.seam.bpm.jbpm.processDefinitions «›2—KMñò¬ B~|
KE-dÓ&Ò­%´ŗ
definition
@ResumeProcess
@ResumeProcess(processIdParameter="processId")
ÂÚF<sèéŖœŽ
[[
śé&
ĺ´}Þn
·¸&
KE-M-N-&-;ƲƂŪûŖ´ŗ ProcessInstance Ċ–‚PGŽ
cessInstance }°";,Ã-ȃ%š£%ÞŖ´ŗ
ş
processIdParameter
"processId"
B~|
pro-
ő KE- € ÕÖG?-âHÂNÒ%´ŗ —O¶Ž
%´ŗ
@Transition
@Transition("cancel")
|ö m J[[J m B~| Y
_mCf
m m f[[ [
1f[
1]]
ňņ
B%TU% '˜¡±©š8."î3;<%
Æ
YC m [ à e
[[`
ö e m *# e
[ @Transactional
@Transactional
C
;RSEF45
;RS&—O¶/p}͏«"vH8G45/p՜Ŀ¬Œ}Ɠd¯Ŗ
´ŗ
èýũn
ÂÚF<ƭìƗ¯ŽH8G45q%.Œ¬ƚÞ%µûn
ÂÚF<sƭìƗñòœ}ސH8G45s¸ǰ¯v°ŷƎn
©C©
++)
ï,45
H8G45s!&ÂÚF<&œ1ŦŨôªñòŖ´ŗ
Œ&ï,45ŽGH-D¹%ŔÂÚF<D¹%Ŕǃ£tu%´ŗ
€ m ^ +o Yņ @TransactionAttributeŅ
@ApplicationException
@ApplicationException
àà e BCZB`#YY[
^Z
Yņ e Y C ^^ \ C
#YY[ Z
Y m YY[
Z
Y m[ `
Y m [ [àÆņ _YYÇ
€ m ^ +o Yņ @javax.ejb.ApplicationException
ş
rollback
ő `à e[ falseņ e true m Z
Y m[ m [[`
ö [à
ş
end
ő `à e[ falseņ e true m Z
Y m[ m [JfJ
C
@Interceptors
@Interceptors({DVDInterceptor, CDInterceptor})
àà e BCZ
Y
Yņ e Y C ^^ \ C
ù m m à [à ` f €
[ [ e f
Y e [ m
€ m ^ +o Yņ @javax.interceptor.Interceptors
*m [à e[ e C Y e à ^ +o f
Yņ à m[ m C ^^\ 1f^ æç¡."î3;<%
Œò»&ï,45«û
;RSº»ʋʌ´¬èéÐ=´¬ēĔƓd´¬Œ}s%ÞŖ´ŗ
@Redirect
@Redirect(viewId="error.jsp")
Œ&ï,45Ý°2°¬èéŽnƓdñòœl
–Hœ8ĕMDG¯Ŗ´ŗ
ş
viewId
€
ő ĕMDG´¬ b l € %´ŗŒŒ% ^ ŔĮ£tu%´ŗ
©C©
+++
ï,45
ş
message
ş
end
ő Ěz´¬ÂFE‚%´ŗ —O¶Ž!&èé&ÂFE‚%´ŗ
ő ɐĈ“”sĄą´¬«"Ɠd¯Ŗ´ŗ —O¶Ž false %´ŗ
@HttpError
@HttpError(errorCode=404)
Œ&ï,45sÝ°2°¬èéŽn ž**~ ?HsɍħñòŖ´ŗ
ş
errorCode
ş
message
ş
end
ő ž**~ ?H;<%´ŗ —O¶Ž 500 %´ŗ
ő
ž**~
—O¶Ž!&èé&ÂFE‚%´ŗ
?H%ɍħñò¬ÂFE‚%´ŗ
ő ɐĈ“”sĄą´¬«"Ɠd¯Ŗ´ŗ —O¶Ž false %´ŗ
1fb j¡."î3;<%
IJŽn
śŜ&ï,45ÝŨœ
&KLMNOP-sŲ’%´ŗ
EF45
@WebRemote
@WebRemote(exclude="path.to.exclude")
Œ&ï,45ÝÞ&ÂÚF<ŽGHMM<&
C
Y
º»ƭũò¬tuĬsµ¬Œ}z¯2°Ŗ´ŗ
exclude
Kâ,@ŽĊ45%n
Ċ–‚PGs!&§¨&Ċ–‚PG™HOº»Ƹéñò¬«"´¬Œ}s%ÞŖ´
ÆȨ㎠IJ &ɽȺȻÇ ŗ
1fc O%PI&P¡."î3;<%
śŜ&ï,45Žn MNENGH-%šľòŖ´ŗ
^
MNENdӐŲ’vï,45ŋ´¬ȨãŽ
ƞƟ&<ÃÂȺȻ¯2ţŦñ°ŗ
^
+o
@Interceptor
@Interceptor(stateless=true)
Œ&MNENŽ-,D-%µ¬Œ}Ɠd´¬&%n
ŽÔɮÐ=šǃä´¬Œ}s%ÞŖ´ŗ
@Interceptor(type=CLIENT)
Œ&MNENŽ
©C©
^
++Q
ï,45
;,ê«û­ƭũò¬ĐGHMM<đMNEN%µ¬Œ}Ɠd¯Ŗ´ŗ
@Interceptor(around={SomeInterceptor.class, OtherInterceptor.class})
Œ&MNENŽĞd&MNEN«û-NFGq%«ûƁ°ÌǞTǞñò¬Œ}
Ɠd¯Ŗ´ŗ
@Interceptor(within={SomeInterceptor.class, OtherInterceptor.class})
Œ&MNENŽĞd&MNEN«û-NFGq%«ûș°ÌǞTǞñò¬Œ}
Ɠd¯Ŗ´ŗ
1ff ĪÌĄ¡."î3;<%
ŧ&ï,45ŽīÍĈÂÚF<&ƎƏš£ñòŖ´ŗ è6
@Asynchronous public void scheduleAlert(Alert alert, @Expiration Date date) { ... }
@Asynchronous public Timer scheduleAlerts(Alert alert,
@Expiration Date date,
@IntervalDuration long interval) { ... }
@Asynchronous
@Asynchronous
ÂÚF<;ŽīÍĈ%Ð=ñò¬Œ}Ɠd¯Ŗ´ŗ
@Duration
@Duration
īÍĈ;&âHÂNsn
!&;sÐ=ñò¬Ŗ%&Ĉç%µ¬Œ}Ɠd¯Ŗ´
ÆŖœŽDz̵;&ŷƎ012&Ð=s(ľò¬Ŗ%Ç ŗ
@Expiration
@Expiration
īÍĈ;&âHÂNsn
!&;sÐ=ñò¬
ÆŖœŽDz̵;&ŷƎ012&Ð=s(ľò¬Ç ĵÝ}ÎĶ%µ¬Œ}Ɠd¯Ŗ´ŗ
@IntervalDuration
@IntervalDuration
Œ&ï,45sÝ°2°¬ƲίƭìƗ¯("īÍĈÂÚF<;&âHÂNsn
ƲίƭìƗ¯ç&Ĉç%µ¬Œ}Ɠd¯Ŗ´ŗ
1fi _ '˜¡±©š8."î3;<%
©C©
++\
ï,45
*m e[[_J ö _öJ _m b @Converter
#[[_ Y b C *m [ ` Yņ Y[ javax.faces.convert.Converter
ş
id
ő m b C €e[ m Y ş
forClass
ő e Y
eņ J m Y m e[ C e àY
@Validator
#[[_ Y b C[ *m [ ` Yņ Y[ javax.faces.validator.Validator
ş
id
ő m b C[ €e[ m Y 1fi _
dataTable
wʼn¡±©"î3;<%
śŜ&ï,45Ž-,OEF45
š›œGFL–-&'ƊrƱ¯Ŗ´ŗ
Œò»&ï,45ŽƙĬÝʫñòŖ´ŗ
@DataModel
@DataModel("variableName")
B
YYà e àY Listņ Mapņ Set Object[] b DataModel m
Y e m _J Y Æ m EVENT Y e m _J Y STATELESSÇ m e Mapņ m _ e m DataModel Map.Entry
ş
value
ş
scope
ő e m C Z C`[ €e[ m ` ő e scope=ScopeType.PAGE ZY[
[à Y
eņ m DataModel _[[ ` öY
m PAGE Z
@DataModelSelection
@DataModelSelection
B
m [
C[ e m b DataModel Æm m [ e m [àf
J [[
ņ m Y C[Ç e [à @DataModel ` e e Yņ m [
C[ e m DataModel _[[ ` B
m_ņ m
Y e m @DataModel ` Y
e m C[ ` e m
@DataModelSelection
e PAGE Y Y
e m @DataModelņ mņ m
€|[ [
`J B
ņ m €|[ _[[ [ ` B
©C©
++a
ï,45
m ņ e m YYà _m @DataModel J mņ m m e m YYà [ ` Y e m #~ e m J ¢Y
ş
ő e m C Z C`[ ù e m Z
[à
@DataModel m Y
value
@DataModelSelectionIndex
@DataModelSelectionIndex
^ZY m [
Z e m b DataModel ` e m Y
Æm m _ ` e m [àJ [[
ņ m Y öàÇ e [à @DataModel ` e e Yņ m [
C[ e m DataModel
_[[ ` B
m_ņ m Y e m @DataModel ` Y
e
m C[ ` e m @DataModelSelectionIndex
ş
ő e m C Z C`[ ù e m Z
[à
@DataModel m Y
value
1f •P–O%•G%—¡.¿P"î3;<%
Œò»&ÂNï,45Žnwx}ŽƐĩ&—N¹-ŞɃ“¯2
@DataModelSelection }ÍƟ&ķu&'Ɗtu¯Ŗ´ŗ
@DataModel
ĝ
@DataBinderClass
@DataBinderClass(DataModelBinder.class)
ï,45s—N˜M—@™&ï,45%µ¬Œ}Ɠd¯Ŗ´ŗ
@DataSelectorClass
@DataSelectorClass(DataModelSelector.class)
ï,45s—NǚǛ&ï,45%µ¬Œ}Ɠd¯Ŗ´ŗ
1f1 àJ:%—¡."î3;<%
Œ&ï,45Žn
w̪âF3‚™´¬;RSEFŋ´¬ȟȠƎƏ´¬ÂLŎƛ‡ƿǀ¯Ŗ´
ŗ Š& C âF3‚“¯2Ŕǃ£%ÞŖ´ŗ
@Namespace
@Namespace(value="http://jboss.com/products/seam/example/seampay")
ǹǰ&âF3‚µ¬;RSĞd&S‡--ŋŌÝŨ»ò¬Œ}Ɠd¯
©C©
++g
ï,45
Ŗ´ŗ
ƎƏñòœS‡--Ž
components.xml
OáMq%
å| S‡--}¯2š£´¬Œ}%345&cdſȩä´¬Œ}s%ÞŖ´ŗ
@Namespace(value="http://jboss.com/products/seam/core", prefix="org.jboss.seam.core")
S‡--Ğd&âF3‚ŋŌÝŨ¬«"Ɠd¯Ŗ´ŗ
Ŗœn
;RSÒ&DO@FG-s
å| OáMq%Ɠdñò¬;RSҐǃ£ñò¬«"Ɠd¯Ŗ´ŗ
œ}ýũn
Œ&S‡--ŋŌÝŨ»ò¬ microcontainer }°" å| ?DŽ'ꐎ
org.jboss.seam.core.microcontainer }°";RSȺȻ´¬«">ͻñòŖ´ŗ
1f2 $”HJ
B%3éwŃñ©š8."î3;<%
*m [[_ à J à Y _m m C[ @Filter
A m Y Æ_m
m Y[ javax.servlet.FilterÇ _m @Filter
C[ e[ _[[ ` Z
`à ė e[
ş
@Filter(around={"seamComponent", "otherSeamComponent"})
Y
e m m e[ Y mJm m ö m m JC e[f
ş
@Filter(within={"seamComponent", "otherSeamComponent"})
Y
e m m e[ Y Y m ö m m JC e[f
©C©
++h
2i Ö×Ø× B%TU%
ˆɽ%Ž &×ØÙØ;RSn !&cdKâ,@Ö°2ɾǂ¯2°ÞŖ´ŗ *m
`[f Y _[[ ` C e mà [ à components.xml
e[ņ ` e à C e[ YY Y
eà m Y
e àYņ components.xml š›2ǯ¼&GH-%×ØÙØ;RS&Ò­Ɠd´¬}n
×ØÙØ;RSǯ¼&'ƊžſǞÞʺý¬Œ}s%ÞŖ´ŗ
@Name
Ŗœn
×ØÙØ;RSŽ˃˸Қ£¯Ŗ´sn
!&ź}ŻŠŽ—O¶%ī˃˸Ґ?M-ñò2°¬&%ơƬ¯2ţŦñ°ŗ
Œ"¯œ?M-Ž
auto-create="true"
Ɠd´¬œ1n
×ØÙØ;RS!&ī˃˸Ò%M‚PG´¬ŷƐ
create=true
š"Ų’ŽµûŖĿŻŗ
2i B%3À4
O%RK;<%.B%TU%
š0&×ØÙØ;RSEFŽn
ſȩñŖǾŖvĠΰ$&Ċ–‚PG&M‚PGR´¬œ1¸ǰ¯2°Ŗ´ŗ
œ}ýũn
ŧ&;RSM-N-&ȃŽM‚PGñòœ
EF45&;,Ã-Ċ–‚PGÕÖŒ}vûŖ´ŗ
@In private Context sessionContext;
org.jboss.seam.core.contexts
¢Y
m
YC
¢Z
`B
ņ
e
ZY[
org.jboss.seam.core.contexts.sessionContext['user']
org.jboss.seam.core.facesContext
;,Ã-Ċ–‚PG
&•=;RS
FacesContext
ÆŢŤŽ
;,Ã-%Žv°Ç
Œò»;RSŽ´ƚ2ļM-ñòŖ´ŗ
2i1 >3G!3GB%TU%
Œò»&;RSsǍǎÖķƘŽµŖûµûŖĿŻŗ
org.jboss.seam.faces.facesMessages
–Hœ8ĕMDGα¯ e
³øÂFE‚&ʋʌtu¯Ŗ´ŗ
ş
add(FacesMessage
ő̽
e
ÂFE‚ǣǤ¯Ŗ´ŗ
Œ&ÂFE‚Žǹǰ&“”%Ƕ²´¬ŧ&Dĕ™żΡOPƛŀĚzñòŖ´ŗ
ş
add(String
©C©
facesMessage)
messageTemplate)
ő̽
^ ++k
×ØÙØ ;RS
ĚǹġŻ%°¬tuĬsµ¬Ğd&ÂFE‚,Dº»Dĕ™ñò¬
e
ÂFE‚ǣǤ¯Ŗ´ŗ
ş
add(Severity
ő̽
ĚǹġŻ%°¬tuĬsµ¬Ğd&ÂFE‚,Dº»Dĕ™ñò¬
e
ÂFE‚ǣǤ¯Ŗ´ŗ
ş
addFromResourceBundle(String
ş
addFromResourceBundle(Severity
ş
clear()
severity,
String
messageTemplate)
^ key)
ő̽
Ú-˜<q%dÓñò¬ÂFE‚,Dº»Dĕ™ñò¬
ÂFE‚ǣǤ¯Ŗ´ŗ ^ ĚǹġŻ%°¬tuĬsµûŖ´ŗ
e
ő̽
Ú-˜<q%dÓñò¬ÂFE‚,Dº»Dĕ™ñò¬
ÂFE‚ǣǤ¯Ŗ´ŗ ^ ĚǹġŻ%°¬tuĬsµûŖ´ŗ
e
severity,
String
key)
ő̽ Ź2&ÂFE‚Ȋȋ¯Ŗ´ŗ
org.jboss.seam.faces.redirect
âHÂNÖÞ%ĕMDG("ŷƐưĮv
ÆА–FG¤Gtuv¥¦§¨ǽƧvŠǍǎnjŖ´Çŗ
ş
redirect.viewId
ş
redirect.conversationPropagationEnabled
#~
%´
ő̽ ĕMDGÊ& b l € %´ŗ
ő̽
ĕMDGŹȔÈʺsʋʌ´¬ºŠ"ºŤd¯Ŗ´ŗ
ş
redirect.parameters
ő̽
Ɯ“´¬G?-âHÂNÒ&¤F%´ŗ
ĕMDGG?-q%țñòŖ´ŗ
ş
execute()
ş
captureCurrentRequest()
ő̽ ƣnjĕMDG(°Ŗ´ŗ
ő̽
&G?-âHÂN}l
;¯2š£¯Ŗ´ŗ
ǹǰ&
€
ó^*
G?-
‰Ț¯Ŗ´ŗ
Ɠ”;,Ã-qÇ
Ŷ%
execute()
org.jboss.seam.faces.httpError
ž**~ ?Hɍħ´¬ŷƐưĮv #~ %´ŗ
org.jboss.seam.core.events
&ÂÚF<ŖœŽ
components.xml
q&ÂÚF<˜M—@™ǐȍ%̆ɀ%Þ¬M¹ȽÞ.Œ´ #~ %´ŗ
@Observer
ş
raiseEvent(String
ő̽
type)
ĞdNM&M¹ȽÞ.Œ¯n
̆ɀ¯2°¬ʥŹβTħ¯Ŗ´ŗ
ş
raiseAsynchronousEvent(String
type)
ő̽
NM¤l-«ûīÍĈŠÐ=ñò¬M¹ȽÞ.Œ¯Ŗ´ŗ
^+
ş
raiseTimedEvent(String
ő̽
NM¤l-«ûīÍĈŠÐ=ñò¬M¹-3‚¯Ŗ´ŗ
^+
©C©
type,
....)
+Qo
×ØÙØ ;RS
ş
addListener(String
type,
String
ő̽
methodBinding)
ĞdM¹NM&̆ɀĨǣǤ¯Ŗ´ŗ
org.jboss.seam.core.interpolator
J  b ^ Ěǹ&ƜǴŸ´¬œ1& #~ %´ŗ
ş
ő̽
#{...}
¾¿&
Ěǹ£&,D-Ãĭ¯n !òȢȣñòœƜ}ǞÞʺýŖ´ŗ
interpolate(String
template)
b
^ org.jboss.seam.core.interpolator
# #~ e Y[J m C[ e b ^ ZY J
ş
ő m Y[ e b ^ ZY e m e
Y[
m _m m C[ C[
interpolate(String template)
#{...}
org.jboss.seam.core.expressions
Ɯ}ÂÚF<˜M,@™p³´¬œ1& #~ %´ŗ
ş
createValueBinding(String expression)
ş
createMethodBinding(String
ő̽ Ɯ˜M—@™Ċ–‚PGp³¯Ŗ´ŗ
ő̽
expression)
ÂÚF<˜M—@™Ċ–‚PGp³¯Ŗ´ŗ
org.jboss.seam.core.pojoCache
¢
m PojoCache M-N-&•=;RS%´ŗ
ş
pojoCache.cfgResourceName
ő̽
cdOáM&Ò­%´ŗ
treecache.xml
—O¶%cd¯Ŗ´ŗ
org.jboss.seam.core.uiComponent
^ º»&
€
%
b
ǵ&GE-ɋt¯Ŗ´ŗ
@In("#{uiComponent['myForm:address'].value}") }VW´¬Œ}s%ÞŖ´ŗ
UIComponent
œ}ýũn
Œò»;RSŽ´ƚ2ļM-ñòŖ´ŗ
2i2 ėĘâw3¢.B%TU%
ŧ&;RS™Ž
š£¯œĘęä78MNOP-&l<rƱ¯Ŗ´ŗ
org.jboss.seam.core.locale
&K3%´ŗ
org.jboss.seam.international.timezone
&NM‡ě%´ŗ NM‡ěŽEF45-;%´ŗ
org.jboss.seam.core.resourceBundle
Ú-˜<%´ŗ
©C©
Ú-˜<ŽEF45-;%´ŗ
+Q
×ØÙØ ;RS
Ú-˜<Ž C Ú-˜<&wx%Ã&γ¡¥¦(°Ŗ´ŗ
org.jboss.seam.core.resourceLoader
*m [ YC YY[
`[
ş
ő m e m C `[ m _m
m `[ €e[ messages
resourceLoader.bundleNames
org.jboss.seam.international.localeSelector
cdÎçŖœŽHNM‡Î&78&°Ŵòº%K3ǚǛR¯Ŗ´ŗ
ş
select()
ő ƓdñòœK3ǚǛ¯Ŗ´ŗ
ş
localeSelector.locale
ş
localeSelector.localeString
ş
localeSelector.language
ş
localeSelector.country
ő ƓdK3&ĘÒ%´ŗ
ş
localeSelector.variant
ő ƓdK3&˜%´ŗ
ş
localeSelector.supportedLocales
ő 'ę& java.util.Locale %´ŗ
ő K3&Ġ„dzĚǹ%´ŗ
ő ƓdK3&Ə˛%´ŗ
ő
jsf-config.xml
qwxĚzñò¬RK3Ě¯2°¬ SelectItem &wx%´ŗ
ş
localeSelector.cookieEnabled
ő GFÃ%¸jñò¬ƚÞK3ǚǛƓd¯Ŗ´ŗ
org.jboss.seam.international.timezoneSelector
cdÎçŖœŽHNM‡Î&78&°Ŵòº%NM‡ěǚǛR¯Ŗ´ŗ
ş
select()
ő ƓdñòœK3ǚǛ¯Ŗ´ŗ
ş
timezoneSelector.timezone
ş
timezoneSelector.timeZoneId
ş
timezoneSelector.cookieEnabled
ő 'ę& java.util.TimeZone %´ŗ
ő NM‡ě&Ġ„dzĚǹ%´ŗ
ő
GFÃ%¸jñò¬ƚÞNM‡ěǚǛƓd¯Ŗ´ŗ
org.jboss.seam.international.messages
# Y J [č J e J Y[ e m `[
org.jboss.seam.theme.themeSelector
cdÎçŖœŽHNM‡Î&78&°Ŵòº%,¤ǚǛR¯Ŗ´ŗ
ş
select()
ő Ɠdñòœ,¤ǚǛ¯Ŗ´ŗ
ş
theme.availableThemes
ş
themeSelector.theme
©C©
ő dÓñòœ,¤&wx%´ŗ
ő ǚǛñòœ,¤%´ŗ
+Q)
×ØÙØ ;RS
ş
themeSelector.themes
ő dÓñòœ,¤z¯2°¬ SelectItem &wx%´ŗ
ş
themeSelector.cookieEnabled
ő GFÃ%¸jñò¬ƚÞ,¤ǚǛƓd¯Ŗ´ŗ
org.jboss.seam.theme.theme
,¤?ġŻ%°¬¤F%´ŗ
org.jboss.seam.theme.theme
# Y J m Œò»;RSŽ´ƚ2ļM-ñòŖ´ŗ
2iS ‘'þÿ±©š8.B%TU%
ŧ&;RS™š"}345ŖœŽ78MNOP-«û“
”&Ăă("Œ}s%Þ¬«"vûŖ´ŗ
org.jboss.seam.core.conversation
ǹǰ& “”&ƙĬ345Ăă´¬œ1& #~ %´ŗ
ş
getId()
ő ǹǰ&“” € ĺ¯Ŗ´ŗ
ş
isNested()
ş
isLongRunning()
ş
getId()
ş
getParentId()
ş
getRootId()
ş
setTimeout(int timeout)
ş
setViewId(String outcome)
ş
setDescription(String
ş
redirect()
ő ǹǰ&“”sS-ñò¬ŷĆ ĺ¯Ŗ´ŗ
ő ǹǰ&“”sɐĈ&“”&ŷĆ ĺ¯Ŗ´ŗ
ő ǹǰ&“” € ĺ¯Ŗ´ŗ
ő ˺“”&“” € ĺ¯Ŗ´ŗ
ő “”&“” € ĺ¯Ŗ´ŗ
ő ǹǰ&“”&NM‡œcd¯Ŗ´ŗ
ő C _
mn C [n `
`
&°Ŵòºº»ǹǰ&“”úûüý¬ŷƐš£ñò¬l € cd¯Ŗ´ŗ
ő C _
mn C [n
ŖœŽ `
` %Ězñò¬ǹǰ&“”&Ȩãcd¯Ŗ´ŗ
ÆK™M
description)
ő
Œ&“”“¯2ȨãdÓñòœšŶ&lĕMDG¯Ŗ´
(ŶưĮÇŗ
ş
leave()
ő 'ꐓ”Ąą´¬Œ}vţn Œ&“”&-;Ąą¯Ŗ´ŗ
ş
begin()
ő ɐĈ&“”ôª¯Ŗ´ Æ@Begin }ÍɰÇŗ
ş
beginPageflow(String
pageflowName)
ő
‚OKÝÞ&ɐĈ&“”ôª¯Ŗ´
Æ@Begin(pageflow="...") }ÍɰÇŗ
ş
end()
ő ɐĈ&“”Ąą¯Ŗ´ Æ@End }ÍɰÇŗ
©C©
+Q+
×ØÙØ ;RS
ş
pop()
ő ˺“”þû“”-NFGRF¯Ŗ´ŗ
ş
root()
ş
changeFlushMode(FlushModeType flushMode)
ő “”-NFG& “”þûŖ´ŗ
ő “”&OHF4Å<Èĸ¯Ŗ´ŗ
org.jboss.seam.core.conversationList
“”wx&•=;RS%´ŗ
org.jboss.seam.core.conversationStack
“”-NFG&•=;RS%´ Æ`
`Çŗ
org.jboss.seam.faces.switcher
C _
m %´ŗ
Œò»;RSŽ´ƚ2ļM-ñòŖ´ŗ
2i[ xyz Ŋŋ.B%TU%
B~| }Ŋ£´¬;RSvûŖ´ŗ
org.jboss.seam.pageflow.pageflow
‚OK& #~ Ăă%´ŗ
ş
isInProcess()
ő ǹǰKE-‚OKsµ¬ŷƐ true ĺ¯Ŗ´ŗ
ş
getProcessInstance()
ş
begin(String pageflowName)
ş
reposition(String nodeName)
ő ǹǰ&‚OK“¯2 B~| ProcessInstance ĺ¯Ŗ´ŗ
ő ǹǰ&“”&;,Ã-%‚OKôª¯Ŗ´ŗ
ő ǹǰ&‚OKĞd&ï<ƲTǞ¯Ŗ´ŗ
org.jboss.seam.core.actor
ǹǰ&EF45ŋ´¬ B~| &ƙĬ345Ăă´¬œ1& #~ %´ŗ
ş
setId(String actorId)
ş
getGroupActorIds()
ő ǹǰ&78& B~| GN € EF¯Ŗ´ŗ
ő ǣǤñò¬tuĬ&µ¬ǹǰ&78&™“´¬
 Set ĺ¯Ŗ´ŗ
B~|
org.jboss.seam.bpm.actor
#~ e YY[
[ e ` e m B~| _m m f
ş
setId(String actorId)
ş
getGroupActorIds()
ő m B~| e m ő Set _m
m B~| e m JY à ` org.jboss.seam.bpm.transition
©C©
+QQ
×ØÙØ ;RS
#~ e YY[
[ e m B~| e m ö
ş
ő m B~| ` _m m
ö C @EndTask
setName(String transitionName)
org.jboss.seam.bpm.businessProcess
#~ e YJ
[ e m `_ m C `
Y
ş
businessProcess.taskId
ő m e m ö _m m Cf
ş
businessProcess.processId
ő m e m Y
_m m f
C
ş
businessProcess.hasCurrentTask()
ő ö _m m Cć
ş
businessProcess.hasCurrentProcess()
ő Y
_m m f
C
ş
createProcess(String name)
ő e m Y
e _m m C
ş
startTask()
ş
endTask(String transitionName)
ő m ö _m m C
ő m ö _m m Cf
ş
resumeTask(Long id)
ő m ö _m m JC _m m Cf
ş
resumeProcess(Long id)
ő m Y
_m m JC _m m C
ş
transition(String transitionName)
ő JJ m org.jboss.seam.bpm.taskInstance
|J Y e m B~| TaskInstance
org.jboss.seam.bpm.processInstance
|J Y e m B~| ProcessInstance
org.jboss.seam.bpm.jbpmContext
|J Y e Cf
Y JbpmContext
org.jboss.seam.bpm.taskInstanceList
|J Y e m B~| ö [
org.jboss.seam.bpm.pooledTaskInstanceList
|J Y e m B~| Y[ ö [
org.jboss.seam.bpm.taskInstanceListForType
©C©
+Q\
×ØÙØ ;RS
|J Y e m B~| ö [
org.jboss.seam.bpm.pooledTask
#
m[ e Y[ ö J
org.jboss.seam.bpm.processInstanceFinder
|J e m Y
ö [
org.jboss.seam.bpm.processInstanceList
*m Y
ö [
#[[ e m Y [[ _mC m Y org.jboss.seam.bpm.jbpm [[
2i^ IÀ!3GŊŋ.B%TU%
Œò»&;RSŽœP–Dž&EÃ,@ŋŌ¯2°Ŗ´ŗ
org.jboss.seam.web.userPrincipal
ǹǰ&78 Principal &•=;RS%´ŗ
org.jboss.seam.core.isUserInRole
ǹǰ&
Y
Y[
sš£%Þ¬Kż2n
b
‚s;K&Dĕ™ǚǛ%Þ¬«"¯Ŗ´ŗ
<h:commandButton
value="edit" rendered="#{isUserInRole['admin']}"/>
2ib z Ŋŋ.B%TU%
Œò»&;RSŽ•=“ʎ&
}&Ŋ£ƉŠ}¯2°Ŗ´ ÆŜVȺȻÇŗ
TopicPublisher
ë«ì
QueueSender
org.jboss.seam.jms.queueSession
| QueueSession &•=;RS%´ŗ
org.jboss.seam.jms.topicSession
| TopicSession &•=;RS%´ŗ
2ic ¿#Ŋŋ.B%TU%
& ^[ R}Ŋ£¯2š£ñò¬;RS%´ŗ
org.jboss.seam.mail.mailSession
|J Y e C|[ Session *m ` m [ö Y m
ù€ Z Æ`à J m sessionJndiName YYàÇ e m f
eJ Y _m
m m host à
©C©
+Qa
×ØÙØ ;RS
ş
org.jboss.seam.mail.mailSession.host
ő š£´¬ |*~ ˜&‹-Ò%´ŗ
ş
org.jboss.seam.mail.mailSession.port
ő š£´¬ |*~ ˜&R%´ŗ
ş
org.jboss.seam.mail.mailSession.username
ő
|*~
ő
|*~
˜ǵ&Ƥjš£´¬78Ò%´ŗ
ş
org.jboss.seam.mail.mailSession.password
˜ǵ&Ƥjš£´¬â-ð<%´ŗ
ş
ő
org.jboss.seam.mail.mailSession.debug
C|[
&—˜F™íŖ´
ÆīļɏɐÇŗ
ş
org.jboss.seam.mail.mailSession.ssl
ő `[ |*~ Æ_[[ e[ Y Qa\Ç
org.jboss.seam.mail.mailSession.tls
ő `à e[ ņ `[ * YY m
[ ş
ő
_m
m
BCZ[ ` ù€ e YY[ņ [[ m YY _[[ ` Jf
org.jboss.seam.mail.mailSession.sessionJndiName
2if ěŌwq©B%TU%
*m Y YC [ Y[e e
Ő [[ Y
_m
m ė [[ `à e[ `à J install="true" m Y components.xml
org.jboss.seam.core.init
&0Ĉäcd%´ŗ ļM-ñòŖ´ŗ
ş
org.jboss.seam.core.init.jndiPattern
ő
EF45l&FGFš£ñò¬
ù€ âN%´ŗ
ş
org.jboss.seam.core.init.debug
ő —˜F™Å<íŖ´ŗ
ş
org.jboss.seam.core.init.clientSideConversations
ő
true
EF´¬}n
Ž“”;,Ã-&ȃ
qƀ¸ĿŴGHMqƀ¸´¬«"vûŖ´ŗ
ş
ő
*#
Ċ–‚PGFGF´¬ŷƐš£´¬ ù€ Ò%´ŗ
org.jboss.seam.core.init.userTransactionName
HttpSession
UserTransaction
org.jboss.seam.core.manager
‚ë«ì“”;,Ã-•=£&qĥ;RS%´ŗ
ļM-ñòŖ´ŗ
ş
org.jboss.seam.core.manager.conversationTimeout
©C©
ő
+Qg
×ØÙØ ;RS
“”;,Ã-&ĴΙſÌ&NM‡œ%´ŗ
ş
ɐĈ&“”;,Ã-%KFG&IJǁ
ş
(´¬-DF<“´¬šǕȏķÎç%´ŗ
org.jboss.seam.core.manager.conversationIdParameter
&ʋʌš£ñò¬G?-âHÂN%n
cdñòŖ´ŗ
ş
ő
org.jboss.seam.core.manager.concurrentRequestTimeout
ő
—O¶%Ž
“”
€
conversationId
ő
org.jboss.seam.core.manager.conversationIsLongRunningParameter
“”sɐĈ%µ¬ºŠ"ºŋ´¬ȟȠʋʌ´¬œ1š£ñò¬G?-âHÂN
%n —O¶%Ž conversationIsLongRunning cdñòŖ´ŗ
org.jboss.seam.navigation.pages
[ Y e _öY
J #[_à [[
ş
org.jboss.seam.navigation.pages.noConversationViewId
ő J[`[ J e m C_ _m C à e m C ş
org.jboss.seam.navigation.pages.loginViewId
ş
org.jboss.seam.navigation.pages.httpPort
ő J[`[ J e m C_ f
_m m
Y
C_
ő J[`[ J e m Y _m
m mY m Ė
ş
org.jboss.seam.navigation.pages.httpsPort
ő J[`[ J e m Y _m
m mY m Ė
ş
e pages.xml à[ €e[ WEB-INF/pages.xml
org.jboss.seam.navigation.pages.resources
ő
[
m
e
org.jboss.seam.bpm.jbpm
Y JbpmConfiguration [[ [ org.jboss.seam.bpm.Jbpm
ş
org.jboss.seam.bpm.jbpm.processDefinitions
ő [ e e B~€ e[
` e m e ` Y
ş
org.jboss.seam.bpm.jbpm.pageflowDefinitions
ő [ e e B~€ e[
` e m e C YJ e[_
org.jboss.seam.core.conversationEntries
[ f
Y Y J m C [JfJ C
`_ Ė
org.jboss.seam.faces.facesPage
[ YJf
Y Y J m C Z _m YJ
org.jboss.seam.persistence.persistenceContexts
[ Y J m Y
Z _m
m _ m C
©C©
+Qh
×ØÙØ ;RS
org.jboss.seam.jms.queueConnection
|J | QueueConnection [[ _mC J J QueueSender f
[[
ş
org.jboss.seam.jms.queueConnection.queueConnectionFactoryJndiName
ő m ù€ e | QueueConnectionFactory €e[ UIL2ConnectionFactory
org.jboss.seam.jms.topicConnection
|J | TopicConnection [[ _mC J J TopicPublisher f
[[
ş
org.jboss.seam.jms.topicConnection.topicConnectionFactoryJndiName
ő m ù€ e | TopicConnectionFactory €e[ UIL2ConnectionFactory
org.jboss.seam.persistence.persistenceProvider
#`
[à e fč e e ~# YC
org.jboss.seam.core.validators
¢
m e ž` [ ClassValidator
org.jboss.seam.faces.validation
#[[_ m YY[
_mm C[ e[ _ e[
org.jboss.seam.debug.introspector
YY e m €`J ~J
org.jboss.seam.debug.contexts
YY e m €`J ~J
org.jboss.seam.exception.exceptions
[ Y e Z
Y m[J
org.jboss.seam.transaction.transaction
#~ e [[J `
J m [àJ J
Y[ `m *#f
Y`[ e
org.jboss.seam.faces.safeActions
€
e ZY J AI e *m `à m
öJ
m m ZY Z m C_
2ii z *m Y ė e org.jboss.seam.async.dispatcher
€Y
m [ ` e à
m m
org.jboss.seam.core.image
©C©
+Qk
×ØÙØ ;RS
J Y[ J
org.jboss.seam.core.pojoCache
|J Y e ~B¢
m org.jboss.seam.core.uiComponent
|J Y e A¢Y öà `à Y 2i ĝĞqB%TU%
Ğd&Ğğv
;RSGH-Ž
&TŜ%ԃʗ&M-stu%´ŗ
èýũn
;RS ) ÖM-¯2cd¯Ŗ´ŗ
cdq%Ɠdñò¬
components.xml
q&ŧ&(Ž
<component name="bookingDatabase"
class="org.jboss.seam.persistence.ManagedPersistenceContext">
<property name="persistenceUnitJndiName">java:/comp/emf/bookingPersistence</property>
</component>
<component name="userDatabase"
class="org.jboss.seam.persistence.ManagedPersistenceContext">
<property name="persistenceUnitJndiName">java:/comp/emf/userPersistence</property>
</component>
;RSҎ bookingDatabase } userDatabase %´ŗ
<entityManager>ņ org.jboss.seam.core.ManagedPersistenceContext
ȁȂij;,Ã-Õ֓”-;%•=“ʎ&
&•=;RS%´ŗ
ş
EntityManager
ő
&M-N-“¯2Ȣȣ("Ɯ˜M—@™%´ŗ
<entityManager>.entityManagerFactory
EntityManagerFactory
ő à J e
à & ù€ Ò%´ŗ
—O¶%Ž java:/<managedPersistenceContext> cd¯Ŗ´ŗ
<entityManager>.persistenceUnitJndiName
<entityManagerFactory>ņ org.jboss.seam.core.EntityManagerFactory
~#
EntityManagerFactory
•=¯Ŗ´ŗ
š£´¬ŷƐšǃ}vûŖ´ŗ
ş
entityManagerFactory.persistenceUnitName
^
+o
RʼnŇśé%
~#
ő ij7ŎFÒ%´ŗ
cdKâ,@&ȨãÖ°2Ž #~ C€
ȦxţŦñ°ŗ
<session>ņ org.jboss.seam.core.ManagedSession
“”-;%•=“ʎ& ž` Session &•=;RS%´ŗ
ş
ő
&M-N-“¯2Ȣȣ("Ɯ˜M—@™Ěǹ%´ŗ
<session>.sessionFactory
©C©
SessionFactory
+\o
×ØÙØ ;RS
ő e
à & ù€ Ò%´ŗ —O¶%Ž
cd¯Ŗ´ŗ
<session>.sessionFactoryJndiName
java:/<managedSession>
<sessionFactory>ņ org.jboss.seam.persistence.HibernateSessionFactory
ž` SessionFactory •=¯Ŗ´ŗ
ş
<sessionFactory>.cfgResourceName
ate.cfg.xml
ő cdOáMǵ&â-%´ŗ —O¶%Ž hibern-
cdñòŖ´ŗ
cdKâ,@&ȨãÖ°2Ž #~ C€
ȦxţŦñ°ŗ
<managedQueueSender>ņ org.jboss.seam.jms.ManagedQueueSender
M¹-;%•=“ʎ& | QueueSender &•=;RS%´ŗ
ş
<managedQueueSender>.queueJndiName
ő | Ã& ù€ Ò%´ŗ
<managedTopicPublisher>ņ org.jboss.seam.jms.ManagedTopicPublisher
M¹-;%•=“ʎ& | TopicPublisher &•=;RS%´ŗ
ş
<managedTopicPublisher>.topicJndiName
ő | ČFG& ù€ Ò%´ŗ
<managedWorkingMemory>ņ org.jboss.seam.drools.ManagedWorkingMemory
“”-;%•=“ʎ& €[ WorkingMemory &•=;RS%´ŗ
ş
<managedWorkingMemory>.ruleBase
ő
RuleBase
&M-N-“¯2Ȣȣ("ƜĚǹ%´ŗ
<ruleBase>ņ org.jboss.seam.drools.RuleBase
345-;&
€[
RuleBase
&•=;RS%´ŗ
®¯°&/ŠM-R¯2°v°œ1n
'ʯΟ%&š£ŽŖ›œţ“ʎ}ñò2°v°Œ}ơƬ¯2ţŦñ°ŗ
ş
<ruleBase>.ruleFiles
<ruleBase>.dslFile
ő €[ &ġŻ%°¬OáM&wx%´ŗ
ő €[ € dÓ%´ŗ
<entityHome>ņ org.jboss.seam.framework.EntityHome
<hibernateEntityHome>ņ org.jboss.seam.framework.HibernateEntityHome
<entityQuery>ņ org.jboss.seam.framework.EntityQuery
<hibernateEntityQuery>ņ org.jboss.seam.framework.HibernateEntityQuery
©C©
+\
2 _ B%
M#
Ž %&pؐưĮv b ;Ks°ţÖºġŖò2°Ŗ´ŗ ×ØÙØ& b
;K&ķuǴŸ}ĩ&<â,@&HM–Hº»&•=ƉŠ}¯2°Ŗ´ŗ }Ŋ£´¬ęŽn
I
mb
n#Y
m
|àb
*
N™HM–H&š£ʰʱ¯Ŗ´ŗ *m_ö N™HM–H&š£Žëδ1%ÞŖĿŻŗ
2 P—
Œò»&;Kš£´¬Žn
S‡--dÓ¯Ŗ´ Æe
[ ǫíÇŗ
śŜ&«"š£´¬‚%
ŸsŸ
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib">
Œ& A %Ž°ţÖº&N™&š£z¯2°Ŗ´ŗ
*`[ + b ;KOáD-
<s:button>
Ȩã
“”ʋʌ&çn;K«ûG45ƭìƗ¯R´¬
ÿN O¶‡–ĴF¯ŖĿŻŗ
ƙĬ
ş
value
ő H¹
ş
action
ş
view
ş
fragment
ő G¯2°¬OH™Â €
ş
disabled
ő Gsȳî ć
ş
propagation
ő dÓñòœG45-ꐘM<¯œÂÚF<
ő G¯2°¬ b C_ ő “”&ʋʌē¿&Ɠd 6 beginnjoinn nestnnone
Ŗœ end
ş
ő ôª´¬‚OKdÓ Æpropagation="begin" Ŗœ
propagation="join" &ŷĆ&ØíîÇ
pageflow
š£ēĔ
<s:button id="cancel" value="Cancel"
action="#{hotelBooking.cancel}"/>
Žn
view
}
action
sƓdtu%´ŗ
Œ&ŷĆnƓdñòœlǵ&ĕMDGsǶ²´¬}G45
sƭũòŖ´ŗ
<s:link
©C©
/>
+\)
b ;K
<s:cache>
Ȩã
¢
m
š£¯2‚OH™ÂDĕ™¯œÃĭF4
'ꐎn<s:cache>
Žn×ØÙØ
pojoCache
;RS«›2•=ñòœ
¢
m
&M-N-š£¯2°¬Œ}ƮƬ¯2ţŦñ°ŗ
ƙĬ
ş
key
ő m öà m ņ e C[ ZYf
b ZY[ņ e _ _ mJ YJ eJ m
Y[à
ņ
_
Jm
key="Document-#{document.id}"
ş
enabled
ş
region
ő C[ ZY m e m m
m[ ` ő ¢
m Æee mC
ee ZYà Y[
Ç
š£ēĔ
<s:cache key="entry-#{blogEntry.id}" region="pageFragments">
<div class="blogEntry">
<h3>#{blogEntry.title}</h3>
<div>
<s:formattedText value="#{blogEntry.body}"/>
</div>
<p>
[Posted on&#160;
<h:outputText value="#{blogEntry.date}">
<f:convertDateTime timezone="#{blog.timeZone}" locale="#{blog.locale}"
type="both"/>
</h:outputText>]
</p>
</div>
</s:cache>
<s:conversationId>
Ȩã
b Gµ¬°ŽÿN“” € ǣǤ¯Ŗ´ Æ è <h:commandLink
/>n<s:button />Çŗ
ƙĬ
v¯
<s:conversationPropag
Ȩã
ation>
;¤<Gµ¬°ŽÿN Æ µ¬°Žnb ;K&ˏ Ç
&œ1“”&ʋʌL-N¤Mƛ¯Ŗ´ŗ b
[ &Øíî%´ŗ
ƙĬ
©C©
+\+
b ;K
ş
type
ő “”&ʋʌē¿&Ɠd 6 beginnjoinn nestnnone Ŗœ end
ş
pageflow
ő ôª´¬‚dÓ Æpropagation="begin" Ŗœ propagation="join" &ŷĆ&ØíîÇ
š£ēĔ
<h:commandButton value="Apply" action="#{personHome.update}">
<s:conversationPropagation type="join" />
</h:commandButton>
<s:convertDateTime>
Ȩã
NM‡ě%&ĵÝnÎç&Èʺ(°Ŗ´ŗ
ƙĬ
v¯
š£ēĔ
<h:outputText value="#{item.orderDate}">
<s:convertDateTime type="both" dateStyle="full"/>
</h:outputText>
<s:convertEntity>
Ȩã
?,@,@Èʺǹǰ&;RSĉû…2Ŗ´ŗ
ŒòŽƠH‚ĊÿN}<KFĕœ;Kí£%´ŗ
Œ&ÈʺŽ @Id ï,45sÝ°œ•=?,@,@ Æ Y[
%Ŕ;R‚F%Ŕ Ç %/p¯Ŗ´ŗ
ƙĬ
v¯
cd
<s:convertEntity />
}ƹ •=H8G45 Æććć ȺȻ Ç
&š£sŲų%´ŗ
e à |J ~
¢Z ė [[ entityManagerņ
m à YZ[6
<component name="org.jboss.seam.ui.EntityConverter">
<property name="entityManager">#{em}</property>
</component>
e à J |J ž` m à YZ[6
<component name="org.jboss.seam.ui.EntityConverter">
<property name="session">#{hibernateSession}</property>
</component>
©C©
+\Q
b ;K
e à _ m à J _m m à
Cņ à Yà e m à C e m
à J YZ[6
<component name="myEntityConverter" class="org.jboss.seam.ui.converter.EntityC
<property name="entityManager">#{em}</property>
</component>
<h:selectOneMenu value="#{person.continent}">
<s:selectItems value="#{continents.resultList}" var="continent"
label="#{continent.name}" />
<f:converter converterId="myEntityConverter" />
</h:selectOneMenu>
š£ēĔ
<h:selectOneMenu value="#{person.continent}" required="true">
<s:selectItems value="#{continents.resultList}" var="continent"
label="#{continent.name}"
noSelectionLabel="Please Select..."/>
<s:convertEntity />
</h:selectOneMenu>
<s:convertEnum>
Ȩã
Èʺǹǰ&;RSĉûÝŨŖ´ŗ
ŒòŽƠH‚ĊÿNĝ<KFĕœ;K%í£%´ŗ
ƙĬ
v¯
š£ēĔ
<h:selectOneMenu value="#{person.honorific}">
<s:selectItems value="#{honorifics}" var="honorific"
label="#{honorific.label}"
noSelectionLabel="Please select" />
<s:convertEnum />
</h:selectOneMenu>
<s:decorate>
Ȩã
˜—45s̺̻ŖœŽ required="true" scdñòœ}Þn b
ŪūO@<ŸƊ˸ ƀ
Ç Ÿ¯Ŗ´ŗ
ƙĬ
ş
ő
,D
template
;RSƊ˸´¬œ1š£´¬
e
[
#{required} C[`[ s:decorate̽
#{required} C[ true e à mC m Y Y
`J Ėņ #{invalid} C[ true e C[ #{invalid}
©C©
+\\
b ;K
š£ēĔ
<s:decorate template="edit.xhtml">
<ui:define name="label">Country:</ui:define>
<h:inputText value="#{location.country}" required="true"/>
</s:decorate>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib">
<div>
<s:label styleClass="#{invalid?'error':''}">
<ui:insert name="label"/>
<s:span styleClass="required" rendered="#{required}">*</s:span>
</s:label>
<span class="#{invalid?'error':''}">
<s:validateAll>
<ui:insert/>
</s:validateAll>
</span>
<s:message styleClass="error"/>
</div>
</ui:composition>
<s:defaultAction>
Ȩã
Y
eà m e[ _m m e ` f
J m öà
¢[à
à
[à ` ÆJ
<h:commandButton />ņ <a:commandButton /> <tr:commandButton />Ç
Ő Y
eà m Ő [à mC
e[ Y e
ƙĬ
v¯
š£ēĔ
<h:commandButton id="foo" value="Foo" action="#{manager.foo}">
<s:defaultAction />
</h:commandButton>
<s:div>
Ȩã
ž*| <div> Dĕ™¯Ŗ´ŗ
ƙĬ
©C©
+\a
b ;K
v¯
š£ēĔ
<s:div rendered="#{selectedMember == null}">
Sorry, but this member does not exist.
</s:div>
<s:enumItem>
Ȩã
Ɯº» SelectItem ²³¯Ŗ´ŗ
ƙĬ
ş
enumValue
ş
label
ő Ɯ& J Ěǹ
ő m [`[ ` _m J m SelectItem
š£ēĔ
<h:selectOneRadio id="radioList"
layout="lineDirection"
value="#{newPayment.paymentFrequency}">
<s:convertEnum />
<s:enumItem enumValue="ONCE" label="Only Once" />
<s:enumItem enumValue="EVERY_MINUTE" label="Every Minute" />
<s:enumItem enumValue="HOURLY"
label="Every Hour" />
<s:enumItem enumValue="DAILY"
label="Every Day" />
<s:enumItem enumValue="WEEKLY"
label="Every Week" />
</h:selectOneRadio>
<s:fileUpload>
Ȩã
OáMFK<;KDĕ™¯Ŗ´ŗ
Œ&;KŽ?;—@™NM
multipart/form-data
&O¶‡%š£ñòvŨòũvûŖĿŻŗ
<h:form enctype="multipart/form-data">
b [Y Ėņ m |[Y C[ e[ [ ` eJ web.xml6
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Ȩã
*m e[[_J eJ Y e [Y Ė à `
eJ YZ[6
©C©
+\g
b ;K
ş
createTempFiles
ő e m Y ņ Y[ e[
Yà e[ e à
ş
maxRequestSize
ő m Z č e e[ Y[ Ėņ `à
žė ZY[6
<component class="org.jboss.seam.web.MultipartFilter">
<property name="createTempFiles">true</property>
<property name="maxRequestSize">1000000</property>
</component>
ƙĬ
ş
data
ő m C[ `J C m `à e[ *m
CJ e[ m[ ` [ byte[] InputStream
ÆĖÇ
ş
contentType
ş
fileName
ş
fileSize
ş
accept
ş
style
ş
styleClass
ő m C[ `J C m e[ė àY ÆY[Ç
ő m C[ `J C m e[ ÆY[Ç
ő
ÆY[Ç
m
C[
`J
C
m
e[
č
ő fY [ e àY Yņ à
` YY `à m `_ ^J "images/png,images/jpg"ņ
"images/*"
ő *m [ė à[
ő *m [ė à[ [
š£ēĔ
<s:fileUpload id="picture" data="#{register.picture}"
accept="image/png"
contentType="#{register.pictureContentType}" />
<s:formattedText>
Ȩã
Y *Zņ m Z öY e[ e `[Jņ _ö m YY[
m Jm m Z m *Z
mY e e[[ J
ƙĬ
ş
©C©
ő ^ ZY Y
eàJ m m Z öY value
+\h
b ;K
š£ēĔ
<s:formattedText value="#{blog.text}"/>
^ZY[
<s:fragment>
Ȩã
# fJ Y e[ e `[J½`[J J
e ė m[
ƙĬ
v¯
š£ēĔ
<s:fragment rendered="#{auction.highBidder ne null}">
Current bid:
</s:fragment>
<s:graphicImage>
Ȩã
# Z <h:graphicImage> m [[_ m J ` ¢Y̽ em e ` YY[ m f
J
#[[ ` e <h:graphicImage> YYņ _[[ 6
ƙĬ
ş
©C©
ő J Y[à ¢ ` Ym String Æ[ e m
[YmÇņ byte[]ņ java.io.Fileņ java.io.InputStream java.net.URL ¢[à YY J e image/pngņ
value
+\k
b ;K
image/jpeg
ş
image/gif
ő e Y
e m C J _[[ mC Jf
e[ e à _ à e[ņ à m[ Yf
eà m *m m[ ` Ė
fileName
*e
* YY[à e m Jņ à _[ J Y
eàf
J m e YY[à [à YY m f
e6
<s:transformImageSize>
ş
width
ő _ _m e m J
ş
height
ş
maintainRatio
ş
factor
ő _ mJm e m J
ő e trueņ e width½height Yf
eņ m J _[[ ` č _m m Y
e `J [
[ m Y
ő [ m J `à m JC e
<s:transformImageBlur>
ş
radius
ő Ye C[ `[ _m m JC <s:transformImageType>
ş
contentType
jpeg
ő [ m àY e m J m image/
image/png
ė à à _ e f UIComponent
_m
m implements org.jboss.seam.ui.graphicImage.ImageTransform f
m applyTransform()m image.getBufferedImage() J
m J[ J image.setBufferedImage() à f
e J *e YY[ m Y
e m C_
š£ēĔ
<s:graphicImage rendered="#{auction.image ne null}"
value="#{auction.image.data}">
<s:transformImageSize width="200" maintainRatio="true"/>
</s:graphicImage>
<s:label>
Ȩã
Ÿ€
Ÿ b Y e[ _m m [`[ *m [`[ Y[
©C©
+ao
b ;K
m ž*| <label> Jņ _m m b Y Y e _m <s:decorate>
ƙĬ
ş
style
ő *m [ė à[
ş
styleClass
ő *m [ė à[ [
š£ēĔ
<s:label styleClass="label">
Country:
</s:label>
<h:inputText value="#{location.country}" required="true"/>
<s:link>
Ȩã
# [ö m YY C
e _m [ C
C YYJ € ` m e
ƙĬ
ş
value
ő m [`[
ş
action
ş
view
ş
fragment
ő m eJ e [ö ş
disabled
ő m [ö `[ć
ş
propagation
ş
pageflow
ő m `J m Y
e m [
ő m b C_ [ö ő m C YYJ à[6
beginņ joinņ nestņ none end
ő YJe[_ e `J Æ*m [à e[
_m propagation="begin" propagation="join"Ç
š£ēĔ
<s:link id="register" view="/register.xhtml"
value="Register New User"/>
Ő Y
eà `m view action <s:link /> m ņ
m _[[ ` [[ m m Y
e C_
m <s:message>
Ȩã
Ÿ€
Ÿ b Y e[ _m m C[ J
ƙĬ
©C©
+a
b ;K
v¯
š£ēĔ
<f:facet name="afterInvalidField">
<s:span>
&#160;Error:&#160;
<s:message/>
</s:span>
</f:facet>
<s:remote>
Ȩã
ó m C
Y ` Ė IJ
ƙĬ
ş
ő fY [ e m Y Æ
e[[à Ė[e [ Ç e _m
m J If
J C
Y ` ¢mY )ņ IJ e f
[
include
š£ēĔ
<s:remote include="customerAction,accountAction,com.acme.MyBean"/>
<s:selectDate>
Ȩã
€Y
A <rich:calendar /> €Y[à à
Y
ö Y m [
e
m Y
e Y e[ *m `à e m selectDate [
m[ ž*| [ņ m Z Jņ m
YY m [
ö Y[à m Y
ö *m Y
ö ` à[ J ¢ # ZY[ ¢ e[ ` e
m `öJ date.cssņ ` J J
fJ *m ¢ à[ [ m YY
e m
Y
ö [ ` `[_
ƙĬ
ş
for
ő *m e m Y e[ m m Y
ö _[[ f
m [
ş
dateFormat
ş
startYear
ő *m e J *m m[ m m e e m Y e[
ő *m YYY à [
J _[[ m
à
ş
©C©
endYear
ő *m YYY à [
J _[[ m à
+a)
b ;K
ş
ő ¢[ _m
m à m e à e m
_ö Æo ̾ àņ a ̾ àÇ e m ` ņ
m m e à e m _ö _[[ e[ ` m
ė [
[
firstDayOfWeek
š£ēĔ
<div class="row">
<h:outputLabel for="dob">Date of birth<em>*</em></h:outputLabel>
<h:inputText id="dob" value="#{user.dob}" required="true">
<s:convertDateTime pattern="MM/dd/yyyy"/>
</h:inputText>
<s:selectDate for="dob" startYear="1910" endYear="2007">
<img src="img/datepicker.png"/>
</s:selectDate>
<div class="validationError"><h:message for="dob"/></div>
</div>
^ZY[
¢ à[J
*m e[[_J [ ` m ¢ [ m [ m à[ e m [
€ [
©C©
ş
seam-date
ő *m [ YY[ m div J
m YYY [ ÆÇ [ YY[ m table m
[ m [à e m [ Æ)Ç
ş
seam-date-header
ş
seam-date-header-prevMonth
ő *m [ YY[ m [ m
`[ _ ÆtrÇ m `[ [[ ÆtdÇ Æ+Ç
ő *m [ YY[ m ŸYf
C mŸ `[ [[ņ ÆtdÇņ _m
m _m [
ö m
[ Y[à m m Y m [à f
Y[à ÆQÇ
+a+
b ;K
©C©
ş
seam-date-header-nextMonth
ő *m [ YY[ m ŸZ
mŸ `[ [[ņ ÆtdÇņ _m
m _m [
ö m [f
Y[à m m e[[_J m [à f
Y[à Æ\Ç
ş
seam-date-headerDays
ş
seam-date-footer
ş
seam-date-inMonth
ş
seam-date-outMonth
ş
seam-date-selected
ş
seam-date-dayOff-inMonth
ş
seam-date-dayOff-outMonth
ş
seam-date-hover
ş
seam-date-monthNames
ş
seam-date-monthNameLink
ş
seam-date-years
ş
seam-date-yearLink
ő *m [ YY[ m [
à m _ ÆtrÇņ _m
m m e m _ö
à ÆaÇ
ő *m [ YY[ m [ e
_ ÆtrÇņ _m
m Y[à m ÆgÇ
ő *m [ YY[ m `[ [[
ÆtdÇ [ m _m m m [à
Y[à ÆhÇ
ő *m [ YY[ m `[ [[
ÆtdÇ [ m e m m f
[à Y[à ÆkÇ
ő *m [ YY[ m `[ [[
ÆtdÇ [ m m [à [
ÆoÇ
ő *m [ YY[ m `[
[[ ÆtdÇ [ m Ÿà eeŸ Æ _ö
àņ à àÇ _m m [à [
m ÆÇ
ő *m [ YY[ m `[
[[ ÆtdÇ [ m Ÿà eeŸ Æ _ö
àņ à àÇ e m [à [
m Æ)Ç
ő *m [ YY[ m `[ [[ ÆtdÇ
[ C _m
m m mCJ Æ+Ç
ő *m [ YY[ m div [
m m YYY m [
ÆQÇ
ő *m [ YY[ m m
ÆaÇ [ m m YYY m Æ\Ç
ő *m [ YY[ m div [ m
m YYY à [
ÆaÇ
ő *m [ YY[ m m ÆaÇ
[ m m YYY à Æ\Ç
+aQ
b ;K
<s:selectItems>
Ȩã
¢ List<SelectItem> e ņ ņ €|[ #à
ƙĬ
ş
value
ő ^ ZY Y
eàJ m m `
ö m
List<SelectItem>
ş
var
ő e m e m [
[ C`[ m m[ m
`B
J ş
label
ş
itemValue
ş
disabled
ş
noSelectionLabel
ş
hideNoSelectionLabel
ő m [`[ ` _m J m SelectItem ¢
e
m var C`[
ő [ m C e m Y f
[
Y[ņ `à e[ m var `B
¢ ef
m var C`[
ő e m SelectItem _[[ ` `[
¢ e
m var C`[
ő Y
e m ÆY[Ç [`[ Y[
m Y e [ Æe required="true" [ Y
e m f
[
J m C[ _[[ C[ Ç
ő e ņ m noSelectionLabel _[[ `
m _m C[ [
š£ēĔ
<h:selectOneMenu value="#{person.age}"
converter="ageConverter">
<s:selectItems value="#{ages}" var="age" label="#{age}" />
</h:selectOneMenu>
<s:span>
Ȩã
I ž*| <span>
ƙĬ
v¯
©C©
+a\
b ;K
š£ēĔ
<s:span styleClass="required" rendered="#{required}">*</s:span>
<s:taskId>
Ȩã
# m ö Y [ö Æ [ b [Çņ _m
m ö C[`[ C #{task}
ƙĬ
v¯
<s:validate>
Ȩã
# fC[ [ņ C[ b Y e[ J m
` YYà J ž` [
ƙĬ
v¯
š£ēĔ
<h:inputText id="userName" required="true"
value="#{customer.userName}">
<s:validate />
</h:inputText>
<h:message for="userName" styleClass="error" />
<s:validateAll>
Ȩã
# fC[ [ņ C[ [[ m[ b Y e[
J m ` YY J ž` [
ƙĬ
v¯
š£ēĔ
<s:validateAll>
<div class="entry">
<h:outputLabel for="username">Username:</h:outputLabel>
<h:inputText id="username" value="#{user.username}"
required="true"/>
<h:message for="username" styleClass="error" />
</div>
<div class="entry">
<h:outputLabel for="password">Password:</h:outputLabel>
<h:inputSecret id="password" value="#{user.password}"
required="true"/>
<h:message for="password" styleClass="error" />
</div>
<div class="entry">
<h:outputLabel for="verify">Verify Password:</h:outputLabel>
<h:inputSecret id="verify" value="#{register.verify}"
required="true"/>
©C©
+aa
b ;K
<h:message for="verify" styleClass="error" />
</div>
</s:validateAll>
<s:validateFormattedT
€
Y
ext>
¢m
ö m m ` C[ C[ *Z
#`
v¯
21 "î3;<%
[ YC [[_ à Y b C C[6
@Converter
@Name("itemConverter")
@BypassInterceptors
@Converter
public class ItemConverter implements Converter {
@Transactional
public Object getAsObject(FacesContext context, UIComponent cmp, String value) {
EntityManager entityManager = (EntityManager) Component.getInstance("entityManager");
entityManager.joinTransaction();
// Do the conversion
}
public String getAsString(FacesContext context, UIComponent cmp, Object value) {
// Do the conversion
}
}
<h:inputText value="#{shop.item}" converter="itemConverter" />
IJ m Y b C m_ m C _m
m `[ m ~# ^à|J *# ņ _m CJ m
C[ `
ö ė `B
Y
@Validator
@Name("itemValidator")
@BypassInterceptors
@Validator
public class ItemValidator implements Validator {
public void validate(FacesContext context, UIComponent cmp, Object value)
throws ValidatorException {
ItemController ItemController = (ItemController) Component.getInstance("itemController");
return itemController.validate(value);
}
}
©C©
+ag
b ;K
<h:inputText value="#{shop.item}" validator="itemValidator" />
IJ m Y b C[ m_ m C[ _m
m f
B
m Y̽ m B
Y C[ m C[
©C©
+ah
21 ]Ÿ
^ _m
m YC Z m Ae ^ZY f
JJ Æ^ Ç ^ YC ` e m
m m ZYC
Y_ e ^ ZY
21 yĊ ]Ä
^ [[_ à m _m e Y ő e ņ
b [ m ÆJ valueChangeListenerÇ ö Y YC `à b
^ C m b ZY[6
<h:commandButton action="#{hotelBooking.bookHotel(hotel)}" value="Book Hotel"/>
@Name("hotelBooking")
public class HotelBooking {
public String bookHotel(Hotel hotel) {
// Book the hotel
}
}
21 ˜¡Đđ
[[ m e Cņ Y `à Ymņ Yf
`à 6
<h:commandButton action="#{hotelBooking.bookHotel(hotel, user)}" value="Book Hotel"/>
$V&è%ŽâHÂNnhotel } user sƜ¿}¯2Ȣȣñòn ;RS&bookHotel()
țñòŖ´ŗ
âHÂNŽnŜ&«"nŠ&«"vƜ¿Ŕš"ɁsƗƦŖ´ŗ
<h:commandButton
action="#{hotelBooking.bookHotel(hotel.id, user.username)}"
value="Book Hotel"/>
ė Y e[[à m_ m Z ^ _ö ]m m YJ ņ m Y Æe ZY[ņ hotel.id user.usernameÇņ C[ Æ C[ ZYÇ _m m YJ ` Ő ė Y `B
YŅ
Ő m m Y C[`[ [à _m m YJ ņ `
[ _m `e m J ` [C _m m YJ `
m m _[[ ` [[ _m null JŅ
Ő [ Y [[ J J J[ Ė6
<h:commandLink action="#{printer.println('Hello world!')}" value="Hello"/>
©C©
+ak
^ Ae ^ [ YY C[ ZYņ ` e[ `
öJ ` [
ZY C J C ZY
J½ Y e b
ZY
C[ ZY _m [à C[ ÆJÇ ÆJ m rendered f
`Ç |à `B
ņ m_Cņ ė mC YYY[à YYà f
Ė Y
^ C m `à [[_J C[ ` C J m m
àZ b ZY[6
<h:outputText value="#{person.name}" rendered="#{person.name.length() > 5}" />
Ő m č e [[
[ 6
#{searchResults.size()}
J[ à ZY e m e ͼΪ`BYYàΫ _[ ` [ m ZYf
ͼΪ`BJ~YàÆÇΫ
~ [ [[_ *m e[[_J ZY[ [[ m productsByColorMethod _m [[ J J6
#{controller.productsByColor('blue')}
211 Ÿ œ
]m J ^ à m[ öY m e[[_J Y 6
ş
Y`[à _m ~ ) ő ^ ė [à ` _m ~ ) m
Y[ B
ZY _m Y ņ e à _ m Z
_m b )ņ à _[[ b
[ *m Z _ö [à _m ~
)o
ş
A C Y ő ¢Y [ö <c:forEach /> <ui:repeat />f
C àņ ZYJ m m [ Y *m
_ö J e à [
J _ J <h:commandButton /> <h:commandLink />6
@Factory("items")
public List<Item> getItems() {
return entityManager.createQuery("select ...").getResultList();
}
<h:dataTable value="#{items}" var="item">
<h:column>
<h:commandLink value="Select #{item.name}" action="#{itemSelector.select(item})" />
</h:column>
</h:dataTable>
ž_C e à _ <s:link /> <s:button /> à ZY m DataModelņ <dataTable /> Æ ĖC[ e Y [ö
<rich:dataTable /> Ç ùm <s:link /> <s:button /> ` m e Æ me
Y
`öö`[ [öÇ ŸJ
Ÿ Y m _m m m [[ *m J
Y [à ` _m ©C©
+go
^ `[ `
ö `à DataModel ş
¢[[J MethodExpression e C ő ù[[àņ _m MethodExpression f
ņ m Y àY Y `à b m e m `Jņ b
m m Y Y ]m m Zņ _ ė ö_ m
Y àY [ e m ZY m ` C[ *m m _ f
Ė
6
ş
]m à Cö MethodExpression C ņ Y à Y à ` J
~ e m ZY _[[ ö Y
ş
[àņ e [[ methodExpression.getMethodInfo().getParamTypes() à b ZY _m Yņ à e Cö m MethodExpression `e [[J getParamTypes()
m e m Z
J[à [à YY[à _m à _ Cö m
MethodExpression `à m C 211 yx
^ YY [ YB
àZ # YB
ZY Y `f
ZY [fC[ Æ[ņ ņ Ç ZY b ņ m Zf
Y6
#{company.departments}
Jm [ e Y e à [à [ e Y ņ à
[à Y C m [ C m C[ ^ [[_ m _m
YB
ZY6
#{company.departments.{d|d.name}}
*m `ZY [ `
m ZY[ņ m ZY d.name C[f
e m Yņ J d [ m Y `B
*m [ e
m ZY _[[ ` [ e J C[
#à C[ ZY ` ZYņ _[ ` Ye
[à C[ _ m e[[_Jņ J à m e m [Jm e [[ m Y Yà6
#{company.departments.{d|d.size()}}
~B
` *m e[[_J ZY m [ e Cà f
Y[à Cà Y6
#{company.departments.{d|d.employees.{emp|emp.lastName}}}
ù YB
` [Jm[à öàņ m_C *m e[[_J ZY [ö [ö
[ e [[ m Y[à [[ m Y6
©C©
+g
^ #{company.departments.{d|d.employees}}
ž_Cņ [[à [ J [ e m Y[à e m Cf
[ Y * ` m C[ņ à [Jm[à [J ZYf
6
#{company.departments.{d|d.employees.{e|e}}}
Y m m àZ ` Y `à b
[ ~ m
` Zm[ ~ e[ ] Y m m YB
àZ _[[
mJ e C e ^ ©C©
+g)
22 "&!:;<%.34
345&ź}ŻŠŽnǙvţ}Ŕͤȑˏ&¼/,-sŲ’%´ŗ
͗ǔ&;RS,-´¬7ŎF,-}n
345&´ƚ2&CDž
Æl‚śé&Ź2Ç -G%,-´¬ńĆ,-%´ŗ
Šnj»&,-Ŕ}2Ŕžſp³%ÞŖ´ŗ
22 B%TU%
.>ōJ
34
´ƚ2&;RSŽ~%´ŗžſ7ŎF,-ª1¬Žn}2ŔƷ°ʼnŇ%
´ŗ ñ»Žn;RSç%&ĝûIJûĝ;,Ã-ĸĊ–‚PG&GE-
˜M‚PG45ƾ£¯2°¬&%nĻļ&HNM‡ʼnŇ%vţ2Ŕ
}2Ŕžſ;RS,-´¬Œ}s%ÞŖ´ŗ
ŧ&«"v;RSǪý2ØŖ¯Ƌ"ŗ
@Stateless
@Scope(EVENT)
@Name("statementOfAccount")
public class StatementOfAccount {
@In(create=true) EntityManager entityManager
private double statementTotal;
@In
private Customer customer;
@Create
public void create() {
List<Invoice> invoices = entityManager
.createQuery("select invoice from Invoice invoice where invoice.customer = :customer")
.setParameter("customer", customer)
.getResultList();
statementTotal = calculateTotal(invoices);
}
public double calculateTotal(List<Invoice> invoices) {
double total = 0.0;
for (Invoice invoice: invoices)
{
double += invoice.getTotal();
}
return total;
}
// getter and setter for statementTotal
}
[
[*[
ÂÚF<&7ŎF,-śŜ&«"ɆţŒ}s%ÞŖ´
;RS&l‚S-K‚FG&,- Çŗ
Æ
public class StatementOfAccountTest {
@Test
public testCalculateTotal {
List<Invoice> invoices = generateTestInvoices(); // A test data generator
double statementTotal = new StatementOfAccount().calculateTotal(invoices);
©C©
+g+
345&,-
assert statementTotal = 123.45;
}
}
Őė[[ _ ė J CJ e YJ m `̽
_ J à e
[à YC `à ] B J m [J
e
~ Y ė [[à Y [à Y e
ņ
J à mŅ
ž_Cņ e à _ m YY[
ņ 221 "&!:;<%.ŃĂ34
ńĆ,-ŽŔ"Ǚ¯ŦŨÔƴvûŖ´ŗ
;,ê&MOH-HGĭŽ,-“ʎ&wĥ%µ¬œ1n
ȳɀ´¬Œ}s%Þv°&%´̛
}ŽƏýn¼/,-'(´¬œ1nľǾľǾ345˜ǵ345
—KM¯œţŽµûŖĿŻŗ
!Œ%nš́ȃŲ’v;,ê&MOH-HGĭ,-ʼnҐƲǹ¯nĬuǕÞţʁv
"Œ}vţŹ2&345'(tu´¬Ų’sµûŖ´ŗ
sε£´¬KŽn;RS&,-΋-Gp³¯n
ǯǎ¯œ;,êʼnŇ Æ } qͣ& ^ ;,ênœŦ¯ qͣ& ^
;,êŽ €ʭ \ sŲų%´sn€ʭ a %Ž/p¯ŖĿŻÇ %'(´¬}Ə"Ŕ&%´ŗ
public class RegisterTest extends SeamTest
{
@Test
public void testRegisterComponent() throws Exception
{
new ComponentTest() {
protected void testComponents() throws Exception
{
setValue("#{user.username}", "1ovthafew");
setValue("#{user.name}", "Gavin King");
setValue("#{user.password}", "secret");
assert invokeMethod("#{register.register}").equals("success");
assert getValue("#{user.username}").equals("1ovthafew");
assert getValue("#{user.name}").equals("Gavin King");
assert getValue("#{user.password}").equals("secret");
}
}.run();
}
...
}
221 ’ Ė  
[[àņ _ ` `[ Y[
m Y[ e Y
m Y Y _m
m C[`[ m J C
©C©
+gQ
345&,-
b ZY[ņ YY _ mC Y _m
m e
Yà Yf
J à6
@Name("paymentProcessor")
public class PaymentProcessor {
public boolean processPayment(Payment payment) { .... }
}
b J ņ _ ö m Y e[[_6
@Name("paymentProcessor")
@Install(precedence=MOCK)
public class MockPaymentProcessor extends PaymentProcessor {
public boolean processPayment(Payment payment) {
return true;
}
}
m MOCK Y
mJm m m e[ Y
e YY[
Yf
ņ _[[ [[ m ö Y[ _mC m [Ym ]m f
Y[à Y
ņ m ö Y[ `ņ m [ Y _[[ `
[[
222   |
# C m Y`[ [J # m Y`[ _m Y
e_ö [ m _m[ YY[
`à Y
J
_m m _` `_ *m e_ö mC m Y[
ņ ` mà YYY e C[Y [ à _ Y ņ [ b C *m [ e Y Y
m `_ m C_ m Y
m _ņ à J Y à m b Y[Ņ
SeamTest
Œ&K%ŽlƸţ´ƚ2,-´¬Œ}s%ÞŖ´ŗ
ñÞźŠ7ŎF,-¯œ;RS&n~lǪý2ØŖ¯Ƌ"ŗ
<html>
<head>
<title>Register New User</title>
</head>
<body>
<f:view>
<h:form>
<table border="0">
<tr>
<td>Username</td>
<td><h:inputText value="#{user.username}"/></td>
</tr>
<tr>
<td>Real Name</td>
<td><h:inputText value="#{user.name}"/></td>
</tr>
<tr>
<td>Password</td>
<td><h:inputSecret value="#{user.password}"/></td>
©C©
+g\
345&,-
</tr>
</table>
<h:messages/>
<h:commandButton type="submit" value="Register" action="#{register.register}"/>
</h:form>
</f:view>
</body>
</html>
Œ&345&789:ķu
ÆIJ
,-¯Ŗ´ŗ
*ùó
G?-&HMOMGƲǹ¯2ØŖ¯Ƌ"ŗ
ÿNGFG¯œ}Þ&/pÇ
¼/,-%n
b
public class RegisterTest extends SeamTest
{
@Test
public void testRegister() throws Exception
{
new FacesRequest() {
@Override
protected void processValidations() throws Exception
{
validateValue("#{user.username}", "1ovthafew");
validateValue("#{user.name}", "Gavin King");
validateValue("#{user.password}", "secret");
assert !isValidationFailure();
}
@Override
protected void updateModelValues() throws Exception
{
setValue("#{user.username}", "1ovthafew");
setValue("#{user.name}", "Gavin King");
setValue("#{user.password}", "secret");
}
@Override
protected void invokeApplication()
{
assert invokeMethod("#{register.register}").equals("success");
}
@Override
protected
{
assert
assert
assert
}
void renderResponse()
getValue("#{user.username}").equals("1ovthafew");
getValue("#{user.name}").equals("Gavin King");
getValue("#{user.password}").equals("secret");
}.run();
}
...
}
;RSʼnŇƿǀ´¬SeamTestɨʐ¯n
bG?-&HMOMG?ĴD´¬SeamTest.FacesRequest
ɨʐ¯œȳÒGH-,--GɆ°2°¬Œ}ơƉ¯2ţŦñ°ŗ
Æó^*G?-,-´¬SeamTest.NonFacesRequest
Ŕ£Ƭñò2°Ŗ´ŗÇ
ñŖǾŖvbOPƛĚ´Ò­&ÂÚF<nb&;RSƭìƗ¯?ĴD´
©C©
+ga
345&,-
¬;<VW¯2°Ŗ´ŗ ñ»nñŖǾŖv45-K¯2°Ŗ´ŗ
&345ŽnŔ›}Ôƴv3-&ńĆ,-s£Ƭñò2°Ŗ´ŗ
#š£¯2,-'(´¬ēĔ}n^
[Y&*ùóH™Mš£´¬ēĔsµûŖ´ŗ
©C©
+gg
345&,-
222 
©C©
+gh
345&,-
e à fJ à YB
à à _J mf
_ àė[[ Y m J C à eC `[ [ ÆJ ņ
Cņ [YÇ
bņ [ [ö m Y
à 6
*`[ ++
óY #e
org.jboss.seam.embedded
hibernate-all
lib/test/hibernate-all.jar
org.jboss.seam.embedded
jboss-embedded-all
lib/
test/jboss-embedded-all.jar
org.jboss.seam.embedded
thirdparty-all
lib/test/thirdparty-all.jar
org.jboss.seam.embedded
jboss-embedded-api
lib/
test/jboss-embedded-api.jar
org.jboss.seam
jboss-seam
lib/jboss-seam.jar
org.jboss.el
jboss-el
lib/jboss-el.jar
javax.faces
jsf-api
lib/jsf-api.jar
javax.activation
javax.activation
lib/activation.jar
ė Cà Y à ė Y m Y[ # Y
e lib/ ÆJ
jboss-system.jarÇ m [Ymņ m _[[ ^` ` ņ B
m Y
ÆJ €[ņ B~|Çà à J
Ő [ [ m bootstrap/ à m [Ym̽ bootstrap/ m eJ e ^` #ņ e à Y à `[ YB
m [Ym €ė
eJ Y [[ m eJ e[ e ~# m [Ym _[[ ö ^` Y[à à ÆB àÇ _m
m m
seam.properties ė *meņ e à ė `[ à m
`[ Y[à`[ mC J à `[ YB
ņ à Y seam.properties m 2221   ē zĖ }
e à [ à ` `e m à ė
J _m €A * mņ Z €A* m m *
Ő YC e €A6
<dataset>
<ARTIST
id="1"
dtype="Band"
©C©
+gk
345&,-
name="Pink Floyd" />
<DISC
id="1"
name="Dark Side of the Moon"
artist_id="1" />
</dataset>
[[ ` `à CJ prepareDBUnitOperations()6
protected void prepareDBUnitOperations() {
beforeTestOperations.add(
new DataSetOperation("my/datasets/BaseData.xml")
);
}
e[ DatabaseOperation.CLEAN_INSERT e m Y Yf
e J *m `C ZY[ [ [[ `[ e
BaseData.xmlņ m [[ _ [ BaseData.xml `e m @Test m Cö
DataSetOperation
e à Ė Z [Y e m Z
ņ Y afterTestOperations [
Ő [[ €A ` m à J `à J *ùó Yf
datasourceJndiName6
<parameter name="datasourceJndiName" value="java:/seamdiscsDatasource"/>
2222   z
]JŅ *m e [[ C[Y
ė Cà à J à |[6
public class MailTest extends SeamTest {
@Test
public void testSimpleMessage() throws Exception {
new FacesRequest() {
@Override
protected void updateModelValues() throws Exception {
setValue("#{person.firstname}", "Pete");
setValue("#{person.lastname}", "Muir");
setValue("#{person.address}", "[email protected]");
}
@Override
protected void invokeApplication() throws Exception {
MimeMessage renderedMessage = getRenderedMailMessage("/simple.xhtml");
assert renderedMessage.getAllRecipients().length == 1;
InternetAddress to = (InternetAddress) renderedMessage.getAllRecipients()[0];
assert to.getAddress().equals("[email protected]");
}
}.run();
©C©
+ho
345&,-
}
}
] _ FacesRequest [ m Cö#YY[
mö _ m
J J getRenderedMailMessage(viewId);ņ YJ m C_ e m J *m m m J _m
m à à Ő e [ à e m b [e
à
[ m
*m YY e J b Y à ė m `à e m [ J [à
©C©
+h
2S Ŏ#
2S xyz •?Oé w g"
B~|
—8Mê}lŽn
l‚S-KE-}‚OK}°"´2ÞvēĔ%n
cȸ}ȻƘtu¯Ŗ´ŗ Œ&ưĮvŏŽ ^
[Y €^&wĥ%nȨ㎠B~|
<ÃÂ%ȺȻ%ÞŖ´ŗ ÆmY6½½
B`
½B`Y½C+½JY½Ç
2S gU4&MI4•?Oé
Œ&ŏ%™HO@LvēĔ%l‚S-KE-cȸ´¬Œ}stu%´ŗ
2S1 ~QMg"
Œ&ŏ%‚OKȁȂ´¬ĥÁcȸ´¬Œ}ĝn
!ò»&™HO@Lvlp³´¬Œ}s%ÞŖ´ŗ
!&§¨nŠ&«"cȸñòœºƹí¯œûǢȜ¯œûstu%´ŗ
©C©
+h)
ŏ
©C©
+h+
2[ Áµī
2[ &MRK
Áµī
Œ&ɽŽ;âMÎ}'(Î&
&ĸĬ-¯2°Ŗ´ŗ
NM}¯2
ear
}-ñò2°òũn
HM–HŽ345&
OáM&
½[`
—@DGǞºòvŨòũvûŖĿŻŗ
NM}¯2
war
}-ñò2°òũn
HM–HŽ345&
_
OáM&
/WEB-INF/lib
—@DGġŖòvŨòũvûŖĿŻŗ ĸĬ&-;Ž [[ Æ ŹȔ Çn Æ
'(Î ÇnYC Æ TUÎÇ %´ Æ # Q) Ö°2 Çŗ
<Ўš®˜‚5&ȟȠŽġŖò2°ŖĿŻsn |C ~| /build/root.pom.xml
%Žƿǀñò2°Ŗ´ŗ
2[ B"
*`[ +\
Ò­
-;
NM
UǪ
EÃ,@%
€J
ťƍš£´¬ŷƐŲų%´ŗ
[[
;
HM–HnļŲų%´ŗ
jboss-seam-debug.jar
_
ôǶŀ
—˜F™ķuí¬ŷƐ
ġŖĿŖ´ŗ
jboss-seam-ioc.jar
_
%
YJ
š£´¬ŷƐŲų%´ŗ
jboss-seam-pdf.jar
_
&
~€b
ķuš£´¬ŷƐŲų%´ŗ
jboss-seam-remoting.jar
_
ÅƭìƗ¯š£´¬ŷĆ
Ųų%´ŗ
jboss-seam-ui.jar
_
b
;Kš£´¬ŷƐŲ
ų%´ŗ
commons-codec.jar
jboss-seam.jar
©C©
+hQ
ĸĬ
Ò­
-;
NM
UǪ
jsf-api.jar
YC
b #~
jsf-impl.jar
YC
b OáD-'Ɗ
jsf-facelets.jar
_
b
[
urlrewrite.jar
_
AI HMHM–H
jcaptcha-all.jar
¢Y
m
R´¬ŷƐŲų%´ŗ
quartz.jar
&īÍĈķu%
Ēč
š£¯«"}¯œŷƐŲų%
´ŗ
-;
NM
UǪ
[[
I
mb
š£´¬ŷƐŲų%´ŗ
345º»š£¯œ°
#~
GH-ƿǀ¯Ŗ´ŗ
èýũnŏ&²³vŠ
richfaces-impl.jar
_
I
mb
š£´¬ŷƐŲų%´ŗ
richfaces-ui.jar
_
I
mb
š£´¬ŷƐŲų%´ŗ´ƚ
2&
A
;RSƿǀ¯Ŗ´ŗ
2[1 j_
*`[ +\) I
mb
ĸĬ
Ò­
richfaces-api.jar
2[2 ¿#
*`[ +\+ ÂĸĬ
©C©
+h\
ĸĬ
Ò­
-;
NM
UǪ
activation.jar
ģÝR´¬ŷƐŲų%
´ŗ
mail.jar
ÂɍħR´¬œ1
Ųų%´ŗ
mail-ra.jar
Y[
[à
ÂĦħR´¬œ1
Ųų%´ŗ
[f
Ž'(ΐ345
˜—KMñò¬Ų’sµûŖ
´ŗ
_
NM
-;
itext.jar
_
~€b HM–H
jfreechart.jar
_
̫Ěp³HM–H
jcommon.jar
_
b¢m Ųų%´ŗ
jboss-seam-pdf.jar
_
~€b ;HM–H
jboss-seam-mail.jar
Â
2[S y}_
*`[ +\Q ~€b ĸĬ
Ò­
UǪ
2[[ j
I[ HM–HŽ & drools/lib —@DGµûŖ´ŗ
*`[ +\\ I[ ĸĬ
Ò­
antlr-runtime.jar
©C©
-;
NM
UǪ
#ù* I I HM–H
+ha
ĸĬ
Ò­
-;
NM
core.jar
drools-compiler.jar
drools-core.jar
janino.jar
mvel.jar
-;
NM
UǪ
^
[Y €*
2[^ yz
*`[ +\a ~| ĸĬ
Ò­
jbpm-jpdl.jar
UǪ
2[b ò\
345%
óJ[
š£¯œ°ŷƐŒò»&HM–HŽŲų%´ŗ
]`
*[ö
Æó]*Ç
*`[ +\g ó]* ĸĬ
Ò­
gwt-servlet.jar
-;
NM
_
UǪ
*m ó]* C[ [`
2[c 
345% YJ b_ö š£¯œ°ŷƐŒò»&HM–HŽŲų%´ŗ
*`[ +\h YJ b_ö ĸĬ
©C©
+hg
ĸĬ
Ò­
spring.jar
-;
NM
UǪ
*m
YJ
HM–H
b_ö
2[f òÆĉ
345% óCà š£¯œ°ŷƐŒò»&HM–HŽŲų%´ŗ
*`[ +\k óCà ĸĬ
Ò­
groovy-all.jar
-;
NM
UǪ
*m óCà [`
2[1 zÆ '˜¡¬šÁµī“D
|C
ŽwΊvĸĬ•=&Ƽƽ£Ƭ¯2ëûn
K‚PG&ĸĬ&•=Į£stu%´ŗ # `[  |C ńĆ´¬œ1 |C
# *ö sĮ£tu%´ŗ ŖœnK‚PG&l<}—KM |C Į£tu%´ŗ
ŒŒ%Ž˭ȔŠ |C &š£ēĔɯȎ¯2°¬&%Žvţn š£tuv°ţÖº&ĜˆŠv
~| ‘ɾ¯2°¬ŦŨ%´ŗ
-ñò2°¬˜‚5& Ž mY6½½YàB`J½C) µûŖ´ŗ
êM-êF45FŽ mY6½½YmB`J½C) µûŖ´ŗ
´ƚ2& &,@OáGŽ |C %íî%´ŗ
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ui</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-pdf</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-remoting</artifactId>
</dependency>
©C©
+hh
ĸĬ
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ioc</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ioc</artifactId>
</dependency>
Œ& ~| Ž n~# Æ ž`'Ɗ Ç !¯2 ž` [ ƿǀ¯Ŗ´ŗ
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.example/groupId>
<artifactId>my-project</artifactId>
<version>1.0</version>
<name>My Seam Project</name>
<packaging>jar</packaging>
<repositories>
<repository>
<id>repository.jboss.org</id>
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.3.1.ga</version>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>2.0.0.GA</version>
</dependency>
</dependencies>
</project>
©C©
+hk