Mom eggs, this problem took me 20 minutes, I used to search code spent 18 minutes, I write code has a poor habit, is to copy, what things want to do, on the Internet search others miscellaneous write, take to copy change can
Gee, mom eggs, the whole page, no I can use the information, those blog content a hair like people, you do not move your brain, is it by the number of words to collect money! Most hate this kind of person, you can move, but can't just move without a moment. Look at the first page of the full TM is useless information
It took me 2 minutes to think about it and I took care of it.
There are a lot of ways, maybe very low, but it does meet the demand.
Jsp:
<%
String username = (string) request.getsession (). getattribute ("username");
UserService userservice=new Userserviceimpl ();
int isad= userservice.checkisadmin (username);
%>
<input type= "hidden" name= "ISAdmin" id= "ISAdmin" value= "<%=isAd%>"/>
<li class= "" onclick= "Checkadmin ()" ><span></span><a id= " AddUser "href=" "target=" Rightframe "> Add </a></li>
Js:
<script type= "Text/javascript" >function checkadmin () {var isadmin = $ ("#isAdmin"). Val (); if (isadmin==0) {alert (" You do not have increased privileges, please contact the administrator! ");} else{$ ("#adduser"). attr ("href", "adduser.jsp");}} </script>
Effect:
Permission control-js Determine if there is permission to operate the jump page needs to be added target