|
9 | 9 | * (YOU DON'T NEED TO KNOW IT). And the purpose of the controller is to power that UI and wire it to the storage that
|
10 | 10 | * is already provided as a field of class {@link Notes}. The base URL is `/notes`.
|
11 | 11 | * <p>
|
12 |
| - * This controller handles the HTTP GET request that should list all notes. It order to do that, it fetches the list |
| 12 | + * This controller handles the HTTP GET request that should list all notes. In order to do that, it fetches the list |
13 | 13 | * of notes, adds that list as an attribute to the {@link org.springframework.ui.Model}, and returns a corresponding view.
|
14 | 14 | * The view (which is Thymeleaf HTML template) expects to receive an attribute called `noteList`.
|
15 | 15 | * In classical Spring MVC, controller methods return a string value which stores a view name.
|
16 |
| - * A {@link org.springframework.web.servlet.ViewResolver} is already configured to look for a HTML template in |
17 |
| - * `/resources/templates`. So the method should just return a html file name without `.html`. |
| 16 | + * A {@link org.springframework.web.servlet.ViewResolver} is already configured to look for an HTML template in |
| 17 | + * `/resources/templates`. So the method should just return an HTML file name without `.html`. |
18 | 18 | * <p>
|
19 | 19 | * In order to add a new note, this controller handles HTTP POST request that is sent by HTML form. After submitting,
|
20 | 20 | * the request will have to POST parameters called `title` and `text` accordingly. So this controller retrieves those
|
21 |
| - * params from he request and use them in order to create and add a new note. Once a new note is added, it redirects the |
| 21 | + * params from the request and use them in order to create and add a new note. Once a new note is added, it redirects the |
22 | 22 | * request to the notes page.
|
23 | 23 | * <p>
|
24 | 24 | * Such controllers are used when both back-end and the UI are provided by the same Spring MVC application. In reality,
|
25 | 25 | * most application that have a rich and powerful UI, are not built like that. They have separate front-end and
|
26 |
| - * back-end applications. The the back-end app, will only need to provide data and don't care about view. In that case |
| 26 | + * back-end applications. The back-end app, will only need to provide data and don't care about view. In that case |
27 | 27 | * the same controller will look like {@link com.bobocode.mvc.api.NoteRestController}
|
28 | 28 | */
|
29 | 29 | @RequiredArgsConstructor
|
|
0 commit comments