The code as you have it, both are calculated as false because you have a whitespace inside your test " "
test=" true" <!-- condition is calculated as false -->
test="true" <!-- condition is true -->
Moreover to call method from jstl you have to call it withour get or is prefix. e.g. ${var.empty} calls isEmpty or getEmpty of var object.
Edit
It will be better approach ${empty var},
because it's true either var is '' or null.
empty
covers and null conditions.