Model View Controller (MVC) architecture

ostentationabioticInternet and Web Development

Jul 5, 2012 (5 years and 1 month ago)

407 views

3
Mo
de
l
Vi
e
w
Co
n
t
r
o
ll
e
r
(MV
C)
ar
c
hit
e
ct
ur
e
3.
1
Desi
gn
pat
ter
ns
As
w
e
discuss
ed
in
the
p
re
v
ious
se
ction,
a
des
ign
patt
e
rn
desc
ri
b
es
a
pro
v
en
soluti
on
to
a
r
e
cur
rin
g
design
pr
oblem,
p
lac
in
g
par
tic
u
lar
em
p
hasis
on
the
c
on
te
xt
an
d
f
orc
es
sur
roun
di
ng
the
pr
oblem
,
and
th
e
conse
q
uence
s
and
impact
of
the
s
ol
ution
.
There
are
m
an
y
go
o
d
reas
on
s
to
use
d
e
sign
pat
te
r
ns:
1.
They
ar
e
pr
oven
:
Y
ou
tap
the
e
x
p
erience
,
kn
o
w
l
e
d
ge
and
insigh
ts
of
dev
elop
ers
w
h
o
ha
v
e
used
thes
e
pattern
s
s
u
c
ce
ss
f
ul
ly
in
th
e
ir
o
wn
w
ork.
2.
They
ar
e
r
eu
sable
:
When
a
prob
lem
r
e
curs,
y
ou
d
on’t
ha
v
e
t
o
in
v
en
t
a
n
e
w
soluti
on;
y
ou
fol
lo
w
th
e
patt
e
rn
a
n
d
adap
t
it
as
nec
ess
ary
.
3.
They
ar
e
expr
es
sive
:
Des
i
gn
pat
te
r
ns
p
ro
vid
e
a
com
mon
v
o
c
ab
ular
y
of
s
ol
ution
s
,
wh
ic
h
y
ou
can
use
to
e
xp
res
s
larger
s
olu
tion
s
s
u
c
cin
c
tly
.
It
i
s
i
m
p
ortan
t
to
r
e
me
m
b
e
r,
h
o
w
ev
e
r,
th
at
d
e
sign
pattern
s
do
n
ot
gu
aran
tee
s
u
c
ce
ss
.
Y
ou
can
only
determine
w
h
e
t
her
a
pattern
i
s
app
licable
b
y
careful
ly
readi
ng
its
de
scrip
tion,
and
on
ly
af
te
r
y
ou
’v
e
app
lied
it
i
n
y
our
o
w
n
w
ork
c
an
y
ou
determine
whether
it
has
help
e
d
.
On
e
of
th
e
se
patt
e
rn
s
is
Mo
del-
Vi
e
w-C
on
troller
(
MV
C
).
The
progr
am
min
g
langu
age
S
m
al
ltalk
first
defin
e
d
the
MV
C
con-
ce
p
t
it
in
the
1970’
s
.
S
ince
that
time
,
the
MV
C
d
e
sign
id
iom
has
b
ec
ome
c
ommonp
lac
e,
e
sp
e
cially
in
ob
j
e
ct-orien
te
d
s
ystem
s.
3.
2
The
ar
c
hit
e
ct
ur
e
As
w
e
d
is
cusse
d
i
n
the
previou
s
se
ction
,
i
t
is
com
mon
to
th
ink
of
an
app
lication
as
ha
vin
g
three
main
la
y
ers
:
pr
e
se
n
tation
(
UI
)
,
app
lication
l
ogic
,
an
d
r
e
source
m
an
age
me
n
t.
I
n
MV
C,
th
e
p
re
sen
tation
la
y
er
is
spl
it
in
to
con
tr
oller
and
view
.
The
m
ost
imp
or
tan
t
se
p
aration
is
b
e
t
w
e
en
p
res
en
tation
and
app
lication
logic.
T
h
e
View
/Con
tr
oller
spl
it
i
s
le
ss
s
o.
MV
C
encom
p
as
ses
m
ore
of
th
e
arc
h
itec
tu
re
of
an
app
lication
th
an
is
t
yp
ic
al
f
or
a
des
i
gn
pattern
.
Hence
the
term
arc
h
itec
tu
ral
pattern
ma
y
b
e
useful
,
or
p
erhap
s
an
aggr
e
gate
d
e
sign
p
atte
r
n.

Mo
del
:
Th
e
d
omain-s
p
ec
ifi
c
represe
n
tat
ion
of
t
he
in
formation
on
whi
c
h
the
ap
pli
c
ation
op
-
erates
.
The
m
o
d
e
l
i
s
anoth
e
r
n
ame
for
th
e
ap
plication
l
ogic
la
y
er
(s
ometime
s
al
s
o
c
al
le
d
the
domain
la
y
er).
Ap
pli
c
ation
(or
d
om
ai
n)
logic
ad
ds
me
an
ing
to
r
a
w
data
(e
.
g.,
c
alcul
ating
if
to-
da
y
is
th
e
use
r’
s
b
irth
da
y
,
or
th
e
total
s
,
tax
e
s
and
s
h
ipp
ing
c
har
ge
s
for
s
h
oppi
ng
cart
i
te
ms
).
Man
y
appl
ic
at
ions
use
a
p
e
rsiste
n
t
s
tor
age
me
c
h
ani
s
m
(s
u
c
h
as
a
datab
as
e)
to
s
tor
e
dat
a
.
MV
C
d
o
e
s
n
ot
sp
ec
i
fically
m
en
tion
th
e
r
e
sour
c
e
managem
en
t
la
y
e
r
b
ec
au
s
e
i
t
is
un
dersto
o
d
to
b
e
un
derneath
or
encapsulated
b
y
th
e
Mo
d
e
l
.

View
:
Re
n
ders
t
he
mo
d
e
l
in
to
a
f
orm
sui
table
for
in
te
r
ac
tion
,
t
ypically
a
u
s
er
in
terf
ac
e
ele
men
t.
MV
C
i
s
often
s
ee
n
i
n
w
eb
appl
ic
at
ions,
wh
e
re
the
vi
e
w
i
s
the
HTML
page
an
d
the
co
de
wh
ic
h
gath
e
r
s
dy
namic
d
ata
f
or
the
page.
18
Figu
re
4:
M
o
del
Vie
w
Con
troll
e
r
ar
c
hi
te
ctur
e

Contr
ol
ler
:
Pro
ces
se
s
and
res
p
ond
s
t
o
e
v
en
ts,
t
ypi
c
all
y
use
r
ac
t
ions,
and
ma
y
in
v
ok
e
c
han
ge
s
on
th
e
mo
del
and
vi
e
w.
Thou
gh
MV
C
com
es
in
di!e
r
e
n
t

