0
点赞
收藏
分享

微信扫一扫

解决重定向:Cannot convert value of type 'SysRole' to required type 'String'

青鸾惊鸿 2022-07-12 阅读 91


  • 断点报错代码

("sysRole", sysRole);

ra就是RedirectAttributes

  • 具体报错如下

org.springframework.beans.ConversionNotSupportedException: Failed to convert value of type 'cn.hctech2006.boot.bootmvc.bean.SysRole' to required type 'java.lang.String'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'cn.hctech2006.boot.bootmvc.bean.SysRole' to required type 'java.lang.String':

  • 解决:记错了应该是addFlashAttribute

("sysRole", sysRole);

结果

解决重定向:Cannot convert value of type


举报

相关推荐

0 条评论