【发布时间】:2014-09-10 07:20:18
【问题描述】:
angularjs 特性称为指令导致 spring mvc 中的问题。如果我使用 thymeleaf 来呈现一个带有这样的元素的 html
<div ui-view autoscroll="false"></div>
我遇到了类似的错误
org.xml.sax.SAXParseException: Attribute name "ui-view" associated with an element type "div" must be followed by the ' = ' character.
是否有一个优雅的解决方法,或者我应该使用百里香以外的其他东西?
编辑:
非常感谢您的回答,他们对我帮助很大。
要么编写 xml 代码,要么使用一些解决方法。打开您的 application.properties 并添加以下内容
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=LEGACYHTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
spring.thymeleaf.cache=false
【问题讨论】:
-
这可能会解决您的问题:stackoverflow.com/questions/23616055/…
标签: java spring angularjs spring-mvc angularjs-directive