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 劉錚 閱讀(680) 評論(0)  編輯  收藏 所屬分類: Tomcat


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


          網站導航:
           
          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導航

          統計

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評論

          主站蜘蛛池模板: 徐汇区| 会同县| 华池县| 南靖县| 永定县| 吐鲁番市| 新蔡县| 绵阳市| 哈尔滨市| 柳州市| 会理县| 弥渡县| 井陉县| 武强县| 沈阳市| 南通市| 伊金霍洛旗| 蓝山县| 泗阳县| 溧水县| 额尔古纳市| 建德市| 体育| 古蔺县| 苍南县| 北辰区| 湄潭县| 嘉禾县| 合肥市| 江川县| 塔河县| 蒙山县| 印江| 呼伦贝尔市| 白河县| 榆树市| 东海县| 孙吴县| 增城市| 德庆县| 涪陵区|