Accepting a Spring Data REST URI in custom controller

后端 未结 2 541
时光说笑
时光说笑 2021-02-05 08:08

I have a Spring Data Rest webmvc application that I\'d like to add some custom functionality to for batch operations.

I\'ve created a controller, and blended it into the

2条回答
  •  猫巷女王i
    2021-02-05 08:36

    As it turns out, I was on the right track with adding a converter, unfortunately I was doing it in the wrong configuration method.

    I was able to get the desired functionality by moving my testConverter() bean to the RepositoryRestMvcConfiguration extension config class and then adding

    @Override
    public void configureConversionService(ConfigurableConversionService service) {
        service.addConverter(testConverter());
    }
    

    And working as intended. I feel a bit silly now for throwing that in the wrong spot in the first place, but hopefully this will help someone else out!

提交回复
热议问题