You are on page 1of 27

CHOOSING A JAVA WEB FRAMEWORK: A COMPARISON

Richard Pack, Lead U er I!"er#ace Archi"ec" $S%&'()

•Learn how to choose a Java™ technology-based
Web Framework
•Enable you to:
Categorize and understand what type of UI you’re building Understand the features and nomenclature of Model View Controller MVC! "eigh the trade#offs

2008 JavaOneSM Conference | java.sun.com/javaone |

2

e "i+! 2008 JavaOneSM Conference | java.c"i+! C.Fra.e/+rk S.sun.rre!" We.r !eed 2 $he Ad4a!ced Cri"eria $he Fra.e/+rk $he $radi"i+!a0 Cri"eria Wha" are "he 1r+-0e. i+! 5.com/javaone | 3 . "ha" . er are #aci!*2 Wha" are 3+.A*e!da I!"r+d...ar3 a!d C+!c0.

r+ra Bari". GW$ Gr++43.cee O1e!7a4a O7F P.-a Ma4erick Me0a"i Me!"a/ai Mi00 "+!e M3Face Nach+ Ni**0e Sh+ck S.. Mak.1a"h J.!c"i+! $." = Jac<.+ Ca a!dra Chi-a Chr3 a0i C0ick C+c++! 6i!a.e/+rk A!4i0 Ara!ea A.ca JWAA JWar1 9Wic 9:e!+ 9:+!ic O1e!E.e/+rk Ac"i+! Fra. Barrac.da Be!"+ Bi h+1 Ca!3a..C.rre!" Fra.ica 6+4e"ai0 6WR Ech+ E81re + #0e7i4e F+0i.a JSPWid*e" J.r-i!e Ver*e VRa1"+r War#are We-O!S/i!* We-W+rk Wicke" /i!*S 7+10+! :K 2008 JavaOneSM Conference | java.i0e SOFIA S1ri!* MVC S"reck S"ri1e S"r.Grai0 He0..10a"e 4 .sun.0ar JOSSO JP. "e#i8 Re "0e" RIFE RSF S/i!*We$a1e "r3 $eaSer40e" $hi!Wire $ri.com/javaone | Over 100 Frameworks Maca/ Sea.-0i h JSF >"e.ard Ja##a Ja110e JA$O JF+r." S"r.

e!" % C Par" ? Ne/ % /ha" i "he 0ear!i!* c.$a*0i. e $e.e!" ? Wha" d+e i" "ake "+ hi1 i"2 S1eed +# 6e4e0+1.$he Cri"eria $he "radi"i+!a0 e" $he He00+ W+r0d "e " ? Wha" d+e i" "ake "+ /ri"e He00+ W+r0d2 Per#+r.re ea 32 2008 JavaOneSM Conference | java.. Ja4a "ech!+0+*3 c+!"r+0 +# -0+ck 2 S1eed +# 6e10+3.e d+e i" "ake "+ add i.sun.10e #ea".a!ce ? Fi0"er +r er40e"2 Vie/ dec+ra"i+! "30e ? 6+e i" .com/javaone | 5 ..re 2 ? A*i0e % i cha!*i!* #ea".ch "i.r4e2 ? E8i "i!* % h+/ .10a"e +r Ja4aSer4er@ Pa*e AJSP@B +#"/are.

com/javaone | 6 .$he Cri"eria Vali a!ion $he "radi"i+!a0 e" % c+!"i!.es& "ocumen!a!ion -oo.er!ies& Var+in) sco.sun.ed • "oes i! #ave lo!s of $uil %in vali a!ors& 'n!erna!ionali(a!ion / Mul!ilin)uali(a!ion • *#a! s!+le of .mar.ro.%a$ili!+ Scala$ili!+ 2008 JavaOneSM Conference | java.

a!a*e /he! "he a11 *r+/ N+ /a3 "+ r.a3 ha4e a "ee1 0ear!i!* c.0" #+r "radi"i+!a0 /ede i*!er C+!#i*.i"ed 6+c. ed a "he c+!"r+00er JSP +#"/are.0" "+ .com/javaone | / .10a"e .. e E!d .S+ /h3 i "hi i.!der "a!d a!d .1 /ri"i!* 0+" +# !+!%re.e a !i*h".ra"i+! -ec+.sun.!i#ied e4e!" .**er i! "he "e.are "+ read /he! "he 1a*e *r+/ $e.10a"e A-i0i"3 #+r "he 4ie/ "+ -e . Se i+! +r C+!"e8" Li.!i#ied A9a8 "ra! 1+r" 6irec" 1er i "e!ce "+ Re<.e ".! a de-.e!"a"i+! Wri"i!* -+i0er10a"e c+de N+ .1+r"a!" 6i##ic.e!" 2008 JavaOneSM Conference | java.r4e S1eed +# de10+3.0" #+r "he "akeh+0der "+ .+de0 6i##ic.JS$L -ec+. a-0e c+de N+ .e di##ic.

