最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

taglib - Format the rendered output of a JSP tag - Stack Overflow

programmeradmin4浏览0评论

I am working to upgrade an app from Java 8 to Java 17. The app uses JSP for front-end. I am running into issue with apache-taglib-string.jar

It has basic String formatting tags that encapsulate other JSP tags and format the rendered output of the encapsulated tag.

I replaced the use of this taglib wherever the code just format a value with JSTL Functions however, in a few particular cases JSTL Fn is not working as the string to format is not available in the JSP request context and rather is provided by a tag.

Example:

<s:upperCase>
    <fmt:formatDate value="${someMonth}" pattern="MMM"/>
</s:upperCase>

<s:upperCase>
    <spring:message code="some.label"/>
</s:upperCase>

<s:upperCase>
    <sl:lookup bundle="someBundle" key="${someValue}" defaultToKey="true"/> 
</s:upperCase>

In the above examples, the body for upperCase tag (.apache.taglibs.string.UpperCaseTag) is provided by only when the children element is rendered.

I checked the latest Apache Taglib docs and looks like String tags are gone: /

Am I looking at the wrong taglib docs? Is there any other way to achieve the same result?

发布评论

评论列表(0)

  1. 暂无评论