1
早些時候,我們有一個標籤ifRole
這樣根據另一個屬性,我們可以在jstl標籤中有一個可選的atrribute嗎?
<op:ifRole role="role1">
<li id="menu3SubMenu4">This will be shown only to the user with role1</li>
</op:ifRole>
在這個標籤,我們有一個必填字段role
和另一個可選字段secondaryRole
。現在,我又增加了可選屬性excluding
這樣
<op:ifRole excluding="role2">
<li id="menu3SubMenu4">This will be shown to all users except the one with role=role2</li>
</op:ifRole>
另外,我從需要可選更改屬性role
。現在,我不想讓任何人使用這個標籤:
<op:ifRole excluding="role2" role="role1">
這個東西不應該被允許。一種方法是在提供這兩個參數時在doStartTag
中拋出異常。但我想要其他方式。
你是什麼意思「相反方向」? – skaffman 2010-11-20 09:23:03
@skaffman:我的意思是用xml來做 – 2010-11-20 12:31:10