在 hasRole 中使用 spring:eval

2024-04-28

我在 JSP 中显示属性文件中的某些属性,如下所示:

<spring:eval expression="@propertyConfigurer.getProperty('myproperty')"/>

现在,我想在里面使用相同的属性<sec:authorize access="hasRole()/>

<sec:authorize access="hasRole('<spring:eval expression="@propertyConfigurer.getProperty('myproperty')"/>')">

这是行不通的。


尝试这个:

<spring:eval expression="@propertyConfigurer.getProperty('myproperty')" var="myproperty"/>
<sec:authorize access="hasRole('${myproperty}')">
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 hasRole 中使用 spring:eval 的相关文章

随机推荐