方枪枪的java世界

不要因为风雨飘落就停止了你的脚步,真正的得失就在你的心中。 做喜欢做的事,不轻言放弃!

08 整合spring3和mybatis进行web开发之global_security_xml

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
 xmlns:aop="http://www.springframework.org/schema/aop" xmlns:jee="http://www.springframework.org/schema/jee"
 xmlns:context="http://www.springframework.org/schema/context"
 xmlns:lang="http://www.springframework.org/schema/lang" xmlns:beans="http://www.springframework.org/schema/beans"
 xsi:schemaLocation="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://www.springframework.org/schema/security/spring-security-3.0.xsd">

 <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 做强大的自己 阅读(176) 评论(0)  编辑  收藏 所属分类: Spring


只有注册用户登录后才能发表评论。


网站导航: