tags:

views:

776

answers:

1

I have the following line in a JSP page:

<c:if test="${postAuditBean.postAudit.authority == authority.value}">

I would like change this comparison to first trim leading and trailing spaces from both the left and right hand expressions prior to comparison... as in something like this:

<c:if test="${trim(postAuditBean.postAudit.authority) == trim(authority.value)}">

I tried this:

<c:if test="${fn:trim(postAuditBean.postAudit.authority) == fn:trim(authority.value)}">

which generated a parsing error in the JSP page.

Can anyone tell me how to trim blanks from JSTL subexpressions?

A: 

Sorry... just realized I have not imported the JSTL function tag library. My bad. I will try that.