Studying web development with Spring Boot. Record for notes.
When using thymeleaf, if you do not put / at the end of the meta tag in the head tag, an error that White label Error Page is displayed occurs. I found the following words when I traced the STS log.
org.xml.sax.SAXParseException: Element type "meta" must end with the corresponding end tag "\ </ meta>".
Therefore, modify the code of the corresponding html file as follows. (Add a slash at the end)
python
//Original code
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
//Revised
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"/>
The web page is now displayed correctly. However, I don't know the exact reason. In terms of HTML, the way to write the original code should be correct. .. .. Is it necessary to clarify that it is thymeleaf?
After playing around with it for a while, it seems that even something like an input tag that doesn't need a closing tag needs a / at the end.
end
Recommended Posts