0
我有以下代碼如何隱藏不相關的鏈接?
<body>
<%
String loggedInUserName = (String) request.getAttribute("loggedInUserName");
%>
<%
String userRole = "lead";
%>
<%
if (loggedInUserName.equals(userRole)) { %>
<%@ include file="tabs.jsp"%>
<a href="dataOwner-index.html" style="visibility: hidden"></a>
<a href="dataOwner-riskAssessmentCompliance.html"style="visibility: hidden"></a>
<a href="security_setup.html" style="visibility: hidden"></a>
<%
}
%>
而tabs.jsp包含
<div class="tslcNav" role="navigation">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">Home</a></li>
<li><a href="mngPost.html">Manage Portfolio</a></li>
<li><a href="riskAssesment.html">Risk Assesment</a></li>
<li><a href="securitySetup.html">Security Setup</a></li>
<li><a href="dataOwner-index.html">Home</a></li>
<li><a href="dataOwner-riskAssessmentCompliance.html">Assessment Workbook</a></li>
<li><a href="security_setup.html">Security Setup</a></li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
哪些錯誤與此代碼?它顯示了所有tabs.I要顯示只有那些導致相關標籤我想隱藏其他鏈接,即標籤。