springboot使用freemarker整合shiro标签整合
1.导入整合依赖
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>shiro-freemarker-tags</artifactId>
<version>1.0.2</version>
<exclusions>
<exclusion>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-all</artifactId>
</exclusion>
</exclusions>
</dependency>
2.启用freemarker中的shiro标签
@Bean
public freemarker.template.Configuration configuration(freemarker.template.Configuration configuration){
configuration.setSharedVariable("shiro",new ShiroTags());
return configuration;
}
public class ShiroTags extends SimpleHash {
public ShiroTags() {
put("authenticated", new AuthenticatedTag()