Murali
Murali

Reputation: 319

how to create mvc based application without using framework

Struts, Spring and a few other frameworks implement the MVC architecture to separate the representation of information from the user's interaction with it.

Can any one explain or give me a link for that in Java EE?

Without using a framework, how can I create an MVC application and what are the design patterns needed for that?

Upvotes: 9

Views: 19094

Answers (6)

Sushil Deshmukh
Sushil Deshmukh

Reputation: 114

You can use Servlets and JSP directly. For managing Java EE applications we are using design patterns.

MVC-1 and MVC-2 are design patterns for managing the UI layer. Struts and Spring-MVC are implementations of the MVC-2 design pattern.

Upvotes: 1

Mike Braun
Mike Braun

Reputation: 3769

To answer you first question: the part of the Java EE framework that implements MVC is called JSF. This provides templates, graphical components (widgets) and much more.

To answer your second question: you don't really build an MVC app without any framework. You may be using Servlets and JSP, but that too is a framework. Java EE in its entirety is a (full stack) framework as well.

As for the third question: this is simple, the design pattern to use for MVC is MVC.

Upvotes: 0

Ankur Lathi
Ankur Lathi

Reputation: 7836

MVC stands for Model View and Controller. It is a design pattern that separates the business logic, presentation logic and data.

  • Controller acts as an interface between View and Model. Controller intercepts all the requests.
  • Model represents the state of the application i.e. data.
  • View represents the presentaion.

This link contains an example to implement it with JSP and Servelet.

Upvotes: 1

Prasad Kharkar
Prasad Kharkar

Reputation: 13556

I think this is a good tutorial on Creating MVC architecture with servlets and jsp

The main concern in creating MVC architecture is the separation of concerns. You need to separate business layer, presentation layer and controler layer

  • Model layer is achieved by simple POJO
  • View layer i.e. Presentation layer can be achieved by JSP
  • Controllers can be achieved by servlets in java ee

Upvotes: 3

Bilbo Baggins
Bilbo Baggins

Reputation: 3019

you can use Servlet and Jsp to create a MVC application without using any framework,

here are some useful links, http://forum.codecall.net/topic/72183-mvc-application-in-java/

another useful example,

http://css.dzone.com/articles/web-mvc-java

Upvotes: 3

Related Questions