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 閱讀(428) 評論(0)  編輯  收藏

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


          網站導航:
           
          <2006年12月>
          262728293012
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          Welcome here, my friend!

          常用鏈接

          留言簿(12)

          隨筆檔案(66)

          文章分類

          文章檔案(63)

          web

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 89603
          • 排名 - 647

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 双牌县| 洛扎县| 安吉县| 玉林市| 福清市| 大邑县| 阜宁县| 保靖县| 米泉市| 白城市| 贵溪市| 香格里拉县| 天门市| 台江县| 堆龙德庆县| 疏勒县| 虹口区| 迭部县| 山西省| 甘肃省| 梁河县| 望奎县| 祁连县| 阜阳市| 湟中县| 青浦区| 崇州市| 峨边| 新泰市| 睢宁县| 乐山市| 台东市| 大连市| 天等县| 甘德县| 隆子县| 宾川县| 伊宁市| 前郭尔| 邮箱| 清涧县|