【发布时间】:2016-07-18 10:17:19
【问题描述】:
我正在使用 Spring Boot 并尝试在我的视图中添加 Google 地图。这是我尝试做的:
控制器
@RequestMapping(value = "/map", method = RequestMethod.GET, produces = "text/html")
public String map(Model model) { return "map"; }
查看(资源/模板/map.html)
<script async="async" defer="defer"
src="https://maps.googleapis.com/maps/api/js?key=/*mykey*/&callback=initMap;">
</script>
错误
org.xml.sax.SAXParseException: Referenz zu Entity "callback" muss mit dem Begrenzungszeichen ";" enden.
你怎么看我加了一个“;”在回调方法后面,但它仍然不起作用(当您不使用 spring boot 时,它也可以在没有“;”的情况下工作)。
我该如何解决这个问题?
【问题讨论】:
-
尝试将 & 替换为 &
-
它有效!完美,谢谢!
-
接受答案并关闭它
标签: javascript java spring google-maps spring-boot