springboot2 + thymeleaf + shiro1.4+redis里前端shiro标签没法用
自打用了shiro,项目是三天两头出BUG...同样的配置摆在我这就不成。。。心痛
如今遇到了个更奇怪的问题,是前后端耦合的项目,直接调Index.html里的登陆接口可以实现登陆,但加上shiro标签以后页面都进不去,好嘛,提示securityManager没得,我真是!
用的是这个JAR
<dependency><groupId>com.github.theborakompanioni</groupId><artifactId>thymeleaf-extras-shiro</artifactId><version>2.0.0</version></dependency>
这是shiroConfig里的相关配置
/**** @param* @return at.pollux.thymeleaf.shiro.dialect.ShiroDialect* @author Zain* @description thymeleaf页面使用shiro标签控制按钮是否显示* @date 2019/1/7 23:43*/@Bean("shiroDialect")public ShiroDialect shiroDialect(){ShiroDialect dialect = new ShiroDialect();return dialect;}/*** * @param* @return org.springframework.beans.factory.config.MethodInvokingFactoryBean* @author Zain* @description Spring静态注入:让某个方法的返回值注入bean实例* @date 2019/1/9 17:18*/@Beanpublic MethodInvokingFactoryBean methodInvokingFactoryBean(SecurityManager securityManager){MethodInvokingFactoryBean bean = new MethodInvokingFactoryBean();bean.setStaticMethod("org.apache.shiro.SecurityUtils.setSecurityManager");bean.setArguments(securityManager);return bean;}
然后呢网上找了很多解决办法,下面这个方法失败咯!
@Beanpublic FilterRegistrationBean delegatingFilterProxy(){FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();DelegatingFilterProxy proxy = new DelegatingFilterProxy();proxy.setTargetFilterLifecycle(true);proxy.setTargetBeanName("shiroFilter");filterRegistrationBean.setFilter(proxy);return filterRegistrationBean;}
为了避免一切可能放上前端的代码:
<html xmlns="http://www.w3.org/1999/xhtml"xmlns:th="http://www.thymeleaf.org"xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"><shiro:guest><a href="#" data-toggle="modal" data-target="#myModal">登录</a></shiro:guest>
大过年的 心里拔凉拔凉的,CSDN一片你抄我抄...
springboot2 + thymeleaf + shiro1.4+redis里前端shiro标签没法用相关推荐
- thymeleaf模板+Shiro标签对按钮权限的控制
thymeleaf模板+Shiro标签对按钮权限的控制 环境介绍 SpringBoot+Shiro+thymeleaf模板+Layui(前端) 这两天学习了shiro相关的技术,碰到一个问题:如何根据 ...
- 【thymeleaf 】在 thymeleaf 中使用 shiro 标签
前言 sprint boot 2.3.4.RELEASE 说明 shiro 未提供对 thymeleaf 的支持.第三方项目 thymeleaf-extras-shiro 提供了在 thymeleaf ...
- 处理Redis里的数据
处理Redis里的数据 有缘网的数据爬回来了,但是放在Redis里没有处理.之前我们配置文件里面没有定制自己的ITEM_PIPELINES,而是使用了RedisPipeline,所以现在这些数据都被保 ...
- springboot+thymeleaf+shiro标签
1,pom中加入依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId&g ...
- Spring Boot Thymeleaf中使用Shiro标签
在<Spring-Boot-shiro权限控制>中,当用户访问没有权限的资源时,我们采取的做法是跳转到403页面,但在实际项目中更为常见的做法是只显示当前用户拥有访问权限的资源链接.配合T ...
- 第九节 Shiro标签原理分析
一.shiro的标签 首先,你需要知道的是,标签的实质其实是Java代码.你已经知道,JSP实质也是Java代码,更别说用在JSP中的标签了. 稍后你会在源码追踪环节了解到:Shiro标签执行了哪些J ...
- 持久层框架Mybatis Plus的ResultMap标签里的association标签的用法
加入公司差不多快四个月了,对目前手头上的工作内容基本已经熟悉了,现在要对我手头上的后台管理系统进行一个技术升级,后台管理系统前后端不分离,前端使用的是EXTJS框架,后端使用的事Struts2+spr ...
- 前端link标签引入css教程
前端link标签引入css教程 首先我们在桌面新建一个文件 我们在这个文件里分别新建个存放HTML的文件夹以及css层叠样式表格的文件夹 然后我们打开dw,在文件选项找到新建 我们新建一个HTML的的 ...
- beetl 页面标签_beetl模板页面使用shiro标签
本文参看自: 闲大赋 beetl 和 shrio 结合 shrio 提供有jsp 标签,供在jsp 里使用,如果想在beetl中使用,有俩种方法, 一是beetl支持集成jsp页面,所以你可以在在js ...
最新文章
- 美国研发出百万兆级计算机 Summit,“最强超算”竞争加剧
- oracle用户锁定及修改密码
- 区位码\机器码\内码关系
- YBTOJ洛谷P4074:糖果公园(树上莫队)
- [html] 如何放大点击的区域?
- java 定时器qz xm配置_java_Java的作业调度类库Quartz基本使用指南,一、常用接口:
1、Job接口: - phpStudy...
- UML-类图-关键字如何使用?
- java的object类型转换_Java Object类型转换
- spyder python下载_Spyder python下载
- Kubernetes监控篇
- 墙壁绘画机器人 ||arduino processing
- python sanic_Python Web框架Sanic Streaming – 流式传输
- 摔了 计算机无法启动,电脑被摔后不能进系统,我说重装系统试试,客户:系统能被摔坏?...
- Oracle 11g SQL基础入门系列培训-小布作品
- 企业支付宝转账到银行卡开发导引
- 在python中定义函数时不需要声明函数参数的类型_python定义函数时默认参数注意事项...
- 5G-SUPI-SUPC-IMSI
- socket广播报文收发简单梳理
- iOS7下status bar相关问题的解决方法
- Cryptology Asset Group p.l.c.决定增加现金资本和出售库存股份