So A typical Java web application which follows MVC architecture goes like this.
A controller which is a servlet is going to deal with the business logic.The controller is also going to responsible for handling the request from a view and gathering data from a model and processing those data to a view(JSP page).
A view will be a JSP or an HTML page which takes care of the presentation layer.In the view, we are only going to put the UI code and we should try to avoid writing java code inside a view.(If not necessary).So no more large scriptlet code inside the JSP.
To get the data from the model we can write a simple class which will talk to the model and will get the data from the database and passes those data to the controller and the controller further passes those data to the view.
Once we are ready with this concept we are going to develop a complete java ee application using MVC.So before we go further building a web MVC project in Java, we should keep these things in mind(controller - business logic, view - UI code, model - Database related code).
Access the complete playlist with below link :
MVC in java complete playlist with theory
MVC in java complete playlist(Only project)
subscribe to my channel by clicking on the link below.
Stay tuned and like my Facebook page for more.
credits : -
Adventures by A Himitsu https://soundcloud.com/a-himitsu
Creative Commons — Attribution 3.0 Unported— CC BY 3.0
Music released by Argofox https://youtu.be/8BXNwnxaVQE
Music provided by Audio Library https://youtu.be/MkNeIUgNPQ8
NCM Epic Music Ender Guney
intro template :
#mvc #servlet #jsp #jdbc