The EmptyOperator doesn't work for all objects implementing Collection as the specification requires. The apply(...) method only checks null, empty String, zero-length array, empty List or empty Map. Therefore, it doesn't work on a Set. Looking at the code, it appears that the Map and List specific logic could be replaced with Collection-specific logic, which would then support Set. This is also true of v 1.0.3 according to the source code I downloaded minutes ago (today is 4/8/2003). If you have any questions regardinging this, don't hesitate to contact me at mlissick@yahoo.com Best Regards, Mike Lissick
Created attachment 7035 [details] treats Collections instead of Lists or Maps
JSTL 1.0 specifies the following: A.3.8 Empty Operator - empty A The empty operator is a prefix operator that can be used to determine if a value is null or empty. To evaluate empty A - If A is null, return true, - Otherwise, if A is the empty string, then return true. - Otherwise, if A is an empty array, then return true. - Otherwise, if A is an empty Map, return true - Otherwise, if A is an empty List, return true, - Otherwise return false. Unfortunately, the case where A is a Collection was left out in 1.0. However, this has been fixed in the JSP 2.0 spec (which now owns the EL), and is therefore available with JSTL 1.1. PROPOSED FINAL DRAFT 3 JSP.2.3.7 Empty Operator - empty A The empty operator is a prefix operator that can be used to determine if a value is null or empty. To evaluate empty A EXPRESSION LANGUAGE 1-72 - If A is null, return true, - Otherwise, if A is the empty string, then return true. - Otherwise, if A is an empty array, then return true. - Otherwise, if A is an empty Map, return true, - Otherwise, if A is an empty Collection, return true, - Otherwise return false.