a
v
ours,
the
c
on
tr
ol
flo
w
generall
y
w
ork
s
as
fol
lo
w
s:
1.
The
use
r
in
te
r
ac
ts
wit
h
the
u
s
er
in
terf
ac
e
in
s
ome
w
a
y
(e
.g.
,
use
r
pr
e
ss
es
a
bu
tton)
2.
A
con
trol
le
r
han
dles
th
e
i
np
ut
ev
e
n
t
from
th
e
u
s
er
in
t
e
rf
ac
e,
o
f
ten
via
a
r
e
gi
s
tered
h
andl
e
r
or
callbac
k.
3.
The
c
on
troller
acc
es
se
s
the
m
o
del,
p
os
sib
ly
up
dati
ng
it
in
a
w
a
y
app
ropr
iate
to
th
e
u
s
er’s
action
(e.g.,
con
trol
le
r
up
dates
user’s
shop
pi
ng
c
ar
t).
Complex
con
troll
e
r
s
are
often
s
t
ructur
e
d
usin
g
th
e
com
mand
p
attern
to
e
n
c
ap
s
u
late
action
s
and
simpl
ify
extension.
4.
A
vi
e
w
uses
th
e
mo
d
e
l
to
generate
an
ap
pr
opri
ate
u
s
er
in
te
r
face
(e.g.,
view
p
ro
d
uce
s
a
s
cree
n
listin
g
the
s
h
oppi
ng
c
ar
t
c
on
t
e
n
ts).
Th
e
view
ge
ts
its
o
wn
d
ata
f
rom
the
m
o
del.
The
m
o
de
l
has
no
d
irect
kn
o
w
l
e
d
ge
of
the
vi
e
w.
(Ho
w
ev
e
r
,
the
ob
s
erv
er
p
attern
c
an
b
e
used
to
all
o
w
the
mo
del
to
ind
irec
tl
y
n
otif
y
in
teres
ted
par
ties
,
p
ote
n
t
ially
in
c
l
udi
ng
views
,
of
a
c
han
ge
.
)
5.
The
use
r
in
te
r
face
w
ai
ts
for
f
ur
ther
use
r
in
te
r
ac
tion
s
,
wh
ic
h
b
e
gi
ns
th
e
cyc
l
e
anew.
Fig
4
s
u
m
marise
s
th
e
r
e
lati
onship
b
et
w
een
th
e
M
o
del,
Vi
e
w,
an
d
Con
tr
oller
is
pr
o
v
ided
b
e
l
o
w.
Note
:
th
e
s
oli
d
lines
in
dicate
a
dir
e
ct
ass
o
c
iati
on,
and
th
e
dashed
lin
e
ind
icate
an
ind
irec
t
ass
o
ciation
(e.g.,
observ
e
r
p
attern).
19
3.
3
Im
plem
e
n
tat
io
ns
The
M
V
C
patt
e
rn
w
as

rs
t
desc
ri
b
ed
in
1979
b
y
T
rygv
e
Ree
n
s
k
au
g,
th
e
n
w
orki
ng
on
Smalltalk
at
Xero
x
res
earc
h
lab
s
.
The
origin
al
impl
e
me
n
tation
i
s
d
e
sc
r
ib
e
d
in
d
e
p
th
in
the
in
fluen
tial
pap
e
r
“A
ppli
c
ations
Pr
o
gr
am
ming
in
Smal
ltalk-80(T
M):
H
ow
to
use
Mo
del-
V
i
ew
-C
on
tr
ol
ler

.
Small
talk’s
MV
C
impl
e
me
n
tation
in
s
p
ired
man
y
other
GUI
framew
ork
s
s
u
c
h
as:

The
NeXTSTEP
and
OP
ENS
T
E
P
dev
elopme
n
t
en
vi
ronmen
ts
encourage
the
u
s
e
of
MV
C.
Co
coa
an
d
GNUste
p
,
base
d
on
th
e
se
tec
h
nologies,
al
s
o
use
MV
C.

Mi
c
rosoft
F
oun
dation
Classe
s
(M
F
C)
(al
s
o
c
al
le
d
D
o
c
u
m
en
t/Vi
e
w
arc
h
itec
tu
re
)

Ja
v
a
S
wing

The
Q
t
T
o
olkit
(since
Qt
4
Rele
ase).

XF
orms
h
as
a
clear
se
p
aration
of
mo
d
e
l
(s
tor
e
d
in
s
id
e
th
e
HT
M
L
head
sec
tion
)
f
rom
the
pr
e
se
n
tation
(stored
i
n
the
HTML
b
o
dy
se
ction
).
XF
or
m
s
use
s
s
imp
le
b
ind
c
omm
an
ds
to
link
th
e
pr
e
se
n
t
ation
to
the
mo
d
e
l
.
The
f
ollo
wing
s
ec
ti
ons
pr
o
vide
a
basic
o
v
e
rv
ie
w
of
h
o
w
MV
C
is
i
m
p
le
men
te
d
i
n
a
n
um
b
e
r
of
di!e
r
e
n
t
fr
am
ew
orks
-
d
on’t
w
orr
y
if
y
ou
d
on’t
f
ollo
w
all
th
e
d
e
tai
ls
y
e
t,
a
s
y
ou
m
a
y
n
ot
b
e
famil
iar
with
th
e
fr
am
ew
or
ks
.
W
e
s
h
all
b
e
reviewing
man
y
of
thes
e
framew
ork
s
in
lecture
4.
3.3.
1
ASP
.NET
In
ASP
.NE
T
,
th
e
pattern
s
for
the
v
ie
w
and
c
on
troll
e
r
are
w
e
l
l
d
e

ned.
The
mo
d
e
l
is
left
to
the
dev
elop
er
to
des
ign
.

View
:
The
ASPX
and
AS
CX

le
s
hand
le
th
e
res
p
onsib
iliti
e
s
of
th
e
view.
With
th
is
d
e
sign,
the
view
ob
ject
actuall
y
in
herits
f
rom
th
e
con
tr
oller
ob
j
e
ct.
T
h
is
is
di
!
eren
t
f
rom
th
e
Smalltalk
impl
e
me
n
tation,
in
w
h
ic
h
separate
c
lasse
s
h
a
v
e
p
oi
n
te
r
s
to
one
an
other.

Contr
ol
ler
:
Th
e
du
tie
s
of
t
he
con
troll
e
r
are
spl
it
b
et
w
ee
n
t
w
o
p
lac
es
.
The
generation
an
d
passing
of
ev
e
n
ts
is
part
of
th
e
f
rame
w
ork
an
d
m
or
e
sp
ec
i
fically
th
e
P
age
an
d
Con
tr
ol
c
lass
es
.
The
h
and
lin
g
of
ev
e
n
ts
is
u
s
u
ally
d
one
i
n
the
co
d
e
-b
ehi
nd
class
.

Mo
del
:
AS
P
.
NET
do
es
not
strictly
requ
ire
a
mo
del.
Th
e
dev
e
lop
er
has
th
e
opt
ion
to
c
r
e
ate
a
mo
del
c
l
as
s,
bu
t
m
a
y
c
h
o
ose
to
for
go
it
and
h
a
v
e
th
e
e
v
en
t
h
andl
e
r
s
in
t
he
con
tr
oller
p
erf
orm
an
y
c
al
c
u
lation
s
and
data
p
ersiste
n
c
e.
That
said,
using
a
mo
del
to
encapsulate
b
usin
e
ss
rul
e
s
and
datab
as
e
acc
es
s
is
b
oth
p
os
sibl
e
and
p
referabl
e
.
20
3.3.
2
Windo
ws
F
orms
In
Wi
nF
orms
,
a
.NE
T
f
rame
w
ork,
th
e
p
atterns
for
t
he
v
ie
w
an
d
c
on
troll
e
r
ar
e
w
e
ll
defined.
The
mo
del
is
left
to
the
dev
e
lop
er
to
d
e
sign
.

View
:
A
class
i
nheri
ting
f
rom
e
i
ther
F
orm
or
Con
trol
hand
les
th
e
r
e
sp
on
s
i
bil
ities
of
the
view.
In
the
cas
e
of
Win
F
or
m
s,
the
View
and
Con
trol
le
r
are
compiled
in
to
the
sam
e
clas
s.
This
di
!
ers
f
rom
ASP
.Net,
wh
ic
h
use
s
i
nheri
tance
,
and
Smalltal
k,
wh
ic
h
ha
v
e
se
p
arate
c
l
as
se
s
with
p
oin
ters
to
on
e
other.

