freemarker與shiro
freemarker中shiro常用標籤:
<@shiro.guest>
<@shiro.user>
<shiro:hasRole name="administrator">
<shiro:hasAnyRoles name="admin,user,operator">
<shiro:hasPermission name="/order:*">
freemarker需要特別配置shiro的部分
@Override
public void afterPropertiesSet() throws IOException, TemplateException {
super.afterPropertiesSet();
this.getConfiguration().setSharedVariable("shiro", new ShiroTags());
注意:
WEBINF下src=“”直接訪問是不可以的(踩坑)
<@shiro.guest>
<@shiro.user>
<shiro:hasRole name="administrator">
<shiro:hasAnyRoles name="admin,user,operator">
<shiro:hasPermission name="/order:*">
freemarker需要特別配置shiro的部分
@Override
public void afterPropertiesSet() throws IOException, TemplateException {
super.afterPropertiesSet();
this.getConfiguration().setSharedVariable("shiro", new ShiroTags());
注意:
WEBINF下src=“”直接訪問是不可以的(踩坑)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.