【问题标题】:Usage of defaultHtmlEscape web.xml in JSTLJSTL 中 defaultHtmlEscape web.xml 的使用
【发布时间】:2015-06-21 01:01:57
【问题描述】:

所以我在web.xml中设置了以下参数:

<context-param>
    <param-name>defaultHtmlEscape</param-name>
    <param-value>true</param-value>
</context-param>

这是否会通过仅在 JSP 中声明来自动转义字段的输出:

&lt;input type="text" class="form-control" id="label" name="label" value="${field.label}"&gt;

还是我需要使用&lt;spring:?还是使用&lt;form: 标签?

更新: 这个问题只是是/否的问题。也许是关于如何在 JSP 端激活参数的简短答案。我的问题是在我在web.xml 中设置参数之后。那么我需要在 JSP 中使用&lt;spring:&lt;form: 标签还是可以使用普通的&lt;input type... 标签?

【问题讨论】:

  • @RomanC 不是。我的问题是在我在web.xml 中设置参数之后。那么我需要在 JSP 中使用&lt;spring:&lt;form: 标签还是可以使用普通的&lt;input type... 标签?

标签: spring jsp spring-mvc spring-security jstl


【解决方案1】:

转义仅适用于 Spring MVC 标签。例如:

<form:input path="field" htmlEscape="true" />

【讨论】:

    猜你喜欢
    • 2011-05-25
    • 1970-01-01
    • 2014-03-18
    • 1970-01-01
    • 2016-04-20
    • 2015-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多