Contr
ol
ler
:
The
d
uties
of
the
con
trol
le
r
are
spli
t
b
e
t
w
e
en
three
pl
ac
es
.
The
generation
an
d
passing
of
ev
e
n
ts
s
tar
ts
at
th
e
OS
lev
e
l.
In
s
id
e
the
.Net
f
rame
w
ork,
t
he
F
or
m
and
Con
trol
clas
se
s
r
oute
th
e
e
v
en
t
to
th
e
prop
er
ev
e
n
t
h
andl
e
r
.
T
h
e
han
dli
ng
of
ev
e
n
ts
is
usuall
y
d
one
in
th
e
co
de-b
ehin
d
c
l
as
s.

Mo
del
:
Ju
s
t
lik
e
ASP
.Net,
Win
F
or
m
s
do
es
n
ot
stri
c
tly
r
e
q
uir
e
a
m
o
del.
The
d
e
v
elop
e
r
h
as
th
e
op
tion
to
create
a
m
o
del
c
l
as
s,
bu
t
m
a
y
c
ho
ose
to
forget
it
an
d
h
a
v
e
th
e
ev
e
n
t
han
dlers
in
th
e
c
on
tr
oller
p
erfor
m
an
y
c
alcul
ations
an
d
d
ata
p
ers
i
s
tence
.
Agai
n,
using
a
mo
del
to
encapsulate
busin
e
ss
ru
le
s
and
d
atabase
acc
es
s
i
s
b
ot
h
p
oss
i
ble
and
p
re
f
e
r
able.
3.3.
3
JSP
M
o
del
2
(
M
V
C
-
2)
JS
P
M
o
del
2
(or
M
V
C
2)
is
Su
n’s
attempt
t
o
wrap
Ja
v
a
S
e
r
v
e
r
P
ages
(
JSP
)
with
in
t
he
MV
C
par
adigm.
It’s
n
ot
so
so
m
uc
h
a
pr
o
du
c
t
o!
eri
ng
(
or
ev
e
n
an
AP
I
)
as
it
is
a
set
of
gui
delines
th
at
go
alon
g
with
Su
n’s
pac
k
aging
of
Ja
v
a-
b
as
ed
c
omp
on
e
n
ts
and
s
ervices
u
nd
e
r
the
um
br
e
ll
a
of
J
2EE.
The
general
stru
c
tu
re
of
a
W
e
b
ap
pli
c
ation
u
s
i
ng
the
JSP
M
o
del
2
ar
c
hi
te
ctur
e
is:
1.
Use
r
r
e
qu
e
sts
ar
e
dir
e
cted
to
t
he
con
trol
le
r
se
r
vlet.
2.
The
con
troll
e
r
s
ervlet
acc
es
se
s
requ
ired
d
ata
and
bu
ilds
th
e
mo
del,
p
oss
ib
ly
d
e
legatin
g
the
pr
o
ce
ss
in
g
to
h
e
l
p
er
c
lasse
s.
3.
The
c
on
troller
se
r
vlet
(or
the
app
ropr
iate
sub
-ordi
nate
tas
k)
se
l
e
cts
an
d
passe
s
c
on
tr
ol
to
the
app
rop
riate
JSP
resp
on
s
ib
le
f
or
pr
e
se
n
t
ing
the
view
.
4.
The
view
page
is
p
re
sen
te
d
to
th
e
requ
e
sting
u
s
er.
5.
The
u
s
er
in
teracts
with
the
c
on
tr
oller
s
ervlet
(via
the
vi
e
w)
to
en
ter
an
d
m
o
dif
y
d
ata,
tra
v
e
r
s
e
th
rough
r
e
sul
ts
e
tc.
Data
acce
ss
and
app
lication
logic
s
h
oul
d
b
e
c
on
tained
e
n
ti
rely
with
in
the
con
trol
le
r
se
rv
le
t
and
its
h
e
lp
er
class
es
.
Th
e
c
on
t
roller
s
ervlet
(or
th
e
help
e
r
clas
s)
shou
ld
s
elec
t
the
ap
pr
opri
ate
JSP
page
an
d
tr
ansfer
con
trol
to
th
at
p
age
ob
j
e
ct
b
as
ed
on
th
e
r
e
qu
e
st
p
arame
ters,
state
and
s
es
sion
in
formation
.
One
of
th
e
m
a
jor
adv
ances
that
c
ome
s
with
JS
P
Mo
d
e
l
2
i
s
S
un
’s
sp
ec
i
fication
of
the
Ja
v
a
Stan
dard
T
ak
Lib
rary
(JSTL).
It
sp
ecifies
th
e
stand
ard
s
et
of
tags
for
ite
r
ation
,
condi
tional
21
pr
o
ce
ss
in
g,
datab
as
e
ac
ce
ss
and
m
an
y
oth
e
r
f
ormattin
g
f
un
c
tion
s
.
In
ad
dition
to
th
e
gui
delin
e
s
ass
o
ciated
w
i
th
J
SP
Mo
d
e
l
2,
S
un
also
pr
o
v
ided
a
se
t
of
b
luepr
in
ts
f
or
b
uil
din
g
app
lication
usin
g
th
e
M
V
C
par
adigm.
These
b
lu
e
p
rin
ts
w
e
r
e
e
v
en
tu
ally
re
n
ame
d
th
e
J2EE
Cor
e
Patt
er
ns
.
Th
e
y
are
to
o
n
u
me
rou
s
an
d
com
p
lex
to
e
x
am
i
ne
in
d
e
tail
here,
b
ut
some
of
t
he
m
or
e
imp
ortan
t
p
atterns
are
desc
ri
b
ed
b
e
lo
w:

F
r
ont
Contr
ol
ler
:
a
m
o
du
le
(of
te
n
a
se
r
vlet)
ac
ti
ng
as
th
e
ce
n
tr
alise
d
e
n
tr
y
p
oi
n
t
in
to
a
W
e
b
ap
pli
c
ati
on,
managi
ng
reques
t
p
ro
ce
ssing,
p
erf
orming
aut
hen
tication
an
d
auth
orisation
se
rv
ic
es,
an
d
ul
timate
ly
se
l
e
ctin
g
th
e
app
rop
riate
v
ie
w.

Servic
e-T
o-Worker
and
Disp
atcher
View
:
s
tr
ate
gies
for
M
V
C
ap
pli
c
ati
on
where
the
fr
on
t
con
troll
e
r
mo
d
ule
defers
pr
o
c
es
sin
g
to
a
dispatc
her
that
i
s
se
lecte
d
base
d
on
the
requ
e
st
con
te
x
t.
In
the
Di
s
p
atc
her
Vie
w
p
attern,
th
e
d
ispatc
he
r
p
e
r
forms
s
t
atic
pro
c
es
sin
g
to
se
lect
th
e
ulti
m
ate
p
res
en
tation
v
ie
w.
I
n
th
e
Servi
c
e-
T
o-
W
ork
er
p
attern,
the
d
is
p
atc
h
e
r
’s
pr
o
c
es
sin
g
is
more
dyn
am
i
c
,
translati
ng
logical
t
as
k
names
in
to
concrete
task
mo
d
ule
re
f
e
r
e
n
c
es
,
and
allo
win
g
tasks
to
p
e
rf
orm
complex
pro
c
es
sing
th
at
d
e
termines
th
e
ult
im
at
e
prese
n
tat
ion
view
.

