我使用的是start JSTL。然后我使用${fn:replaceAll('','','')}这个函数。第三个参数is必须是<a href="pageContext.request.contextPath"/people/id.shtml>name</a>,然后是id,name是变量。但是我不会写这个锚标签。
发布于 2010-12-14 06:48:13
你真正想要的是:
${fn:replace(text, 'before', 'after')}返回一个字符串,该字符串是通过将输入字符串中所有出现的"before“字符串替换为"after”子字符串得到的。
请注意,该函数不称为replaceAll。
如果这不适用于您,请提供所发生的错误或行为的更详细的描述。
发布于 2013-02-12 00:18:54
根据你的评论,我认为你想要这样的东西:
<c:choose>
<c:when test="${fn:contains(searchValue, searchString)}">
<a href='mylink'>searchValue</a>
</c:when>
<c:otherwise>
searchValue
</c:otherwise>
</c:choose>https://stackoverflow.com/questions/4428082
复制相似问题