I have the following code in a jsp page (Struts backed):
<c:if test="${USERINFO.someproperty == 'test'}">
...
</c:if>
But what I would like to do is compare only a substring of someproperty, like e.g. if the suffix ends with "st". I am using JSTL 1.0 so the endsWith() function from JSTL 1.1 is not available (as far as I know) and furthermore, I would prefer a solution that doesn't involve me writing a custom Java class for this.
I was thinking something along these lines:
<c:set var="someproperty"><%= USERINFO.someproperty.substring(USERINFO.someproperty.length()-2, 2) %></c:set>
<c:if test="${someproperty == 'st'}">
...
</c:if>
But of course USERINFO is not accessible to Java like that.
Any ideas?