springsecurity过滤器优先级错误导致getAuthentication()为null

与sturts等整合的时候应放在Stuart过滤器的前面

 

[c-sharp]  view plain copy
  1. <!-- spring security configuration start -->  
  2.     <filter>  
  3.         <filter-name>springSecurityFilterChain</filter-name>  
  4.         <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>  
  5.     </filter>  
  6.     <filter-mapping>  
  7.         <filter-name>springSecurityFilterChain</filter-name>  
  8.         <url-pattern>/*</url-pattern>  
  9.         <dispatcher>REQUEST</dispatcher>  
  10.         <dispatcher>FORWARD</dispatcher>  
  11.     </filter-mapping>  
  12.     <!-- spring security configuration end -->  
  13.     <!-- Struts2 filter start -->  
  14.     <filter>  
  15.         <filter-name>struts2CleanupFilter</filter-name>  
  16.         <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>  
  17.     </filter>  
  18.     <filter>  
  19.         <filter-name>struts2</filter-name>  
  20.         <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>  
  21.     </filter>  
  22.     <!-- Struts2 filter end -->  
  23.     <!-- mapping start -->  
  24.     <filter-mapping>  
  25.         <filter-name>struts2CleanupFilter</filter-name>  
  26.         <url-pattern>/*</url-pattern>  
  27.         <dispatcher>REQUEST</dispatcher>  
  28.         <dispatcher>FORWARD</dispatcher>  
  29.     </filter-mapping>  
  30.     <filter-mapping>  
  31.         <filter-name>struts2</filter-name>  
  32.         <url-pattern>/*</url-pattern>  
  33.         <dispatcher>REQUEST</dispatcher>  
  34.         <dispatcher>FORWARD</dispatcher>  
  35.     </filter-mapping>  
  36.     <!-- mapping end -->  
  37.       
  38.     <listener>  
  39.         <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>  
  40.     </listener>   

 

麻烦唉

你可能感兴趣的:(null)