0% found this document useful (0 votes)
16 views12 pages

Understanding MVC Architecture in Web Apps

The document discusses MVC architecture and its key components. It provides examples of how MVC is used in web applications using servlets and JSPs. It also provides a practical example of an MVC-based cake ordering application with the model representing the cake, view representing the decorators, and controller directing the flow. Finally, it discusses the Spring MVC framework and its components like handler mapping, controller, model, and view resolver.

Uploaded by

Tripathi Pramod
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views12 pages

Understanding MVC Architecture in Web Apps

The document discusses MVC architecture and its key components. It provides examples of how MVC is used in web applications using servlets and JSPs. It also provides a practical example of an MVC-based cake ordering application with the model representing the cake, view representing the decorators, and controller directing the flow. Finally, it discusses the Spring MVC framework and its components like handler mapping, controller, model, and view resolver.

Uploaded by

Tripathi Pramod
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

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

You might also like