MVC ARCHITECTURE
Pramod Tripathi
Computer Department
INTRODUCTION
MODEL
Introduction
SERVLET
SERVLET
SERVLET
Consider it a web application having
multiple servlets and running on
some web servers.
Introduction
JSP
JSP
JSP
Consider it a web application having
multiple servlets and running on
some web servers.
Introduction
HTML Code embedded
in JAVA code
JAVA code embedded
into HTML code
A Typical Servlet
A Typical JSP Page
Introduction
Presentation
Introduction
Model
Introduction
View
Some Business
Services producing
model
Model
Controller
Some Business
Services producing
model
Some Business
Services producing
model
I decorate
with fruits and
can write in
English
Practical Example
I decorate
with cream
and can write
in Gujarati
Cake without
decoration
Room having a
machine to
prepare Vanilla
cake
Request
Customer
Room having a
machine to
prepare chocolate
cake
Controller
Model cake without decoration prepared by
specific web service
View Each cake decorator who presents the
cake in the way customer wants
Controller Directs the flow.
Room having a
machine to
prepare
Strawberry cake
PUZZLE
Modi ji went to rahul gandhi to buy a bycle
of rs 500.
He gave 1000 note , rahul was not having
change so he sent note to kejariwal
Kejariwal gave 2 notes of 500 each.
Rahul gandhi returned note to modi ji.
Modi ji note was fake so kejariwal asked to
return money.
Rahul gandhi gave back another 1000
rupees note.
Find total loss of Rahul gandhi.
Spring MVC
[Link]
me/web-pageName
It will scan the URL: and tells the exact
address of the guy who can generate data
for the web page request
Handler
It prepares data, creates a
Mapping
java object to hold this
data(it may take help of
other java classes if required
to do this job)
Front
Request Controller
Response
Final
Respon
se
Data
Generato
Java Object holding data
+
r
name of the component which
is going to retrieve data from
this java object that has to be
mixed with html to prepare
actual response
View
Resolver
Spring MVC
Handler
Mapping
[Link]
me/web-pageName
Dispatcher Servlet in
spring MVC
Framework
Controlle
r
ModelJava
object holding
data
Customer
View
View
Resolver