【发布时间】:2011-01-17 01:57:18
【问题描述】:
假设我在对象列表上使用 Struts 2 迭代标记。每个对象都有一个名为 creatorUserId 的属性。
我想将 creatorUserId 与当前登录用户的 Id 号进行比较。
如何在 JSP 页面中使用 Spring Security 和 Struts 2 执行此操作?
<security:authentication property="principal.userID" />显示当前用户的ID号
<s:property value="creatorUserId" /> 显示当前迭代器项的 creatorUserId。
我想做:
<s:if test="%{creatorUserId == <security:authentication property='principal.userID' />}">
但这不是合法的表达方式。
谁能帮忙分析一下语法?
【问题讨论】:
标签: java struts2 spring-security