Inter
c
ep
ti
n
g
Fil
t
er
:
all
o
ws
for
p
luggab
le
filt
e
rs
to
b
e
i
nse
rt
e
d
in
the
“r
e
qu
e
st
p
ip
e
l
ine”
to
p
er-
for
m
pre
and
p
os
t
p
ro
ces
sing
of
in
c
oming
re
q
ues
ts
and
out
going
r
e
sp
on
s
es
.
Th
e
se

lters
c
an
p
e
r
form
c
ommon
se
rv
ic
es
r
e
q
uir
e
d
f
or
all
or
m
ost
app
lication
tasks,
i
nclud
ing
au
then
tication
and
logging.

V
al
ue
List
H
and
ler
:
a
me
c
han
is
m
for
cac
h
ing
r
e
sult
s
fr
om
d
atabase
qu
e
r
ies
,
p
res
en
tin
g
dis-
cre
t
e
subsets
of
t
hose
res
u
lts,
and
pro
vi
din
g
iterativ
e
tra
v
e
r
s
al
t
hrou
gh
th
e
se
qu
e
n
c
e
of
sub
s
ets
.

Data
A
c
c
ess
Obje
ct
(
D
A
O
)
:
A
ce
n
t
ralise
d
me
c
han
is
m
for
abstractin
g
and
encapsulat
ing
ac
-
ce
ss
t
o
c
ompl
e
x
data
sour
c
es
,
in
c
lu
di
ng
r
e
lati
onal
datab
as
es
,
LD
A
di
rec
tori
e
s
and
CORBA
bu
s
i
nes
s
ob
j
e
cts
.
The
D
A
O
acts
as
an
ad
apter,
allo
win
g
th
e
external
in
te
r
face
to
r
e
main
constan
t
e
v
en
when
the
stru
c
t
ure
of
the
u
nd
e
r
lyin
g
d
ata
s
ou
rc
es
c
hanges.
3.
4
In
tro
ducing
Apac
he
St
r
ut
s
Y
ou
ma
y
n
e
ed
to
refer
to
som
e
of
th
e
te
c
hnol
ogy
o
v
erview
and
d
e

n
tion
s
m
ateri
al
in
Chap
te
r
4
to
un
derstand
thi
s
sec
tion
.
In
part
ic
u
lar,
e
n
s
u
re
that
y
ou
u
nd
e
r
s
tan
d
what
Ja
v
a
Serv
e
r
P
ages
(
JSP
)
are
ab
ou
t.
T
h
is
se
ction
i
s
in
tend
e
d
to
f
am
i
liari
s
e
t
he
r
e
ad
e
r
with
th
e
b
as
ic
c
on
c
epts
asso
c
i
ate
d
with
th
e
Stru
ts
f
rame
w
ork.
Th
e
re
is
a
S
tru
ts
tutor
ial
e
xercise
that
will
deal
i
n
the
lo
w
e
r
lev
e
l
impl
e
me
n
tation
details.
Y
ou
shou
ld
read
this
se
ction
b
e
f
ore
lo
oking
at
th
e
tutor
ial
e
xercise
.
If
y
ou
in
t
e
n
d
installin
g
t
he
S
trut
s
framew
ork
on
y
ou
r
o
wn
P
C
,
b
e
advi
s
ed
that
w
e
are
u
s
in
g
S
tru
ts
v1.3.5.
St
ruts
2
w
as
onl
y
re
l
e
ase
d
i
n
Autu
m
n
200
6
an
d
is
in
b
eta
f
orm
at
th
e
time
of
wri
ting.
Apac
he
S
tru
ts
is
a
free,
op
en-s
ou
rc
e
framew
ork
f
or
c
reatin
g
Ja
v
a
w
eb
appl
ic
at
ions
d
e
v
elop
e
d
b
y
th
e
Apac
he
Soft
w
are
F
ou
ndat
ion.
W
eb
app
lication
s
di
!
er
f
rom
con
v
en
tion
al
w
ebsites
in
that
w
e
b
app
lication
s
can
create
a
dyn
am
i
c
r
e
sp
on
s
e.
Man
y
w
ebsites
d
e
l
iv
e
r
only
s
tati
c
p
age
s.
A
w
e
b
app
lication
can
in
teract
w
i
th
datab
as
es
an
d
bu
s
in
e
ss
logi
c
e
n
gines
to
c
u
s
t
om
ize
a
res
p
onse.
St
ruts
is
h
ighl
y
c
on
figu
rabl
e
,
and
h
as
a
lar
ge
(and
gro
wing)
f
e
atu
re
l
is
t
,
in
c
l
udi
ng
a
C
on
troll
e
r,
action
c
l
as
se
s
an
d
m
ap
pi
ngs,
uti
lit
y
c
l
as
se
s
f
or
XML,
automatic
p
opu
lation
of
se
r
v
e
r
-
side
Ja
v
aBe
an
s
,
22
W
e
b
f
orms
w
i
th
v
alidat
ion,
an
d
s
ome
in
tern
ation
alization
s
u
pp
ort.
It
als
o
in
c
lu
des
a
s
et
of
custom
tags
for
acc
es
sin
g
s
erv
er-s
i
de
state
,
creatin
g
HTML,
p
erf
orming
pres
en
tati
on
l
ogic
,
an
d
te
mpl
ating.
Some
v
end
ors
h
a
v
e
b
egun
to
adop
t
an
d
e
v
angelise
S
trut
s
.
Stru
ts
can
b
e
consid
e
red
an
in
du
s
tr
ial-
strength
framew
ork
s
u
itabl
e
f
or
lar
ge
ap
plication
s
.
But
S
tru
ts
i
s
n
ot
y
e
t
a
“stand
ard

for
wh
ic
h
J2E
E
pr
o
du
c
t
pro
vi
ders
can
i
n
te
r
op
erab
ly
an
d
reliab
ly
create
to
ols
.
The
main
attr
ac
ti
on
of
the
St
ruts
f
rame
w
ork
is
th
at
d
e
v
elop
e
rs
can
mak
e
u
s
e
of
confi
gurab
le
ap
plication
com
p
onen
ts
(e.g.
the
con
troll
e
r
se
r
vlet)
that
com
e
wit
h
the
Stru
ts
d
is
t
rib
ution
,
in
s
t
e
ad
of
h
a
vin
g
to
impl
e
me
n
t
t
hes
e
com
p
onen
ts
th
e
mse
lv
es
.
The
whol
e
app
lication
c
omes
toge
th
e
r
with
t
he
XML
configu
ration

le
names
struts-config.xml
th
at
i
s
lo
cate
d
in
the
appl
ic
at
ion’s
WEB-INF
di
rec
tor
y
.
W
e
b
app
lications
based
on
Ja
v
aS
e
r
v
e
r
P
age
s
som
etime
s
mingl
e
d
atabase
c
o
d
e
,
page
design
co
d
e
,
and
con
trol
flo
w
c
o
de.
In
p
ractice
,
w
e

