JSP中c:if 标签的使用

来源:互联网 发布:iphone与mac传照片 编辑:程序博客网 时间:2024/05/01 20:15
        <c:set var="check" value="${file.checkDir}" scope="request"/>        <c:if test="${check==true}">          <td> <a href="showfiles.do?filename=${file.fileName}">${file.fileSingleName}</td>        </c:if>        <c:if test="${check==false}">          <td> <a href="download.do?filename=${file.fileName}">${file.fileSingleName}</a></td>        </c:if>

根据传过来的参数不同,

超链接的功能就不同,去往不同的Controller。


如果想,还可以控制超链接的样子。

如果传过来的参数是a,显示什么,去哪儿。

如果传过来的参数是b,显示什么,去哪儿。


设想一下,根据用户名去往不同的主页!

0 0
原创粉丝点击