Springboot2.0整合thymeleaf和shiro简单三步

在springboot2.0中需要注意一个问题,那就是shiro和thymeleaf的支持依赖需要使用2.0.0

1、添加依赖

		
			com.github.theborakompanioni
			thymeleaf-extras-shiro
			2.0.0
		

2、在ShiroConfig中配置ShiroDialect

/**
     * shiro方言  支持shiro标签
     * @return
     */
    @Bean
    public ShiroDialect shiroDialect() {
        return new ShiroDialect();
    }

3、html中导入shiro标签

Springboot2.0整合thymeleaf和shiro简单三步_第1张图片


转载请务必保留此出处(原作者):https://blog.csdn.net/zhuzhezhuzhe1


版权声明:本文为原创文章,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。

https://blog.csdn.net/zhuzhezhuzhe1


你可能感兴趣的:(shiro)