【问题标题】:Spring Boot Google Maps SAXParseExceptionSpring Boot 谷歌地图 SAXParseException
【发布时间】: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


【解决方案1】:

在您的网址中将&amp;amp; 更改为&amp;amp;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多