nd
th
at
un
le
ss
thes
e
conce
r
ns
are
se
p
arate
d
,
larger
ap
pl
ic
ati
ons
b
e
com
e
di"c
u
lt
to
main
tain.
On
e
w
a
y
to
separate
c
on
c
erns
in
a
soft
w
are
ap
pli
c
ation
i
s
to
use
a
Mo
del-
Vi
e
w-C
on
troller
(M
V
C
)
arc
h
ite
ctu
re
.
T
h
e
S
tru
ts
f
rame
w
ork
p
ro
vid
e
s
a
rob
ust
inf
rastru
c
tu
re
for
Mo
d
e
l
2
app
lication
d
e
v
elopmen
t
using
F
ron
t
Con
tr
oller
and
S
e
r
vice
-T
o-W
or
k
e
r
p
atte
r
ns
to
pr
o
vide
a
tru
e
f
rame
w
ork
f
or
W
e
b
ap
pl
ic
ati
on
dev
elopme
n
t.
Th
e
Mo
del
represe
n
ts
the
bu
s
i
nes
s
or
d
atabase
co
de,
th
e
View
represe
n
ts
the
page
des
i
gn
co
de,
and
the
Con
troll
e
r
r
e
p
res
en
ts
the
na
vi
gational
co
de.
Be
sure
to
un
derstand
that
S
tru
ts
is
a
MV
C
fr
am
ew
or
k,
n
ot
a
c
on
tai
ner.
A
MV
C
framew
ork
can
r
e
side
in
s
i
de
a
w
e
b
con
tain
e
r,
b
ut
the
con
tain
e
r
in
its
mos
t
abstrac
t
for
m
w
i
ll
n
ot
sp
ecify
a
par
ticular
des
ign
pattern
,
al
thou
gh
som
e
c
on
t
ainers
are
i
m
p
le
men
ted
in
s
u
c
h
a
w
a
y
as
to
f
ac
il
itate
impl
e
me
n
tations
using
par
ticular
d
e
sign
p
a
t
te
r
ns.
3.4.
1
Basic
i
mpl
emen
tat
ion
detai
ls
As
Str
uts
is
in
te
n
ded
to
bu
ild
MV
C
com
p
lian
t
w
eb
app
lications,
w
e
can
c
on
s
id
e
r
th
e
fun
c
ti
onali
t
y
th
e
fr
am
ew
or
k
pro
vid
e
s
ac
cord
ing
to
the
M
V
C
des
i
gn
pattern
.
The
M
o
del
p
ortion
of
an
MV
C
-based
s
ystem
can
b
e
often
b
e
div
ided
in
to
t
w
o
ma
j
or
s
u
bsys
t
e
ms
;
the
in
t
e
rn
al
s
tate
of
the
s
yste
m
and
th
e
actions
that
c
an
b
e
tak
en
to
c
h
ange
th
at
s
tate.
In
grammatic
al
terms
,
w
e
migh
t
th
ink
ab
out
s
tate
i
nf
ormation
as
nou
ns
(th
ings)
and
actions
as
v
erb
s
(c
h
anges
to
th
e
s
tat
e
of
those
th
ings).
Man
y
ap
pli
c
ati
ons
r
e
p
re
sen
t
t
he
in
te
r
nal
state
of
th
e
s
y
s
tem
as
a
s
et
of
one
or
more
Ja
v
aBe
an
s
.
The
b
e
an
prop
erties
re
p
res
en
t
th
e
details
of
t
he
s
ystem

s
tate.
Dep
e
n
din
g
on
y
ou
r
ap
pli
c
ation
’s
com
p
le
x
it
y
,
t
hes
e
b
eans
ma
y
b
e
self
c
on
tained
(an
d
kno
w
ho
w
to
p
e
r
s
ist
their
o
wn
s
tat
e
),
or
th
e
y
ma
y
b
e
f
ac
ad
e
s
th
at
kn
o
w
ho
w
to
r
e
tr
ie
v
e
th
e
s
ystem

s
state
fr
om
anoth
e
r
c
omp
onen
t.
T
h
is
com
p
onen
t
ma
y
b
e
a
d
atabase
,
a
s
earc
h
engin
e
,
an
E
n
tit
y
E
n
terp
rise
Ja
v
aB
ean,
a
LD
AP
serv
e
r
,
or
som
ethi
ng
e
lse
en
tir
e
ly
.
Large-s
cale
app
lication
s
will
often
repr
e
se
n
t
th
e
s
et
of
p
oss
i
ble
busin
e
ss
op
e
rati
ons
as
metho
d
s
th
at
can
b
e
ca
l
le
d
on
th
e
b
e
an
or
b
eans
main
tain
ing
th
e
state
i
nf
orma
t
ion.
F
or
e
x
am
p
le
,
y
ou
m
i
gh
t
ha
v
e
a
shop
pi
ng
cart
b
ean,
stored
i
n
ses
sion
s
cop
e
for
e
ac
h
cur
ren
t
u
s
er,
with
pr
op
erties
th
at
repr
e
se
n
t
th
e
c
u
rren
t
s
et
of
item
s
th
at
the
u
s
er
has
d
e
cided
to
pu
rc
h
as
e.
Th
is
b
e
an
migh
t
also
h
a
v
e
a
checkOut()
me
th
o
d
that
au
thor
ize
s
the
u
s
er’s
credit
card
and
se
n
ds
the
or
der
to
th
e
w
ar
e
h
ouse
to
23
b
e
p
ic
k
ed
and
s
h
ipp
ed.
Oth
e
r
syste
ms
w
i
ll
repr
e
se
n
t
t
he
a
v
ailab
le
op
eration
s
se
p
arately
,
p
e
r
hap
s
as
Sess
ion
E
n
terpr
is
e
Ja
v
aBe
an
s
(Sess
ion
E
JB
s).
I
n
a
s
mall
e
r
sc
ale
ap
pli
c
ati
on,
on
th
e
other
han
d,
the
a
v
ailabl
e
op
eration
s
m
igh
t
b
e
e
m
b
edd
e
d
withi
n
th
e
Action
clas
se
s
th
at
ar
e
p
art
of
th
e
framew
ork
con
trol
la
y
e
r
.
This
c
an
b
e
use
f
ul
when
the
logi
c
is
v
e
r
y
simpl
e
or
wh
e
re
re
u
s
e
of
th
e
bu
s
i
nes
s
logic
in
oth
e
r
en
viron
me
n
ts
i
s
n
ot
con
tem
p
lated.
T
h
e
fr
am
ew
or
k
arc
hit
e
ctur
e
i
s

e
x
ibl
e
enou
gh
to
supp
ort
mos
t
an
y
ap
pr
oac
h
to
acc
es
sin
g
the
M
o
del,
bu
t
w
e
s
tr
ongly
rec
omme
n
d
th
at
y
ou
se
p
arate
th
e
bu
s
in
e
ss
logi
c
(“ho
w
it’s
d
one”)
from
the
r
ole
th
at
Action
class
es
p
la
y
(“wh
at
t
o
d
o”).
The
Vie
w
p
orti
on
of
a
S
tru
ts
-base
d
app
lication
i
s
mos
t
of
ten
c
on
s
t
ructed
usin
g
Ja
v
aS
e
r
v
e
r
P
age
s
(JS
P)
tec
hn
ology
.
JSP
pages
c
an
c
on
t
ain
static
HTML
(or
XM
L)
te
x
t
called
“template
te
x
t”,
pl
us
th
e
abil
it
y
t
o
in
s
ert
dy
namic
con
ten
t
b
as
ed
on
th
e
in
terp
re
t
ation
(at
page
r
e
qu
e
st
time
)
of
s
p
ec
ial
action
t
ags
.
The
JS
P
en
vir
onme
n
t
inclu
des
a
se
t
of
stand
ard
ac
tion
tags,
suc
h
as
<jsp:useBean>
whose
p
urp
ose
is
des
crib
e
d
in
th
e
Ja
v
aServ
er
P
ages
Sp
ec
ifi
c
ati
on.
In
ad
di
tion
to
th
e
bu
ilt-in
ac
tion
s
,
th
e
re
is
a
s
tan
dar
d
facilit
y
to
d
e
fin
e
y
ou
r
o
wn
tags,
whic
h
are
or
ganize
d
in
to
“c
u
s
tom
tag
libr
aries
.

