Simple example of Spring Security with Thymeleaf

前端 未结 5 493
感情败类
感情败类 2020-12-25 14:57

hi I\'m trying to follow a simple example about doing a simple login form page that i found in this page http://docs.spring.io/autorepo/docs/spring-security/4.0.x/guid

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-25 15:49

    You need to add Thymleaf's Spring Security Dialect.

    1.) Add the Spring Security Dialect module to your classpath.

    Maven Example:

    
        org.thymeleaf.extras
        thymeleaf-extras-springsecurity3
        2.1.2.RELEASE
    
    

    2.) Add the SpringSecurityDialect object to your SpringTemplateEngine

    import org.thymeleaf.extras.springsecurity3.dialect.SpringSecurityDialect;
    templateEngine.addDialect(new SpringSecurityDialect()); //add this line in your config
    

    Source: Spring in Action 4th Edition

提交回复
热议问题