View Feed
Java Developers
Community of Java Developers: Get Java Programming Help from fellow Java Developers across the world.
650 Members
Join this group to post and comment.
csiscool • Apr 11, 2010

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

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 ??
sookie • Apr 11, 2010
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
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

Share this content on your social channels -