方槍槍的java世界

          不要因為風雨飄落就停止了你的腳步,真正的得失就在你的心中。 做喜歡做的事,不輕言放棄!

          08 整合spring3和mybatis進行web開發之global_security_xml

          <?xml version="1.0" encoding="UTF-8"?>
          <beans:beans xmlns=" xmlns:xsi=" xmlns:lang="http://www.springframework.org/schema/beans   
                 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
                 http://www.springframework.org/schema/aop   
                 http://www.springframework.org/schema/aop/spring-aop-3.0.xsd  
                 http://www.springframework.org/schema/tx   
                 http://www.springframework.org/schema/tx/spring-tx-3.0.xsd     
                 http://www.springframework.org/schema/context   
                 http://www.springframework.org/schema/context/spring-context-3.0.xsd     
                 http://www.springframework.org/schema/jee   
                 http://www.springframework.org/schema/jee/spring-jee-3.0.xsd      
                 http://www.springframework.org/schema/lang  
                 http://www.springframework.org/schema/lang/spring-lang-3.0.xsd  
                 http://www.springframework.org/schema/security   
                

           <http access-denied-page="/accessDenied.jsp">
            <intercept-url pattern="/styles/**" filters="none" />
            <intercept-url pattern="/images/**" filters="none" />
            <intercept-url pattern="/scripts/**" filters="none" />
            <intercept-url pattern="/index.jsp" filters="none" />  
            <intercept-url pattern="/login.jsp" filters="none" />
            <intercept-url pattern="/accessDenied.jsp" filters="none" />
            <intercept-url pattern="/role/**" access="ROLE_ADMIN" />
            <intercept-url pattern="/**" access="ROLE_USER,ROLE_ADMIN" />

            <!-- default-target-url="/home/load" -->
            <form-login login-page="/login.jsp"
             authentication-failure-url="/login.jsp?error=true"
             default-target-url="/main.jsp"
             always-use-default-target="true" />
            <logout logout-success-url="/login.jsp" />
            <http-basic />
           </http>

           <authentication-manager>
            <authentication-provider>
             <user-service>
              <user name="admin" password="1" authorities="ROLE_ADMIN" />
              <user name="a" password="1" authorities="ROLE_USER" />
              <user name="b" password="2" authorities="ROLE_USER,ROLE_ADMIN" />
              <user name="c" password="3" authorities="ROLE_GUEST" />
             </user-service>
            </authentication-provider>
           </authentication-manager>

          </beans:beans> 

          posted on 2012-07-07 15:14 做強大的自己 閱讀(181) 評論(0)  編輯  收藏 所屬分類: Spring

          主站蜘蛛池模板: 玛多县| 修文县| 治多县| 上杭县| 湖北省| 长泰县| 开化县| 吴堡县| 江西省| 东城区| 文成县| 鹤峰县| 泾川县| 多伦县| 孟津县| 开远市| 西乌| 武安市| 临安市| 铁岭县| 射阳县| 肇东市| 乌拉特中旗| 许昌县| 韶山市| 新野县| 江山市| 棋牌| 定日县| 沅陵县| 西青区| 于田县| 云阳县| 灵璧县| 遵义县| 巴彦淖尔市| 普格县| 海淀区| 大石桥市| 安阳市| 渝北区|