<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<body>
<s:iterator value="roleList">
<s:if test="%{#userRole}=='Admin'}" >
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Manage Users <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="adduser.jsp">Add User</a></li>
<li class="divider"></li>
<li><a href="viewusers.jsp">View / Edit User</a></li>
</ul>
</li>
</s:if>
</s:iterator>
Here I want to check whether the user who has logged in is user or admin.If he/she is user
I dont want to dsiplay one section in header section to that user which is Manage users
but for Admin
I want to display that block but I am unable to do so.Above is my code where userRole
is my variable in which the role of the user is stored and roleList
is the arraylist object in which the role value is added.So please help me or provide some links where I can study such examples and do accordingly.