That's because Spring isn't managing your PagePopulationInterceptor instance. You are creating it yourself in the below (拦截器内使用@Autowired时出现了null,这是由于你的spring对象注入时机在你的拦截器之后了) public @Override void addInterceptors(InterceptorRegistry registry) { regis
package com.swift; //使用无参构造方法自动生成对象,序号不断自增 public class Person { private static int count; //如果在定义类时,使用的是静态的属性,则得到的结果是不同的.count生命周期长,与类相同 public int id; public String name; public int age; public String city; public Person() { super(); count++; this.