java - Spring Expression Language - Size property on List -
i trying use size
property on list using spring el, which's throwing exception size can't found.
@cacheable(value = "cache", unless = "#result.size > 0") public list<results> getresult();
exception:
org.springframework.expression.spel.spelevaluationexception: el1008e:(pos 8): field or property 'size' cannot found on object of type 'java.util.arraylist' @ org.springframework.expression.spel.ast.propertyorfieldreference.readproperty(propertyorfieldreference.java:217) @ org.springframework.expression.spel.ast.propertyorfieldreference.getvalueinternal(propertyorfieldreference.java:85) @ org.springframework.expression.spel.ast.propertyorfieldreference.access$000(propertyorfieldreference.java:43) @ org.springframework.expression.spel.ast.propertyorfieldreference$accessorlvalue.getvalue(propertyorfieldreference.java:346) @ org.springframework.expression.spel.ast.compoundexpression.getvalueinternal(compoundexpression.java:84)
size
resolves list#getsize()
doesn't exist. try size()
follows:
@cacheable(value = "cache", unless = "#result.size() > 0") public list<results> getresult();
Comments
Post a Comment