October 2018
Intermediate to advanced
590 pages
15h 5m
English
In the welcome() handler, we returned a very simple String to the client side, which isn't what we want, since, for a web application, we usually need to send a chunk of HTML code to the browser to render a web page or send JSON data as a result of an API call. Indeed, HTML code and JSON data are all String objects passed in an HTTP response. And it is true that you can change the return value to something like the following, as an example, so that the browser will render a text in bold:
public String welcome() { return "<strong>Hello, Welcome to Spring Boot!</strong>";}
However, putting HTML markups inside Java code isn't a practical way to create a web application. We need to follow the MVC pattern.
In the MVC pattern, C is our
Read now
Unlock full access