如何使用<;从Jsp页面检查驻留在ArrayList中的类中的属性值;c:如果>;
我在如何使用<;从Jsp页面检查驻留在ArrayList中的类中的属性值;c:如果>;,jsp,struts,jstl,Jsp,Struts,Jstl,我在请求范围中有数组列表,它包含所有学生对象。。 我在JSP页面 class Student { int sno; String name; String type; // here type can be either R or D . . . } 当我显示Student obj数据时,我想检查Student type 如果type=D那么我想添加框 怎么做 我正在使用struts 1.3和JDBC 我的代码是 <logic:it
请求范围
中有数组列表
,它包含所有学生
对象。。
我在JSP页面
class Student
{
int sno;
String name;
String type; // here type can be either R or D
.
.
.
}
当我显示Student obj
数据时,我想检查Student type
如果type=D
那么我想添加
框
怎么做
我正在使用struts 1.3和JDBC
我的代码是
<logic:iterate id="student" name="allstudents" scope="request">
<bean:write name="student" property="sno" format="#"/><br>
<bean:write name="student" property="name" /><br>
<bean:write name="student" property="type" /><br>
// here i want to display <select> if type =D
.
.
.
</logic:iterate>
//这里我想显示type=D
.
.
.
请帮帮我
提前感谢帮自己一个忙,学习JSTL。完成后,使用
、
、
和
标记:
<c:forEach var="student" items="${allstudents}">
<fmt:formatNumber value="${student.sno}" pattern="#"/>
<c:out value="${student.name}"/>
<c:out value="${student.type}"/>
<c:if test="${student.type == 'D'}>
...
</c:if>
</c:forEach>
我试过这样做,效果很好。。。
谢谢你。。。。
i tried like this this is working fine...
thank you JB Nizet....
<logic:iterate id="student" name="allstudents" scope="request">
<bean:write name="student" property="sno" format="#"/><br>
<bean:write name="student" property="name" /><br>
<bean:write name="student" property="type" /><br>
<c:if test="${student.type == 'D'}>
......
</c:if>
</logic:iterate>