【问题标题】:JSTL dsp:input submit button value HTML entites not decodedJSTL dsp:输入提交按钮值 HTML 实体未解码
【发布时间】:2016-06-09 12:12:27
【问题描述】:

PFB JSP 代码,

<fmt:message var="applyText" key="checkout.order.summary.coupon.apply" />
<dsp:input iclass="btn green rev validatePromoCode" id="atg_store_applyCoupon" bean="CouponFormHandler.claimCoupon" type="submit" value="${applyText}" />

提交按钮的值来自属性文件,PFB,

checkout.order.summary.coupon.apply = Einl&ouml;sen

按钮值文本未在 UI 中编码,按钮的预期值应为 Einlösen

谢谢

【问题讨论】:

  • 您尝试过不同的编码吗? Einl\u00F6sen 应该这样做。

标签: jsp jstl jsp-tags atg oracle-commerce


【解决方案1】:

使用 dsp:tagAttribute:

<fmt:message var="applyText" key="checkout.order.summary.coupon.apply" />
<dsp:input iclass="btn green rev validatePromoCode" id="atg_store_applyCoupon" bean="CouponFormHandler.claimCoupon" type="submit">
    <dsp:tagAttribute name="value" value="${applyText}"/>
</dsp:input>

【讨论】:

    【解决方案2】:

    我过去也遇到过类似的问题。相信我通过在&lt;dsp:input /&gt; 中嵌套&lt;c:out /&gt; 标签来解决这个问题:

    <fmt:message var="applyText" key="checkout.order.summary.coupon.apply" />
    <dsp:input iclass="btn green rev validatePromoCode" id="atg_store_applyCoupon" bean="CouponFormHandler.claimCoupon" type="submit" value="<c:out value='${applyText}'/>" />
    

    【讨论】:

    • 我相信c:out 标签会适当地转义特殊字符。
    猜你喜欢
    • 2016-12-04
    • 2021-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-27
    • 2013-06-12
    • 1970-01-01
    • 2018-01-28
    相关资源
    最近更新 更多