java - How to make thymeleaf spring security namespace available? -


i've got spring boot app. understand boot app need dependency in pom , great. unfortunately, that's not case , when overcomplicate configuration still doesn't work - can't use sec namespace in pages.

in page first issue namespace uri:

enter image description here

i've tried every option available in intellij fix menu , can't it.

i suppose result of issue fact can't use sec namespace anywhere. pictured example may indeed invalid use i've used <div> straight thymeleaf examples:

enter image description here

many of answers here , other sources relying on xml configuration well, of no use. still, i've made java-based beans based on xml examples no luck.

what steps required use spring security , thymeleaf integration in spring boot app using java based configuration (if that)?

pom.xml

<dependencies>     <dependency>         <groupid>org.springframework.boot</groupid>         <artifactid>spring-boot-starter-mail</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.springframework.boot</groupid>         <artifactid>spring-boot-starter-web</artifactid>     </dependency>     <dependency>         <groupid>org.thymeleaf.extras</groupid>         <artifactid>thymeleaf-extras-springsecurity4</artifactid>         <version>2.1.2.release</version>     </dependency>     ... </dependencies> 

i have encountered same issue , me helped define schema locations this:

<html lang="en"   xmlns:th="http://www.thymeleaf.org"   xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"   xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"   xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"   xsi:schemalocation="http://www.thymeleaf.org http://www.thymeleaf.org   http://www.ultraq.net.nz/thymeleaf/layout http://www.ultraq.net.nz/thymeleaf/layout   http://www.thymeleaf.org/thymeleaf-extras-springsecurity4 http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"> 

...

this includes additional dialects layout , spring security 4 can remove if not using them.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -