有没有办法转换窗体的jsp代码
ecurity:authorize access="hasRole('ROLE_USER')">You're an userecurity:authorize>
ecurity:authorize access="hasRole('ROLE_ADMIN')">You're an adminecurity:authorize>
ecurity:authorize access="hasRole('ROLE_SADMIN')">You're a superadminecurity:authorize>
到另一种形式,类似于以下(不起作用)?
最佳答案
您可以使用< security:authorize />的var属性.标签将创建:
A page scoped variable into which the boolean result of the tag
evaluation will be written,allowing the same condition to be reused
subsequently in the page without re-evaluation.
ecurity:authorize access="hasRole('ROLE_USER')" var="isUser" />
ecurity:authorize access="hasRole('ROLE_ADMIN')" var="isAdmin" />
ecurity:authorize access="hasRole('ROLE_SADMIN')" var="isSuperUser" />