【发布时间】:2014-09-17 07:07:06
【问题描述】:
我有一个选择框。有 4 个值(使用 jstl 标签生成)和加载按钮。
我在点击加载按钮时调用 struts 动作
在 struts 动作类中我添加了request.getAttribute("TA",value);
现在我想在jsp页面中保留之前选择的值
<%if(request.getAttribute("TA")!=null && request.getAttribute("TA").equals("Cloud")) {%>
<option value='${i.thematicArea}' selected>${i.thematicArea}</option>
<%} else {%>
<option value='${i.thematicArea}'>${i.thematicArea}</option>
<%} %>
</c:forEach>
</select>
</td>
<td><input type="submit" id="button" name="button" value="Load"></td>
我想与${i.thematicArea} 比较而不是云。如何使用 jstl 做到这一点
例如:
request.getAttribute("TA").equals("Cloud"))
instead of cloud i want to check with ${i.thematicArea}
提前致谢
【问题讨论】:
标签: jsp jakarta-ee struts2 jstl jsp-tags