Fra*_*ama 6 java spring-mvc web thymeleaf
我想将谷歌地图javascript添加到Thymeleaf模板中,如下所示:
https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places
Run Code Online (Sandbox Code Playgroud)
它抛出了异常:
org.xml.sax.SAXParseException; lineNumber: 209; columnNumber: 93; The reference to entity "key" must end with the ';' delimiter
Run Code Online (Sandbox Code Playgroud)
我试图改变&到&,但什么都没有改变.
对你的帮助表示感谢.谢谢!
Thymeleaf使用XML解析器,并且该字符&被视为XML中的特殊字符。您必须将&其替换为XML对等符。您的&URL将为:
https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places
Run Code Online (Sandbox Code Playgroud)
在thymeleaf 3中,因为他们为thymeleaf编写了一个新的解析器,所以这不是问题。
| 归档时间: |
|
| 查看次数: |
2055 次 |
| 最近记录: |