The
fr
am
ew
ork
i
nc
l
ud
e
s
a
se
t
of
custom
tag
li
brar
ie
s
th
at
facili
tate
c
r
e
atin
g
u
s
er
in
te
r
face
s
that
are
fu
lly
in
te
r
nation
alize
d
an
d
in
teract
gr
ac
efu
lly
with
ActionForm
b
e
an
s
.
Ac
ti
on
F
orms
captu
re
an
d
v
alid
ate
whatev
e
r
i
npu
t
is
requ
ired
b
y
th
e
app
lication.
St
ruts
pr
o
v
ides
th
e
Con
trol
le
r
p
ort
ion
of
th
e
app
lication
.
The
Con
tr
oller
is
f
o
cuse
d
on
re
ceivin
g
requ
e
sts
fr
om
th
e
c
li
e
n
t
(t
yp
ically
a
us
er
ru
nn
ing
a
w
eb
bro
wse
r)
,
dec
i
din
g
wh
at
b
usiness
logic
fu
nction
is
t
o
b
e
p
erf
orme
d
,
and
t
he
n
delegating
r
e
sp
onsibil
it
y
for
pr
o
du
c
in
g
the
next
p
hase
of
th
e
use
r
in
te
r
face
to
an
app
ropr
iate
View
com
p
on
e
n
t.
The
primary
comp
on
e
n
t
of
th
e
Con
trol
le
r
in
the
fr
am
ew
or
k
is
a
s
ervl
e
t
of
c
l
as
s
ActionServlet
.
This
se
rv
le
t
is
confi
gur
e
d
b
y
defin
in
g
a
s
et
of
Ac
ti
onMap
pin
gs
.
An
Action
Map
pin
g
defin
e
s
a
p
ath
t
hat
i
s
matc
h
e
d
again
s
t
the
request
URI
of
the
incoming
r
e
q
ues
t
an
d
u
s
u
ally
s
p
e
cifi
e
s
the
f
ully
qual
ified
class
n
ame
of
an
Action
clas
s.
All
Ac
tion
s
are
s
u
b
class
ed
f
rom
org.apache.struts.action.Action
.
Action
s
encapsulat
e
calls
to
bu
s
in
e
ss
logi
c
c
lasse
s,
i
n
te
r
pret
the
ou
tcom
e,
an
d
ul
timate
ly
d
is
p
atc
h
con
tr
ol
t
o
th
e
app
ropr
iate
View
com
p
onen
t
to
c
reate
th
e
res
p
onse.
Wh
ile
th
e
fr
am
ew
ork
dispatc
hes
to
a
View,
ac
t
ually
rend
e
r
ing
th
e
Vie
w
is
ou
ts
i
de
i
ts
s
cop
e
.
The
framew
or
k
als
o
sup
p
or
ts
th
e
ab
ilit
y
to
u
s
e
Ac
ti
onMap
pin
g
c
lasse
s
that
h
a
v
e
add
ition
al
prop
er-
ties
b
ey
ond
th
e
stan
dard
ones
requi
re
d
to
op
erate
th
e
con
tr
oller.
T
h
is
allo
ws
y
ou
t
o
s
tor
e
addi
tional
in
formation
sp
e
cific
to
y
our
ap
pli
c
ation
an
d
s
ti
ll
util
iz
e
th
e
remainin
g
f
e
atu
res
of
the
f
rame
w
ork.
In
addi
tion,
th
e
framew
ork
lets
y
ou
d
e

ne
logi
c
al
“name
s”
to
wh
ic
h
con
trol
s
h
ould
b
e
forw
ard
e
d
so
that
an
ac
t
ion
me
t
ho
d
c
an
as
k
for
t
he
“Main
Men
u”
p
age
(f
or
example),
wit
hout
kno
wing
the
lo
cation
of
th
e
corres
p
ond
in
g
J
SP
p
age
.
Thes
e
featur
e
s
gre
at
ly
as
sist
y
ou
in
s
epar
ating
th
e
con
trol
logic
(what
to
d
o)
w
i
th
the
view
logi
c
(ho
w
it’s
r
e
n
dere
d
).
The
fr
am
ew
or
k
pr
o
vides
s
ev
e
r
al
com
p
onen
ts
that
m
ak
e
up
the
Con
tr
ol
la
y
e
r
of
a
MV
C
-st
y
le
ap-
pl
ic
at
ion.
Thes
e
inclu
de
a
c
on
t
roller
com
p
on
e
n
t
(
s
ervlet),
dev
e
lop
er-defin
e
d
re
q
ues
t
h
and
le
r
s
,
and
se
v
eral
s
u
pp
orti
ng
ob
jec
ts.
The
S
tru
ts
Taglib
com
p
onen
t
pro
vi
des
dir
e
ct
sup
p
or
t
f
or
the
View
l
a
y
er
of
a
MV
C
appl
ic
at
ion.
Some
of
thes
e
t
ags
ac
ce
ss
th
e
con
trol-la
y
er
ob
jec
ts.
Ot
hers
are
ge
n
e
r
ic
tags
f
oun
d
c
on
v
e
n
ie
n
t
wh
e
n
writi
ng
app
lication
s
.
Oth
e
r
t
aglibs,
includ
ing
J
STL,
c
an
also
b
e
use
d
with
th
e
f
rame
w
ork.
Oth
e
r
pr
e
se
n
tation
tec
h
nologi
e
s,
lik
e
V
e
l
o
c
i
t
y
T
e
mplat
e
s
an
d
XSL
T
can
also
b
e
use
d
with
the
f
rame
w
ork.
24
The
Mo
del
la
y
er
i
n
a
MV
C
ap
plication
is
of
te
n
p
ro
j
e
ct-s
p
e
cifi
c
.
The
fr
am
ew
or
k
i
s
d
e
sign
e
d
to
mak
e
it
e
asy
t
o
ac
ces
s
th
e
busin
e
ss
-e
n
d
of
y
our
app
lication,
b
ut
l
e
a
v
es
that
part
of
the
p
rogramming
to
oth
e
r
pro
ducts,
li
k
e
J
DB
C,
E
n
terp
rise
J
a
v
a
Be
an
s
,
Ob
j
e
ct
Re
l
ational
B
r
idge,
or
iBA
TIS,
to
name
a
few
.
Let’s
ste
p
t
hrou
gh
ho
w
t
his
al
l
fits
togeth
e
r.
Wh
e
n
in
itial
iz
ed,
the
con
tr
oller
p
arse
s
a
c
on
figu
ration

le
(
struts-config.xml
)
and
uses
it
t
o
depl
o
y
ot
her
c
on
t
rol
la
y
e
r
ob
jec
ts.
T
ogether,
thes
e
ob
jec
ts
form
the
Str
uts
C
on
figu
ration
.
The
Confi
gurat
ion
defin
e
s
(
am
on
g
oth
e
r
t
hin
gs
)
the
ActionMappings
(
org.apache.struts.action.ActionMappings
)
for
an
ap
pli
c
ati
on.
The
c
on
tr
oller
c
omp
onen
t
c
on
s
u
lts
th
e
ActionMappings
as
i
t
r
outes
HTTP
reques
t
s
to
other
c
om-
p
onen
ts
in
the
f
rame
w
ork.
Reques
ts
m
a
y
b
e
for
w
ard
e
d
to
Ja
v
aServ
er
P
ages
or
Action
(
org.apache.struts.action.Action
)
sub
c
lasse
s
pro
vi
ded
b
y
th
e
ap
pli
c
ation
dev
e
l
op
er.
Of
te
n
,
a
request
is
first
forw
ard
e
d
to
an
Action
and
t
hen
to
a
JSP
(or
other
pres
en
tati
on
page).
The
map
pin
gs
help
th
e
c
on
troll
e
r
tu
rn
HTTP
reques
ts
in
to
app
lication
actions.
An
i
nd
ivid
ual
ActionMapping
(
org.apache.struts.action.ActionMapping
)
will
usually
c
on
tai
n
a
n
um
b
er
of
p
rop
erti
e
s
i
nclud
ing:

