在应用系统的项目包下新建以下全局类,并保证这个类被 Spring 加载到(推荐在
Controller 所在的包中添加)。完成类添加后,需对项目进行重新编译打包和功能验证测试。
并重新发布项目。
'
import org.springframework.core.annotation.Order;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.InitBinder;
@ControllerAdvice
@Order(10000)
public class Xttblog{
@InitBinder
public void setAllowedFields(WebDataBinder dataBinder) {
String[] claArr = new String[]{"class.", "Class.", ".class.", ".Class."};
dataBinder.setDisallowedFields(claArr);
}
}
'
别问,core的poc还没出来,通了个大宵了。