zoukankan      html  css  js  c++  java
  • Spring整合Shiro

    1.首先要导入相应的依赖库

    <!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-spring -->
    <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-spring</artifactId>
        <version>1.4.1</version>
    </dependency>
    

    2.导入依赖库之后,就需要配置web.xml文件

    <filter>
            <filter-name>shiroFilter</filter-name><!--这里的"shiroFilter"名称必须要与Spring配置文件的名称保持一致,例如:如果要定义一个spring-shiro.xml配置文件的话,就需要为其追加同样的shiroFilter配置项--> 
         <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>

    3.

  • 相关阅读:
    socket套接字通信和粘包问题
    TCP协议
    网络编程
    单例模式
    类的内置方法(魔法方法)
    反射(hasattr和getattr和setattr和delattr)
    isinstance与issubclass
    绑定方法与非绑定方法
    鸭子类型
    类的多态和抽象类
  • 原文地址:https://www.cnblogs.com/wxl123/p/11173792.html
Copyright © 2011-2022 走看看