开发者

JSTL Syntax replaceAll()

I'm using start JSTL. Then I use ${fn:replaceAll('','','')} this function. Third parameter is must be <a href="pageContext.request.cont开发者_StackOverflow社区extPath"/people/id.shtml>name</a> then id and name is variable. But I can't write this anchor tag.


What you actually want is:

${fn:replace(text, 'before', 'after')}

Returns a string resulting from replacing in an input string all occurrences of a "before" string into an "after" substring.

Note the function is not called replaceAll.

If that doesn't work for you, then please provide a more detailed description of the error or behavior that occurs.


Based off your comment I think you want something like this:

<c:choose>
     <c:when test="${fn:contains(searchValue, searchString)}">
           <a href='mylink'>searchValue</a>
     </c:when>
     <c:otherwise>
           searchValue
     </c:otherwise>
</c:choose>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