Wha" are .i0di!* #+r "he #.3 !eed 2 A.reE 6+ I rea003 !eed a C%"ier archi"ec".sun.3 a110ica"i+!2 Wha" i . are -.3 .i0di!* a! a110ica"i+!2 H+/ -i* i .com/javaone | 8 .2 2008 JavaOneSM Conference | java.3 "ea.1e"e!cie +# . I -.re2 Wha" i "he i>e a!d c+. a*e ce!ari+2 I "hi 0ike03 "+ cha!*e2 ? D+.".

e ? S+.e/+rk #+r di##ere!" .10e.a3 ha4e di4er*i!* i.e!" . c+r1+ra"e /e.e re<.com/javaone | 0 .sun. -0+*. a*e ce!ari+ ? ? ? ? Vie/ AReadB +!03E E8 % "+re#r+!". +!0i!e -a!k.i"e Wri"e +!03 B+"h 4ie/ a!d /ri"e Hi*h03 I!"erac"i4e 2008 JavaOneSM Conference | java.ire.S/ee" S1+" N+" a +!e i>e #i" a00 *a.e!"a"i+! /hich crea"e "rade%+## 6i##ere!" #ra.

S1ri!* a!d hi-er!a"e Frie!d03 URL : URL .0"i10e C+.00 -a ed +r P..10i!* -e"/ee! "he 0a!*. e "he #ra..$he Cri"eria AJA7 .a0 de4e0+1.11+r" % EJB.. c+!"i!.Ser4er Ja4aScri1"@ 1r+*ra.!i"3 ? Ac"i4e. M.ri"3 P. EL.com/javaone | 10 .sun.a*e.r de4e0+1er ha4e e81erie!ce /i"h i"2 C0ie!" e4e!" dri4e!2 Aka 6+e i" .e!" Ma".i!* 0a!*.11+r" $he ad4a!ced e" ? I!"e*ra"ed +r a#"er "he #ac" ? 6+e i" re03 +! e8"er!a0 "++0 C0ie!". h -a ed C%"ier .1a!3 .a*e ? Ja4a 1r+*ra.a11i!* a!+"her 1ar" +# "he c+.a*e ? I "here "i*h" c+..a*e 6+e Vie/ 0a!*.i!* 0a!*.e/+rk2 6+ 3+. OGNL.11+r" Ser4ice 2 6+e i" ha4e a! Arche"31e 2008 JavaOneSM Conference | java.

title:l !lassicDefsTable.Grai0 U a*e "31e: Vie/ .re ? I!"e*ra"e S1ri!* a!d Hi-er!a"e C+! : ? S0+/ c+. "#l:"#l$o#(action:'defData'%. pa#ams% def id = "01pa#ams id2" def #es = ne( &t#in. n"m'o(s:)*% %> <+div> ++.sun.10e c+!#i*.ra"i+! ? C0+ .s chema:def&chema...#oovstatic &t#in.e/+rk 2008 JavaOneSM Conference | java.i!* 0a!*.1ared "+ !a"i4e #ra.Gr++43.a*e <!-./"ffe#(""" <sc#ipt t-pe="te3t+javasc#ipt"> dojo #e4"i#e("dojo topic"%5 Pr+ : ? H+"%de10+3 ? Si.template code --> <div id="table" class="hidden"> <%=dojoTable(id:'Defs'. dojoTable(/indin. sc#ipt/indin.com/javaone | 11 . Wri"e ? E8"e! i+! "+ "he Ja4a 1r+*ra.

00 Ma".i0" i! 2008 JavaOneSM Conference | java. -.Gr++43.!* S.!i"3 C $ier F. h D+.W ." *r+/i!* De N+" -.a*e P.a00.sun. h +r P. Gr++43 P.ri"3 C+.11+r" Frie!d03 URL N+ Ja4a..Grai0 AJA7 .com/javaone | 12 .11+r"2 Vie/ La!*..

