Previous Lecture Lecture 34 Next Lecture

Lecture 34, Thu 03/05

MVC and GET vs POST vs. all the others

MongoDB ArchivedCourse table

Model View Controller

Now that we have some Spring Boot experience, and in anticipation of the final, let’s review Model View Controller

In a web app, Controllers typically:

An important principle: Don’t do too much computation in the View!

If you are writing really complicated code in Thymeleaf, you are probably doing something wrong

Consider moving the complicated calculation into a method of an object in your model, and then invoking that method.

A whitelabel error message

post-not-supported.png

The HTTP protocol

HTTP, and it's secure cousin HTTPS`, are protocols for communication between

HTTP is a “request/response” protocol.

One key to understanding web interactions is understanding a bit about web requests, responses and status codes.

HTTP methods GET and POST

Not to be confused with methods of a class in Java, or any other object-oriented language.)

The main two HTTP methods are GET and POST.

GET:

POST:

Example of logout form using POST from lab07

For more detail