0
在我的應用程序中,我有三個listitems文件上傳,查看報告和更改密碼。如果登錄是普通用戶,我需要隱藏查看報告,如果登錄是管理員,我需要顯示查看報告。下面是我通過使reports.visible =假想我的標籤如何根據用戶角色在java中隱藏選項卡
守則主的頁面級
<div class="wrapper">
<div class="menu">
<div class="menu">
<ul id="drop-nav">
<li id="MenuFileUpload" runat="server"><a href="Upload.jsp">File Upload</a>
<ul>
<li><a href="ViewUploadedFiles.jsp">View Uploaded Data</a></li>
</ul>
</li>
<li id="MenuReports" runat="server"><a href="Reports.jsp" id="Rpf" runat="server">View Reports</a><ul>
<li><a href="Reports1.jsp">Report1</a></li>
<li><a href="Reports2.jsp">Reports2</a></li>
<li><a href="Report3.jsp">Report3</a></li>
</ul>
</li>
<li id="lichangepwd" runat="server"><a id="A1" href="ChangePassword.jsp" runat="server">Change Password</a></li>
<div style="width:auto;float:right;font-weight:bold;padding-right:0cm;">
<li id="lilogout"><a href="Logout.jsp"> Logout</a></li></div>
<div style="float: left;text-align:right; width: 64%;">
<asp:Label ID="lblmsg" runat="server" ForeColor="Red" BorderColor="White" Text="Label" Font-Size="Small"></asp:Label> </div>
</ul>
</div>
</div>
碼在登錄頁面 -
if(role.equals("Supervisor"))
{
reports.visible=false;
}
代碼;我們將在.net中執行,但它不在java中工作
請注意'.NET = java'! – Ravi