Spring Boot - Liste des komplexen Objekts bei GET -MappingJava

Java-Forum
Anonymous
 Spring Boot - Liste des komplexen Objekts bei GET -Mapping

Post by Anonymous »

Ich habe eine einfache @getmapping wie folgt:

Code: Select all

@GetMapping
public Page search(Pageable pageable, List filters) {
return Page.empty();
}
< /code>
FilterCriterion.java
:

Code: Select all

public class FilterCriterion {
private @NotBlank @Size(min = 1, max = 255) String column;
private @NotNull FilterOperation operation;
private @Size(max = 255) String value;
// getters, setters, no-args and all-args constructor
}
< /code>
FilterOperation.java
:

Code: Select all

public enum FilterOperation {
EQUALS,
NOT_EQUALS,
CONTAINS,
LT,
LTE,
GT,
GTE
}
Problem
Beim Senden von GET wie diese

Code: Select all

http://localhost:8080/departments?page=0&size=10&sort=name,asc&filters[0].column=name&filters[0].operation=EQUALS&filters[1].value=foo

Ich erhalte diesen Fehler:

Code: Select all

java.lang.IllegalStateException: No primary or single unique constructor found for interface java.util.List
< /code>
Changing List
zu arrayList löst die Ausnahme auf, führt jedoch dazu, dass nur die lehbaren Datenfelder einen Wert haben. Die Liste der Filterkriterien ist immer noch leer.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post