9

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?

1
  • Reading this thread and this link might help you. Commented Aug 21, 2013 at 9:52

6 Answers 6

7

Take a look at this presentation, which is part of Beginning & Intermediate Servlet & JSP Tutorials on http://www.coreservlets.com/

Sign up to request clarification or add additional context in comments.

Comments

3

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

Comments

3

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

Comments

1

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.

Comments

1

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.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.