JSTL & Spring: Accessing Methods with Arguments

I have an object with a method

public boolean hasPermission(String role) { return permissions.contains(role); } 

I want to make an equivalent:

 <c:if test="${row.hasPermission(role)}"> <td></td> </c:if> 

But I can not access the hasPermission method from the JSP file. How can i do this?

+4
source share
1 answer

The latest version of EL (in tomcat 7 for example) supports this ( ${obj.method(arg)} )

If you have an older version, you have two options:

+6
source

All Articles