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

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


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

          Welcome here, my friend!

          常用鏈接

          留言簿(12)

          隨筆檔案(66)

          文章分類

          文章檔案(63)

          web

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 89755
          • 排名 - 647

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 呈贡县| 晴隆县| 沁水县| 梁平县| 苍梧县| 修文县| 乐山市| 通辽市| 东兴市| 堆龙德庆县| 石屏县| 辽宁省| 岳阳市| 称多县| 和政县| 孟村| 泾川县| 临城县| 宣武区| 巴中市| 咸丰县| 大同县| 昌吉市| 丰顺县| 东丰县| 灵武市| 郑州市| 中阳县| 南岸区| 哈尔滨市| 乌兰县| 连城县| 子长县| 景东| 永顺县| 永仁县| 乡城县| 呼图壁县| 西贡区| 香港 | 安徽省|