私はSpring BootとThymeleafで例を実行しようとしています。私はエラーを取得する:Spring BootとThymeleaf Neko HTMLエラー
There was an unexpected error (type=Internal Server Error, status=500). Cannot perform conversion to XML from legacy HTML: The nekoHTML library is not in classpath. nekoHTML 1.9.15 or newer is required for processing templates in "LEGACYHTML5" mode
は、これらは私の依存関係です:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jersey</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
これは私のアプリケーションのプロパティです:
spring.thymeleaf.cache=false
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=LEGACYHTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
私は猫HTMLの依存関係のエラーが消える追加します。しかし、それは私の現在の依存関係を介して含める必要があります。何が問題なの?
にこれを追加右。 Springブートはnekohtml依存関係を管理します(バージョンなしでその依存関係を追加することができます)が、thymeleafスターターはデフォルトでそれを持ってこない。 –
私のために驚いています:) Neko HTMLはThymeleafの必須アイテムですが、spring-boot-thymeleafには含まれていませんでした。私は何かが恋しいと思った。ありがとう! – kamaci
たとえば、HTML5モードを使用する場合、Nekoライブラリはまったく必要ありません。プロジェクトがそれを必要とする場合にのみ含まれるオプションの依存関係としてはるかに優れています。 –