- <c:choose>
- <c:when test="${param.action=='changeLanguage'}"><jsp:forward page="install/install_change_language.jsp"/></c:when>
- <c:when test="${param.action=='license'}"><jsp:forward page="install/install.jsp"/></c:when>
- <c:when test="${param.action=='check'}"><jsp:forward page="install/install_check.jsp"/></c:when>
- <c:when test="${param.action=='config'}"><jsp:forward page="install/install_config.jsp"/></c:when>
- <c:when test="${param.action=='admin'}"><jsp:forward page="install/install_admin.jsp"/></c:when>
- <c:when test="${param.action=='install'}"><jsp:forward page="install/install_install.jsp"/></c:when>
- <c:when test="${param.action=='showMessage'}"><jsp:forward page="install/install_message.jsp"/></c:when>
- <c:otherwise><jsp:forward page="install/install_language.jsp"/></c:otherwise>
- </c:choose>
当test为true时,则执行<c:when ></c:when>之间的代码,
如果所有的test都为false,则执行<c:otherwise></c:otherwise>之间的代码。
----------------------
jsp使用<c:choose>标签来控制内容显示
- <c:choose>
- <c:when test="${typename.name == null }">
- <h3>请在左边选择你遇到的问题:</h3>
- <p>
- 1.请详细描述您遇到的问题<br />
- <b></b>
- 2.如果可以,请尽可能的给我
- 们提供完善的资料,这样有助于我们更快的帮您解决问题。<br />
- <b></b> </p>
- </c:when>
- <c:otherwise>
- <h3>${ typename.name }:</h3>
- </c:otherwise>
- </c:choose>