方槍槍的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 做強大的自己 閱讀(182) 評論(0)  編輯  收藏 所屬分類: Spring

          主站蜘蛛池模板: 固安县| 灌阳县| 宁化县| 桓仁| 苗栗市| 瓮安县| 扎兰屯市| 葵青区| 浮梁县| 华蓥市| 新晃| 怀仁县| 合肥市| 株洲市| 辽阳县| 开封市| 金华市| 江永县| 英山县| 松滋市| 苍南县| 将乐县| 南安市| 孟连| 长宁县| 古蔺县| 太和县| 北辰区| 叶城县| 荣昌县| 乌拉特后旗| 绩溪县| 崇州市| 德令哈市| 古丈县| 天峻县| 桑日县| 抚松县| 保靖县| 尉氏县| 新安县|