a
reques
t
p
ath
(or
“URI”),

th
e
ob
jec
t
t
yp
e
(
Action
sub
c
lass)
to
act
u
p
on
the
r
e
qu
e
st,
and

oth
e
r
p
rop
e
rt
ie
s
as
nee
d
e
d
.
The
Action
ob
jec
t
c
an
han
dle
the
requ
e
st
and
res
p
ond
to
th
e
clien
t
(u
s
u
ally
a
W
eb
b
ro
ws
er)
or
in
dicate
th
at
c
on
tr
ol
s
h
ould
b
e
f
orw
ard
e
d
else
where.
F
or
example,
if
a
login
succ
ee
d
s
,
a
login
action
ma
y
wish
to
forw
ard
the
requ
e
st
on
to
th
e
m
ain
Men
u
page.
Action
ob
jec
t
s
h
a
v
e
acc
es
s
to
the
ap
pl
ic
ati
on’s
con
tr
oller
c
omp
on
e
n
t,
and
so
ha
v
e
acc
es
s
to
th
at
mem
b
e
r
s
’s
metho
d
s
.
Wh
e
n
for
w
ar
din
g
c
on
trol,
an
Action
ob
j
e
ct
can
in
di
re
ctly
forw
ard
one
or
more
shared
ob
j
e
cts
,
inclu
din
g
Ja
v
aB
eans,
b
y
placin
g
them
in
one
of
the
stand
ard
c
on
te
xt
s
shar
e
d
b
y
Ja
v
a
Servlets.
F
or
e
x
am
p
le
,
an
Action
ob
jec
t
c
an
c
r
e
ate
a
shop
pin
g
c
ar
t
b
e
an
,
ad
d
an
item
to
th
e
cart,
p
lac
e
th
e
b
e
an
in
the
se
ss
ion
con
text,
and
th
e
n
f
orw
ar
d
c
on
tr
ol
t
o
anoth
e
r
mapp
ing.
That
m
ap
pi
ng
ma
y
u
s
e
a
Ja
v
aS
e
r
v
e
r
P
age
to
di
s
pl
a
y
th
e
c
on
te
n
t
s
of
the
u
s
er’s
cart.
S
in
c
e
eac
h
clie
n
t
h
as
their
o
w
n
ses
sion,
t
hey
will
eac
h
also
h
a
v
e
their
o
wn
s
h
opp
ing
cart.
Most
of
th
e
b
usines
s
logic
in
an
ap
pl
ic
ati
on
can
b
e
repr
e
se
n
t
e
d
u
s
i
ng
Ja
v
aB
eans.
An
A
ction
c
an
call
th
e
p
rop
e
r
ties
of
a
Ja
v
aBe
an
withou
t
kn
o
win
g
h
o
w
i
t
ac
tu
ally
w
or
ks
.
This
encapsulates
the
bu
s
i
nes
s
l
ogic
,
so
t
hat
the
Ac
tion
c
an
f
o
c
u
s
on
error
h
and
lin
g
an
d
where
to
for
w
ard
c
on
tr
ol.
Ja
v
aB
eans
c
an
also
b
e
used
to
manage
in
put
forms.
A
k
ey
pr
oblem
i
n
d
e
signi
ng
W
e
b
app
lications
is
retain
ing
an
d
v
al
idati
ng
what
a
use
r
h
as
en
tere
d
b
et
w
ee
n
reques
ts.
Y
ou
can
defin
e
y
our
o
wn
se
t
of
in
pu
t
b
e
an
class
es
,
b
y
sub
c
l
as
sing
ActionForm
(
org.apache.struts.action.ActionForm
).
Th
e
ActionForm
clas
s
mak
es
it
eas
y
to
s
tor
e
and
v
alid
ate
the
d
ata
f
or
y
our
app
lication
’s
inp
ut
for
m
s.
25
The
ActionForm
b
e
an
is
au
tomatic
al
ly
sa
v
ed
i
n
on
e
of
the
s
tan
dard
,
s
h
ared
con
text
colle
ction
s
,
so
th
at
i
t
can
b
e
use
d
b
y
other
ob
jec
ts,
lik
e
an
Action
ob
jec
t
or
an
other
JSP
.
The
form
b
e
an
can
b
e
u
s
ed
b
y
a
JS
P
to
collec
t
d
ata
from
the
use
r
b
y
an
Action
ob
jec
t
t
o
v
ali
date
th
e
user-e
n
tered
d
ata
and
th
e
n
b
y
th
e
JS
P
again
to
re-
p
opu
late
t
he
f
orm
fields.
In
the
c
ase
of
v
alid
ation
error
s
,
th
e
f
rame
w
ork
h
as
a
s
h
ared
me
c
h
anism
for
rai
s
in
g
and
d
ispla
yin
g
e
r
ror
me
ss
ages
.
Anot
her
e
leme
n
t
of
th
e
Confi
gurati
on
are
th
e
ActionFormBeans
(
org.apache.struts.action.ActionFormBeans
).
Th
is
is
a
c
ol
le
ction
of
d
e
sc
r
iptor
ob
j
e
cts
that
are
use
d
to
create
in
s
tan
c
es
of
th
e
ActionForm
ob
jec
t
s
at
run
time
.
Wh
e
n
a
mapp
ing
n
e
eds
an
ActionForm
,
th
e
s
erv
le
t
lo
ok
s
up
the
f
orm-
b
ean
des
crip
tor
b
y
n
am
e
an
d
use
s
i
t
to
c
r
e
ate
an
ActionForm
in
s
tan
c
e
of
the
sp
e
cified
t
yp
e
.
Here
is
the
se
q
uence
of
ev
e
n
t
s
t
hat
o
c
cur
when
a
reques
t
c
all
s
for
an
mapp
in
g
that
use
s
an
ActionForm
:

The
con
tr
oller
s
ervlet
e
i
ther
retriev
e
s
or
c
reates
the
ActionForm
b
e
an
i
nstance
.

The
c
on
t
roller
se
r
vlet
pass
es
th
e
b
ean
to
th
e
Action
ob
jec
t
.
If
t
he
re
q
ues
t
is
b
e
in
g
use
d
to
submit
an
i
npu
t
page,
t
he
Action
ob
jec
t
can
e
x
am
i
ne
th
e
d
ata.
If
nec
ess
ary
,
the
d
ata
c
an
b
e
se
n
t
bac
k
to
the
i
npu
t
f
orm
alon
g
with
a
list
of
me
ss
ages
to
d
ispla
y
on
t
he
page.
Oth
e
r
w
i
s
e
th
e
data
can
b
e
pass
ed
along
to
the
busin
e
ss
tier.

