posts - 66,  comments - 40,  trackbacks - 0

          例如你要控制對ROOT目錄下文件的訪問:
          首先更改$TOMCAT_HOME/ROOT/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中的相對應

          posted on 2006-12-19 14:20 happytian 閱讀(426) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          <2006年12月>
          262728293012
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          Welcome here, my friend!

          常用鏈接

          留言簿(12)

          隨筆檔案(66)

          文章分類

          文章檔案(63)

          web

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 89491
          • 排名 - 647

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 上栗县| 久治县| 简阳市| 柳州市| 咸阳市| 新龙县| 永州市| 林口县| 阳曲县| 浦北县| 寻甸| 隆安县| 青神县| 邯郸市| 哈尔滨市| 花莲市| 交城县| 常熟市| 溧阳市| 五大连池市| 禄丰县| 封丘县| 冷水江市| 兴业县| 黄浦区| 布尔津县| 海淀区| 秀山| 礼泉县| 浦江县| 历史| 青岛市| 恭城| 五常市| 汝城县| 秦皇岛市| 诸城市| 灵川县| 大足县| 天峻县| 大埔区|