1. Home >
  2. Apps >
  3. Groups >

can anybody explain about the model view controller in Java with example.,?

Question asked by csiscool in #Java on Apr 11, 2010
csiscool · Apr 11, 2010
Rank C2 - EXPERT
can anybody explain about the model view controller in Java with example.,? it is so confused for me..I referred sun blueprints but it is not so clear.

Model ; it deals with database?
View ; presentation logic oriented ?
Controller ; business logic oriented ?? Posted in: #Java
sookie · Apr 11, 2010
Rank C1 - EXPERT
Let me try to explain the stuff with the basic architecture (let's forget about MVC for the time being).
A typical web architecture looks like below

Even in above picture, sometimes Model is also missing. Everything is quite clear in above picture. User request is directly processed.

Now let's see how a Web MVC looks like
In above diagram the client request is intercepted by a servlet( A controller). It handles the inital processing request and determines which JSP(View) page to display .

Now Please tell your exact confusion . 😀
savitha_chandu · Apr 15, 2010
Rank D2 - MASTER
I'll give you an overview of the components of the Model View Controller design pattern.
- Model : these are the javabeans with their properties and methods (the getters, setters and constructors). The javabeans correspond to the concepts the users of your web application will use. For example, if your web application sells products, you will certainly have the following java beans : product, customer, order, invoice.
You could say that this is the heart of the business layer.
- View : these are the java server pages (JSP's). The JSP's only take care of the presentation of the data.
Therefor you can call this the presentation layer.
- Controller : this is the very heart of the application. Since a web application works with request - response, there must be a program able to catch every request and to formulate a response on it. This is the controller or servlet.

try out this link may be it can help you.
Java SE Application Design With MVC

You must log-in or sign-up to reply to this post.

Click to Log-In or Sign-Up