【Shiro】SpringMVC Mybatis Shiro RestTemplate的实现客户端无状态验证及访问控制

A.首先需要搭建SpringMVC+Shiro环境

a1.pom.xml配置
 spring:

 org.springframework

spring-webmvc
    4.1.0.RELEASE


    org.springframework
    spring-aop
    4.1.0.RELEASE


    org.springframework
    spring-jdbc
    4.1.0.RELEASE


    org.springframework
    spring-context-support
    4.1.0.RELEASE


    org.aspectj
    aspectjweaver
    1.8.7

 Mybatis:


    org.mybatis
    mybatis
    3.3.0


    org.mybatis
    mybatis-spring
    1.2.3


    jdbc.driver
    oracle.n
    12.1.0.1.RELEASE


    c3p0
    c3p0
    0.9.1.2

JSON转换,Bean转换,加密,文件上传,日志记录等相关工具:


    com.fasterxml.jackson.core
    jackson-core
    2.6.3


    com.fasterxml.jackson.core
    jackson-databind
    2.6.3


    net.sf.json-lib
    json-lib
    2.2.2-jdk15


    net.sf.ezmorph
    ezmorph
    1.0.6


    commons-codec
    commons-codec
    1.9


    commons-beanutils
    commons-beanutils
    1.7.0


    commons-collections
    commons-collections
    3.2


    commons-lang
    commons-lang
    2.4


    commons-fileupload
    commons-fileupload
    1.3.1


 org.slf4j
 slf4j-log4j12
 1.7.7

shiro:


    org.apache.shiro
    shiro-core
    1.2.2


    org.apache.shiro
    shiro-web
    1.2.2


    org.apache.shiro
    shiro-spring
    1.2.2

a2.web.xml配置

 



    webAppRootKey
    reedws



    mvc
    org.springframework.web.servlet.DispatcherServlet
    
        contextConfigLocation
        classpath:spring/spring-mvc.xml
    
    1


    mvc
    /




    log4jConfigLocation
    classpath:log4j.properties


    org.springframework.web.util.Log4jConfigListener




    contextConfigLocation
    classpath:spring/spring-mybatis.xml,classpath:spring/spring-service.xml,classpath:spring/spring-shiro.xml


    org.springframework.web.context.ContextLoaderListener




    org.springframework.web.util.IntrospectorCleanupListener




    encoding
    org.springframework.web.filter.CharacterEncodingFilter
    
        encoding
        GBK
    


    encoding
    /*




    shiroFilter
    org.springframework.web.filter.DelegatingFilterProxy
    
        targetFilterLifecycle
        true
    


    shiroFilter
    /*

你可能感兴趣的:(Shiro)