我想将谷歌地图 javascript 添加到 Thymeleaf 模板,如下所示:
https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places
它抛出异常:
org.xml.sax.SAXParseException; lineNumber: 209; columnNumber: 93; The reference to entity "key" must end with the ';' delimiter
我尝试改变&
to &
但一切都没有改变。
对你的帮助表示感谢。谢谢!
Thymeleaf 使用 XML 解析器,并且字符&
在 XML 中被视为特殊字符。你必须更换&
及其 XML 等效项&
.您的网址将是:
https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places
在 thymeleaf 3 中,这不会成为问题,因为他们为 thymeleaf 编写了一个新的解析器。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)