乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      apache shiro 學習

       昵稱11608230 2014-01-12
      shiro與spring結合配置時,首先在web.xml中配置一個filter:
      <!-- Shiro Security filter -->
      <filter>
      <filter-name>shiroFilter</filter-name>
      <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
      <init-param>
      <param-name>targetFilterLifecycle</param-name>
      <param-value>true</param-value>
      </init-param>
      </filter>
      <filter-mapping>
      <filter-name>shiroFilter</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>

      filter-class使用的是spring的代理,使用它時需要filter-name與spring的配置中的bean名字相同。
      targetFilterLifecycle 為true即讓spring管理這個filter的init, destory方法

      然后在applicationContext-shiro.xml中加入相應的設置與屬性
      <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
      <property name="securityManager" ref="securityManager" />
      <property name="loginUrl" value="/login.do" />
      <property name="successUrl" value="/welcome" />
      <property name="unauthorizedUrl" value="/403.html"/> 
      <property name="filterChainDefinitions">
      <value>
      /user/* = authc, perms[user:view]
      /user/* = authc, perms[admin:view]
      /admin/addAdmain* = authc, perms["admin:view,admin:add"]
      /admin/* == authc,perms[admin:view]
      /kaptcha* = anon
      /static/* = anon
      /login.html = anon
      /* = authc
      </value>
      </property>
      </bean>

        本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯系方式、誘導購買等信息,謹防詐騙。如發(fā)現有害或侵權內容,請點擊一鍵舉報。
        轉藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多