a*e 2008 JavaOneSM Conference | java.10ici"3.i0" i! c+.$++0ki" AGW$B U a*e $31e: Vie/ .i0" i! c+.G++*0e We.i!* 0a!*.i!* 0a!*. Wri"e ? M+di#ied Ja4a 1r+*ra.rre!"03 !+ .a*e ? Pr+9ec" Arche"31e C+! : ? Hard "+ c+!"r+0 c c0a e ? B.a*e .1+!e!" are #air03 -a ic AS+04ed /i"h GW$%E8"B ? C.11+r" #+r Ja4a (..Ja4a & 1r+*ra.1+!e!" ? S"r+!* -i!di!* -e"/ee! Ja4a a!d Ja4a cri1" 1r+*ra..11+r" Pr+ : ? Si. S/i!*.SW$ Like ? L+" +# -.com/javaone | 13 .i!* 0a!*.sun..

sun.p3"%5 Doc<8anel o"te# = ne( Doc<8anel(%5 o"te# add(top8anel.(false%5 :indo( set6a#. Doc<8anel 7@&T%5 o"te# add(main8anel.et(% add(o"te#%5 2008 JavaOneSM Conference | java.add?isto#-9istene#(this%5 'oot8anel .ht8anel add(list%5 main8anel add(table%5 :indo( enable&c#ollin.G++*0e We.in(".$++0ki" AGW$B p"blic class 6ail implements 7nt#-8oint. Doc<8anel =>'T?%5 o"te# add(left8anel.com/javaone | 14 1 . p"blic void on6od"le9oad(% 1 top8anel add(men"/a#%5 #i. Doc<8anel !7=T7'%5 ?isto#.

/i"h +.!* S.ri"3 C+.!i"3 C $ier F.W .sun.11+r"2 Vie/ La!*.com/javaone | 15 .00 D+.a00 N+ De .11+r" Frie!d03 URL De Ja4a *e!era"ed P.e /+rk 2008 JavaOneSM Conference | java. h +r P.$++0ki" AGW$B AJA7 .a*e P.G++*0e We.00 Ma"...

S"r.11+r" ? S1ri!* c+!"ai!er i!"e*ra"i+! ? POJO a c+!"r+00er .a11i!* "+ 7ML 2008 JavaOneSM Conference | java.ra"i+! ? S"i00 0ea4e "he #0+/ .ire i!heri"a!ce ? FreeMarker a!d Ve0+ci"3 .11+r" C+! : ? S"i00 . e LO$S +# 7ML c+!#i*. Hi*h03 I!"erac"i4e Pr+ : ? Fir " c0a AJA7 .sun.com/javaone | 16 . d+e !F" re<." = U a*e $31e: Vie/ . Wri"e.

p(%5 #et"#n e3ec"te(%5 2 <s:te3tfield id=""se#=ame" label="Ase#=ame" name="lo.S"r.sun.in last=ame"+> <s:s"bmit theme="aja3" ta#.in&e#vice se#vice% 1 this se#vice = se#vice5 2 p"blic &t#in. lo.com/javaone | 1/ .in fi#st=ame"+> <s:te3tfield id="pass(o#d" label="8ass(o#d" name="lo.in"+> 2008 JavaOneSM Conference | java.in@ction(9o." = p"blic class 9o.in" notif-Topics="+lo. e3ec"te(% 1 #et"#n @ction &A!!7&&5 2 p"blic &t#in.in(% 1 se#vice lo.ets="lo.in("n.in@ction implements 8#epa#able 1 p"blic 9o.

!i"3 C $ier F.W . De N+" -.00 Ma".11+r" Frie!d03 URL De JSP..ri"3 C+. OGNL P." = AJA7 .sun.com/javaone | 18 .. h +r P.11+r"2 Vie/ La!*.S"r.i0" i! 2008 JavaOneSM Conference | java.. h D+.a*e P.!* Medi.

$a1e "r3 2sa)e !+.sun.e3 Vie4 / *ri!e5 6i)#l+ 'n!erac!ive 7ros3 • 2ses anno!a!e 68M9 !em.ro$lems • @o =7' $ac.or!5 an lo!s of i! Cons3 • "ocumen!a!ion oesn?! use real 4orl ..4ar s com.a!i$ili!+ $e!4een major versions 2008 JavaOneSM Conference | java.la!es • 6o!% e.com/javaone | 10 .lo+ :Version 5.le confi)ura!ion • <irs! class =J=> su. • Sim.

