My costum code in the initBinder method doesn't work in the RestController

I'm trying to remove whitespace using stringTrimmerEditor when a user enters a title in a text field, I used an initBinder to preprocess all the requests coming to my RestController, but the whitespace is not removed.


public class ProjectController {

    ProjetRepository projetRepository;

    EnseignantRepository enseignantRepository;

    public  void initBinder(WebDataBinder webDataBinder){

        StringTrimmerEditor stringTrimmerEditor = new StringTrimmerEditor(true);


    public Projet addProject(@PathVariable int idEnseignant, @Valid @RequestBody Projet projet){


        projet.setDateProposition(new Date());;

        return projet;

I tried to test my API using postman. I entered some whitespace and when I run my request the intitule attribute is stored with whitespace despite my preprocess method initBinder.

    "intitule" : "    eAlerte  ",
    "resume" : "test"