It would be nice, but no, there is no way to do this directly. In addition, there is no workaround, as JSP EL functions must be public static . So the solution is to go back to the plain old JSP code:
<% Helper my= new Helper (pageContext); %>
Helper has a regular public method that takes a file name as an argument:
public String href (String fileName) { ... }
and later
... ${my.href(...)}
source share