1)web.xml中配置过滤器信息
<filter> <filter-name>contextfilter</filter-name> <filter-class>com.bussiness.wechat.CorsFilter</filter-class> </filter> <filter-mapping> <filter-name>contextfilter</filter-name> <url-pattern>/system/*</url-pattern> </filter-mapping>
2)过滤器中的doFilter写法
还有改进的地方,后续学习之后继续完善