springboot 将web.xml配置转为类注解配置

一.

原本xml

<filter>  
        <filter-name>CASFilter</filter-name>  
        <filter-class>com.xb.login.RemoteAuthenticationFilter</filter-class>  
        <init-param>  
            <param-name>localLoginUrl</param-name>  
            <param-value>http://127.0.0.1:8080/casClient/login.jsp</param-value>  
        </init-param>  
        <init-param>  
            <param-name>casServerLoginUrl</param-name>  
            <param-value>https://sso.castest.com:8443/cas/remoteLogin</param-value>  
        </init-param>  
        <init-param>  
            <param-name>serverName</param-name>  
            <param-value>http://127.0.0.1:8080</param-value>  
        </init-param>  
    </filter>  

        <filter-mapping>
                <filter-name>CASFilter</filter-name>
                <url-pattern>/pages/*
        
        
                CASFilter
                *.action
        

改为

springboot 将web.xml配置转为类注解配置_第1张图片
springboot 将web.xml配置转为类注解配置_第2张图片

![在这里插入图片描述](https://img-blog.csdnimg.cn/20200918171515677.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3NzY2MjI0,size_16,color_FFFFFF,t_70#pic_center
过滤器的修改 则修改,new CasFilter类

你可能感兴趣的:(SpringBoot,springboot,注解)