类 CategoryAction:
public class CategoryAction extends ActionSupport {
private String catName;
private String dispName;
// getter and setter
}
GAction 类:
public class GAction extends ActionSupport {
private String category; // contains a
private ArrayList<CategoryAction> catList; // contains a b c d e
//getter and setter
}
在我的 jsp 页面中,我想检查当前类别。
在 JSP 页面中调用 GAction 后,我输入了以下代码,但如果部分未执行:
<s:iterator var="cat" value="catList">
<s:if test="%{#category.equealIgenoreCase(#catName)}">
if part
</s:if>
<s:else>
else part
</s:else>