在Server.xml里面增加一个,manager的角色!应该久搞定了的!

解决方案 »

  1.   

    你是指conf/server.xml吧,但我xp下安装的tomcat下的server.xml没有设manager也好使啊,就unix下不行
      

  2.   

    $TOMCAT_HOME\webapps\manager\WEB-INF\web.xml   
      1。在<web-app>和</web-app>之间加入   
          <security-constraint>   
              <web-resource-collection>   
                  <web-resource-name>Entire   Application</web-resource-name>   
                  <url-pattern>/*</url-pattern>   
              </web-resource-collection>   
              <auth-constraint>   
                    <!--   NOTE:     This   role   is   not   present   in   the   default   users   file   -->   
                    <role-name>user</role-name>   
              </auth-constraint>   
          </security-constraint>   
        
          <!--   Define   the   Login   Configuration   for   this   Application   -->   
          <login-config>   
              <auth-method>BASIC</auth-method>   
              <realm-name>TEST   ACCESS   CONTROL</realm-name>   
          </login-config>   
      //如果存在就不用加了,注意下面的东东   
      2。然后在$TOMCAT_HOME/conf/tomcat-users.xml中加入   
            <user   name="user"   password="password"   roles="user"/>     
            roles的名字和web.xml中的相对应     
        
    在csdn中终于找到这文章,好使了