<logic:present>的role属性 :是判断当前通过权限验证的用户是否是指定的安全角色.
 
比如:用户登陆系统时, 要通过LoginAction 给用户一个角色,然后 把这个角色(可能是多个)放在SESSION里...到这个标签时..就判断是否是指定的ROLE了这与struts-config.xml里 <action roles="">属性相同

解决方案 »

  1.   

    能说说怎么设吗?
    HttpSession session=request.getSession();
    session.setAttribute("role",users.getRole());
    是这样吗?
    不好意思我才学,谢谢
      

  2.   

    应该不是吧
    HttpSession session=request.getSession();
    session.setAttribute("role",users.getRole());我这样设置了,在jsp页面中
    <logic:present role="admin">
      <html:link forward="main">
       <fmt:message key="mainMenu.title"/>
      </html:link>
    </logic:present>
    我的用户role是admin时候,也不会显示哦?
    谁来教教我哦!