0

It is stated in the documentation of @SortDefault that

Annotation to define the default Sort options to be used when injecting a Sort instance into a controller handler method.

But the fact is, I got this exception:

Failed to instantiate [org.springframework.data.domain.Sort]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.springframework.data.domain.Sort.()

Did I miss something here?

void download(WebRequest request, HttpSession session,
      @RequestParam(value = "fields",
          defaultValue = "id,hostname,networkId,customerId") String[] visibleProperties,
      @SortDefault("hostname") Sort sort, HttpServletResponse response) {
}
sancho21
  • 3,511
  • 1
  • 39
  • 45

1 Answers1

0

You probably missed an @EnableSpringDataWebSupport in your configuration.

a better oliver
  • 26,330
  • 2
  • 58
  • 66