e8anel" messa.e:"se#=ame"+> <a j(cid="Bh-pe#ic:/"tton" listene#="listene#:si.nin/"tton9istene#" label="messa. "se#=ame%5 p"blic C9in< si. .nCn e3tends /ase8a.template code --> <div j(cid="Bh-pe#ic:6essa.e 1 B8e#sist(% p"blic abst#act &t#in.$a1e "r3 <!-.com/javaone | 20 .e"+> <inp"t j(cid="Bh-pe#ic:Cnp"t$ield" fieldDal"e=""se#=ame" fieldTitle="messa.nin/"tton9istene#(C'e4"est!-cle c-cle% 1 ++b"tton clic< listene# 2 2008 JavaOneSM Conference | java.etAse#=ame(%5 p"blic abst#act void setAse#=ame(&t#in.e:"se#=ameTitle" field9abel="messa.nCn/"tton" enableEe-9istene#="t#"e" +> ++Fava !ont#olle# p"blic abst#act class &i.sun.e="messa.e:si.

.00 Ma".W .a*e P.$a1e "r3 AJA7 .sun.ri"3 C+.!i"3 C $ier F. Pr+1 P.11+r"2 Vie/ La!*.re Lar*e. Ac"i4e De De 2008 JavaOneSM Conference | java. h +r P..11+r" Frie!d03 URL E8"e! i4e OGNL.00 Ma".com/javaone | 21 .

10a"e ? E8ce00e!" d+c.sun.a*e C+! : ? E4er3"hi!* i d+!e i! Ja4a 1r+*ra..e!"a"i+! ? C+.1+!e!" ca! -e e8"e!ded ? E4er3"hi!* i d+!e i! Ja4a 1r+*ra.Wicke" U a*e $31e: Hi*h03 I!"erac"i4e Pr+ : ? A!!+"a"ed H$ML $e.a*e 2008 JavaOneSM Conference | java.com/javaone | 22 .i!* 0a!*.i!* 0a!*...

in"+> 2008 JavaOneSM Conference | java.in8anel%5 2 p"blic void on&"bmit(%1 lo.in e3tends :eb8a.in%5 <span (ic<et:id="lo.in(%1 add(lo.in8anel("lo.Wicke" ++Definition p"blic class 9o. lo.e 1 p"blic 9o.in(%5 set'esponse8a.com/javaone | 23 .in"> <div><span (ic<et:id=""se#name"><+span><+div> <div><span (ic<et:id="pass(o#d"><+span><+div> <+div><+(ic<et:panel> ++ Asa.sun.e(ne( ?ome8a.e add(ne( 9o.e(%%5 2 2 <(ic<et:panel><div (ic<et:id="lo.in".

Ac"i4e De De 2008 JavaOneSM Conference | java.11+r"2 Vie/ La!*. h +r P.com/javaone | 24 .a*e P.00 Ma"..11+r" Frie!d03 URL E8"e! i4e OGNL P..sun.!i"3 C $ier F.W .Wicke" AJA7 .00 M+dera"e Medi.ri"3 C+...

3 /+rd #+r i".e/+rk are e<.ar3 N+" a00 #ra.r +/! 2008 JavaOneSM Conference | java."0i!e 3+.a0 U!der "a!d a!d +. "r3 a GHe00+ W+r0dH +# 3+.a"e 6+!F" "ake ...sun.r !eed Fi!d a #e/ "ha" 0++k 0ike "he3 .ee" "h+ e !eed U e "he cri"eria a!d e4a0.com/javaone | 25 .S.

F+r M+re I!#+r./e-"++0ki"..sun. ? "a1e "r3Ea1acheE+r* A /icke"Ea1acheE+r* 2008 JavaOneSM Conference | java. E+r*.e/+rkS/ee"S1+" E1d# $he Fra.e/+rk ? *rai0 Ec+deha.Ja4aWe-Fra.a Ec+. ? "r.e/+rk GS/ee" S1+" H A ///E4ir".c+!#ere!ce .. ? c+deE*++*0eEc+. 0ide Ja4a Fra.a"i+! $he e 0ide ? ///Eh31ericE+r*.#i0e .com/javaone | 26 ." Ea1acheE+r*.

/0 2008 JavaOneSM Conference | java.sun.CHOOSI ! " J"#" W$% F&"'$WO&() " CO'*"&ISO &+chard *ack .S--.com/javaone | 2/ .