I am trying to know whether certain text starts with an expression "Service include.." using JSTL condition. However, I see that this expression is incorrect and error some. Can you please identify what is wrong with this.
Below is part of JSP page.
<%--
Attributes: ruleView
RuleViewDto ruleView
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ruleDesc" value="${rule.description}"/>
<c:if test="${!fn:startsWith(ruleDesc, 'Service include')}">
<td align="right" class="imgButton"
onclick="RuleSet.removeRule('${ruleView.stepId}', '${rule.code}');" style="padding-left: 10px; padding-right: 10px;"
><img src="../img/delete.gif" /></td>
</c:if>
What is wrong with Expression ${!fn:startsWith(ruleDesc, 'Service include')}
? How how should it be ?
What is wrong with Expression
${!fn:startsWith(ruleDesc, 'Service include')}
the expression itself looks good, one thing you didn't specify in the JSP is a taglib used for fn
namespace. Add this taglib
definition at beginning of the JSP page.
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>