I'm still confused about where JavaScript code sits in the MVC pattern when building a web application. I thought it worked like this.
- The Model is the database and the classes required to get the data in/out.
- The Controller would be the Classes where I write my logic that is, Java servlets, which accept an Ajax request and then make a call to the database;
- The View is the JSP page which is returned to the Ajax request via the servlet (my Controller)
Because JavaScript code is compiled in the browser I think of it as part of the View, but it's handling user inputs, making server requests based on those events and then returning the data to page, so would that also make in part of the Controller?
Also, what does it mean when they refer to the Domain Model in MVC?