Java 使用spring:eval-inside-hasprole

Java 使用spring:eval-inside-hasprole,java,spring,spring-mvc,spring-security,Java,Spring,Spring Mvc,Spring Security,我在JSP中显示属性文件中的某些属性,如下所示: <spring:eval expression="@propertyConfigurer.getProperty('myproperty')"/> 现在,我想在中使用相同的属性,试试这个: <spring:eval expression="@propertyConfigurer.getProperty('myproperty')" var="myproperty"/> <sec:authorize access

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

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

现在,我想在
中使用相同的属性,试试这个:

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

您尝试过以下方法吗:?知道如何在一些基本html标记上使用
${myproperty}
?他不工作了,我想出来了。下面是用于加载属性文件的和java类。
<spring:eval expression="@propertyConfigurer.getProperty('myproperty')" var="myproperty"/>
<sec:authorize access="hasRole('${myproperty}')">