私はこのような何かを持っている...JSPエル・ロジック・質問
<c:if test="${(not empty students) && (studentID != null)}">
<form:input path=studentsList[${studentID}].name">
..........
..........
//some 50+ lines of code
</c:if>
彼らは、特定の学生のページを表示しているときです。インクルードが..
<c:forEach items="${students}" var="student">
<form:input path=student.name">
..........
..........
//some 50+ lines of code
</c:forEach>
を、私はこのような何かにコードを変更するいくつかの一般的なページを表示している場合、彼らは、特定のページを表示しているかどうかを確認する文または一般的なページ
<c:when ${particularPage}>
<c:if test="${(not empty students) && (studentID != null)}">
<form:input path=studentsList[${studentID}].name">
..........
..........
//some 50+ lines of code
</c:if>
<c:otherwise>
<c:forEach items="${students}" var="student">
<form:input path=student.name">
..........
..........
//some 50+ lines of code
</c:forEach>
</c:otherwise>
場合、私は持つことができます
コードを変更して50行以上を繰り返さなくてもいい方法を教えてもらえますか?
ありがとうございました
スクリプトレットが行くのは悪い方法です。 btiernayのタグファイル解決策をもう一度見てください。 –