Tomcat中的authorization的設置

          主要是兩個步驟:

          第一步在tomcat-users.xml中加入
          <tomcat-users>
              <role rolename="Admin"/>
              <user username="jack" password="jack" roles="Admin"/>
          </tomcat-users>


          第二步在該project中的web.xml加入:
          (例子)
              <security-constraint>
                  <web-resource-collection>
                      <web-resource-name>access</web-resource-name>//mandatory,可以任意取名
                      <url-pattern>/app</url-pattern>
                      <url-pattern>/*</url-pattern>

                  </web-resource-collection>
                  <auth-constraint>
                      <role-name>Admin</role-name>
                  </auth-constraint>
              </security-constraint>
              <login-config>
                  <auth-method>BASIC</auth-method>//最基本的登陸信息對話框
              </login-config>

          posted on 2007-11-09 16:33 劉錚 閱讀(673) 評論(0)  編輯  收藏 所屬分類: Tomcat


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


          網站導航:
           
          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          導航

          統計

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評論

          主站蜘蛛池模板: 华亭县| 武夷山市| 泸定县| 天津市| 彭山县| 绿春县| 隆昌县| 兴业县| 景泰县| 房产| 资阳市| 文山县| 黄石市| 松江区| 堆龙德庆县| 中西区| 于田县| 信阳市| 保定市| 襄城县| 商南县| 濉溪县| 嘉禾县| 礼泉县| 富裕县| 兰考县| 彰化县| 北安市| 蓬莱市| 西充县| 英德市| 博罗县| 尼木县| 水城县| 剑阁县| 昌邑市| 馆陶县| 乌拉特中旗| 承德县| 娄烦县| 苍溪县|