使用以下代码,如果s_dlText以 string 开头,则执行指令中"Shipping costs"的代码c:when(该单词"Pass1"出现在结果页面中):
<c:choose>
<c:when test="${fn:startsWith(s_dlText, 'Shipping costs') == true}">
<br />
Pass1
<br />
</c:when>
</c:choose>
而在以下情况下,如果s_dlText以 string 开头,则不会执行指令中"Shipping costs"的代码c:when(该单词"Pass2"不会出现在结果页面中):
<c:choose>
<c:when test="${fn:startsWith(s_dlText, S_SHIPPING_COSTS) == true}">
<br />
Pass2
<br />
</c:when>
</c:choose>
S_SHIPPING_COSTS在中声明如下web.xml:
<context-param>
<param-name>S_IF_MSG_SHIPPING_COSTS</param-name>
<param-value><![CDATA[Shipping costs]]></param-value>
</context-param>
你看到没有以正确的方式完成吗?谢谢。
注1
请注意,如果我删除<![CDATA[]]>标记,行为是相同的。