You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'show_sidebar' cannot be found on object of type 'java.util.LinkedHashMap' - maybe not public or not valid?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
我在尝试基于theme-ocean开发主题的过程中,参考元数据表单定义给Post增加了一个字段,用于控制是否展示侧边栏:
接着修改
https://github.com/f2ccloud/theme-ocean/blob/master/templates/post.html
第5行最后的isSidebar
变量:但这里有一个问题,对于存量的文章,由于没有这个属性,访问的时候会报错,后台日志:
一种方法是修改所有文章的设置,将“是否显示侧边栏”改为“否”,但更好的方法是判断
show_sidebar
属性是否存在。由于我对Thymeleaf不熟,想问下有没有什么比较好的方法?另外,新创建的文章有一个问题,必须点击“设置”并保存一次,文章才会有
show_sidebar
属性,否则访问报错,请问这个又应该如何解决?Beta Was this translation helpful? Give feedback.
All reactions