【发布时间】:2012-07-12 22:04:18
【问题描述】:
我在某个jsp页面中有一个复选框...如果选中该复选框,abc.jsp将触发...如果未选中xyz.jsp应该触发...谁能帮我实现这个...我想在 jsp 本身中有代码行...
这是我的一个类文件中的内容
private boolean useNis = false;
public boolean isUseNis() {
return useNis;
}
public void setUseNis(boolean useNis) {
this.useNis = useNis;
}
在我的 hbm.xml 文件中,以下是我唯一的行
<property name="useNis" type="yes_no" column="USENIS" not-null="true"/>
在 abc.jsp 中,我有这段代码
<form:checkbox path="useNis"/>
<input type="hidden" value="1" name="_useNis"/>
在 xyz.jsp 中,我有这些行
<c:choose>
<c:when test="${Location.useNis==true}">
<button type="submit" name="_eventId_searchLoadKeys"><fmt:message key="SEARCH" /></button>
</c:when>
<c:otherwise>
<button type="submit" name="_eventId_searchNisLoadKeys"><fmt:message key="SEARCH" /></button>
</c:otherwise>
</c:choose>
<c:when test="${Location.useNis==true}"> ... xyz.jsp 中的这一行应该检查是否选中了复选框!!!如果解决了,我会得到我想要的..
【问题讨论】:
标签: jsp events spring-webflow