我在jsp中使用JSTL,并希望在textarea
中输出值<tr>
<th scope="row">SMS Before Inst</th>
<td colspan="7"><textarea cols="20" rows="5" placeholder="SMS Content" id=smsMessage name="smsMessage">
Time setting is
<c:choose>
<c:when test="${CTSSessionCode=='M'}">
Morning
</c:when>
<c:when test="${CTSSessionCode=='E'}">
Everning
</c:when>
<c:otherwise>
OTHER
</c:otherwise>
</c:choose>
Date
<c:out value="${requestDate}" ></c:out>
,We will contact later
</textarea></td>
</tr>
内,CTSSessionCode = M是早晨,CTSSessionCode = E是晚上,requestDate是日期,但当我运行它时,它的输出是空白和空格字符。
如何解决这个问题?
<textarea>
:
<textarea>
value
</textarea>
你可以试试:
<textarea>value</textarea>
并将<c:choose>
条件移出<textarea>
:
<c:set var="myVar" value="OTHER"></c:set>
<c:choose>
<c:when test="${CTSSessionCode=='M'}">
<c:set var="myVar" value="Morning"></c:set>
</c:when>
<c:when test="${CTSSessionCode=='E'}">
<c:set var="myVar" value="Everning"></c:set>
</c:when>
</c:choose>
<tr>
<th scope="row">SMS Before Inst</th>
<td colspan="7">
<textarea cols="20" rows="5" placeholder="SMS Content" id=smsMessage name="smsMessage">Time setting is ${myVar} Date ${requestDate}, We will contact later</textarea>
</td>
</tr>