3 changed files with 26 additions and 4 deletions
@ -0,0 +1,21 @@ |
|||
package com.userinformation.backend.config; |
|||
|
|||
import org.springframework.core.annotation.Order; |
|||
import org.springframework.web.bind.annotation.ControllerAdvice; |
|||
import org.springframework.web.bind.annotation.InitBinder; |
|||
|
|||
/** |
|||
* @author: xiaowuler |
|||
* @createTime: 2022-04-02 14:02 |
|||
* @describe: spring freamwork bug 处理 |
|||
*/ |
|||
@ControllerAdvice |
|||
@Order(10000) |
|||
public class BinderControllerAdvice { |
|||
@InitBinder |
|||
public void setAllowedFields(org.springframework.web.bind.WebDataBinder binder) { |
|||
String[] denylist = new String[]{"class.*", |
|||
"Class.*", "*.class.*", "*.Class.*"}; |
|||
binder.setDisallowedFields(denylist); |
|||
} |
|||
} |
Loading…
Reference in new issue