If
the
requ
e
st
is
b
eing
use
d
to
create
an
inp
ut
page,
the
Action
ob
jec
t
c
an
p
opu
late
th
e
b
ean
with
an
y
d
ata
that
the
inp
ut
page
m
igh
t
n
e
ed.
The
Str
uts
T
agli
b
com
p
onen
t
pro
vid
e
s
custom
tags
t
hat
can
au
tomatic
al
ly
p
opu
late
field
s
f
rom
a
J
a
v
aBe
an
.
All
m
ost
Ja
v
aServ
er
P
age
s
r
e
all
y
n
e
ed
to
kn
o
w
is
th
e
field
name
s
to
use
and
where
to
sub
m
i
t
th
e
f
orm.
O
ther
tags
can
au
tomatic
al
ly
ou
tpu
t
me
ss
ages
queued
b
y
an
Action
or
ActionForm
and
s
i
m
p
ly
n
e
ed
to
b
e
i
n
te
gr
ate
d
in
to
th
e
p
age

s
marku
p.
T
h
e
mes
sage
s
are
des
ign
e
d
for
l
o
c
al
iz
ati
on
and
wil
l
r
e
n
der
the
b
es
t
a
v
ailabl
e
me
ss
age
f
or
a
use
r’
s
lo
cale.
The
f
rame
w
ork
an
d
Str
uts
T
aglib
w
e
r
e
des
i
gned
fr
om
the
groun
d-up
to
sup
p
or
t
the
i
n
te
r
nati
on-
alization
features
bui
lt
in
to
th
e
Ja
v
a
plat
form.
Al
l
the
field
l
ab
els
an
d
me
ssage
s
c
an
b
e
re
t
riev
e
d
fr
om
a
m
es
sage
re
sour
c
e.
T
o
p
ro
vid
e
me
ssage
s
for
anoth
e
r
langu
age
,
s
i
m
p
ly
ad
d
an
other

le
to
th
e
r
e
source
bu
ndl
e
.
I
n
te
r
nation
alism
as
id
e
,
oth
e
r
b
enefits
to
th
e
m
es
sage
re
sour
c
es
app
roac
h
are
consis
ten
t
l
ab
elin
g
b
et
w
ee
n
for
m
s,
and
the
abi
lit
y
to
r
e
vi
e
w
all
lab
els
and
m
es
sages
f
rom
a
c
en
tral
lo
cation
.
F
or
th
e
simpl
e
st
app
lication
s
,
an
Action
ob
jec
t
m
a
y
s
ome
ti
m
es
han
dle
th
e
b
usiness
l
ogic
as
so
c
i
ate
d
with
a
reques
t.
Ho
w
e
v
er,
in
mos
t
cas
es,
an
Action
ob
jec
t
s
h
ould
in
v
ok
e
anoth
e
r
ob
jec
t,
u
s
u
ally
a
Ja
v
aB
ean,
t
o
p
e
r
form
t
he
actual
bu
s
in
e
ss
logic.
Thi
s
le
ts
the
Action
fo
c
u
s
on
e
rr
or
hand
lin
g
an
d
con
trol
flo
w,
rather
t
han
busin
e
ss
logic
.
T
o
allo
w
reuse
on
other
p
latf
orms
,
b
usines
s-logic
Ja
v
aBeans
shoul
d
n
ot
refer
t
o
an
y
W
eb
ap
plication
ob
jec
t
s
.
Th
e
Action
ob
jec
t
s
h
ould
tran
s
l
ate
n
e
eded
details
fr
om
the
HTTP
reques
t
and
pass
those
alon
g
to
t
he
bu
s
i
nes
s-
l
og
i
c
b
eans
as
regul
ar
Ja
v
a
v
ari
ables
.
In
a
datab
as
e
ap
pli
c
ati
on,
for
example:
26

A
bu
s
in
e
ss
-logi
c
b
ean
will
conn
e
ct
t
o
an
d
query
th
e
datab
as
e,

The
b
usin
e
ss
-logic
b
ean
retur
ns
th
e
res
u
lt
to
the
Action
,

The
Action
stores
the
re
sul
t
i
n
a
f
orm
b
ean
in
th
e
request,

The
J
a
v
aS
e
rv
er
P
age
d
ispla
ys
t
he
r
e
sult
in
a
HTML
for
m
.
Neither
the
Action
n
or
the
JS
P
nee
d
to
kn
o
w
(or
care
)
f
rom
where
th
e
res
u
lt
c
omes
.
T
h
e
y
j
ust
need
to
k
no
w
h
o
w
to
pac
k
age
an
d
di
s
p
la
y
it.
3.4.
2
Struts
and
E
n
t
er
prise
J
a
v
a
Beans
This
s
u
b-s
ec
t
ion
is
a
not
e
for
ad
v
an
c
ed
p
rogramme
rs!!
Don
’t
w
or
ry
if
y
ou
d
on’t
u
nderstand
the
iss
u
e
r
ais
ed
h
e
re
y
e
t
.
W
e
ha
v
e
men
tioned
so
far
th
at
res
u
lts
a
v
ailab
le
in
th
e
St
ruts
view
la
y
e
r
ar
e
in
th
e
for
m
of
ActionForm
b
e
an
s
.
Th
is
is
not
qui
te
th
e
whole
s
tor
y
.
It
is
t
rue
that
the
view
la
y
er
s
end
user
inp
ut
d
ata
to
t
he
con
tr
oller
thr
ough
ActionForm
(or
it
s
v
arian
t
)
b
eans,
but
comm
un
ication
can
als
o
b
e
ac
complished
b
y
an
y
r
e
qu
e
st
or
s
es
sion
par
am
eters.
If
y
ou
ar
e
using
EJ
B
2.1
thi
s
c
an
b
e
d
angerous,
b
ut
i
n
EJ
B
3.
0
detac
h
e
d
e
n
ti
t
y
b
e
an
s
are
j
ust
Plai
n
Ol
d
Ja
v
a
Ob
jec
t
s
(P
OJOs)
th
at
are
d
is
conn
e
cted
f
rom
th
e
E
JB
p
e
rsiste
n
c
e
la
y
er.
Chan
ging
them
do
es
not
c
han
ge
an
yth
ing
in
the
app
lication
bac
k
end
.
I
n
c
ase
a
sub
s
et
of
p
rop
e
r
ties
or
a
d
e
tac
hed
en
tit
y
b
e
an
is
re
q
uir
e
d
,
it
os
go
o
d
practice
to
c
r
e
ate
a
v
alu
e
ob
jec
t,
whi
c
h
is
ess
en
tiall
y
a
P
OJO
c
on
taini
ng
only
th
e
pr
op
erti
e
s
requ
ired
with
their
v
alu
e
s
copi
e
d
f
rom
t
he
en
tit
y
b
e
an
.
3.
5
Refer
ences
and
further
r
eading
Busc
hman
n,
F.
,M
e
u
nier,
R.
,
Rohnert,
H.,
Somme
r
lad,
P
.
and
Stal,
M
.
(1996).
“P
attern-Or
ie
n
te
d
Sof
t
w
ar
e
Arc
hitec
tu
re”.
John
Wi
le
y
an
d
Son
s
.
ISBN
0-
471-95869-7.
Sh
klar
,
L.
and
Ros
en,
R.
(2003).
“W
e
b
Appl
ic
at
ion
Arc
hit
e
ctur
e
:
P
rin
c
i
ples
,
P
roto
c
ols
and
Prac-
tice
s”.
John
W
iley
an
d
Son
s
.
IS
DN
0-471-48656-
6.
Bo
do!,
S.,
G
re
en,
D.
,
Haase,
K
.,
Je
n
dr
o
c
k,
E
.,
P
a
w
l
an,
M.
an
d
Stearn
s
,
B.
(
2002).
“Th
e
J2EE
T
u
torial”.
Ad
dison
W
esle
y
.
http://www.oracle.com/technology//sample
code/tech/java/j2ee/jintdemo/tutorials/Struts.
html
http://struts.apache.org/1.3.5/userGuide/index.html
27