aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/BinderHandler.java
blob: c89fc37cce9da16fcfafcdfd463a7ec2d0cbf12c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.juick.www;

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 BinderHandler {

    @InitBinder
    public void setAllowedFields(WebDataBinder dataBinder) {
        String[] denylist = new String[] { "class.*", "Class.*", "*.class.*", "*.Class.*" };
        dataBinder.setDisallowedFields(denylist);
    }
}