JSP : JSTL 的 <c:out>标签 [英] JSP : JSTL's <c:out> tag

查看:31
本文介绍了JSP : JSTL 的 <c:out>标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

写一个JSP页面,究竟是做什么的?我注意到以下两者的结果相同:

Writing a JSP page, what exactly does the <c:out> do? I've noticed that the following both has the same result:

<p>The person's name is <c:out value="${person.name}" /></p>
<p>The person's name is ${person.name}</p>

推荐答案

c:out 转义 HTML 字符,以便您可以避免跨站点脚本.

c:out escapes HTML characters so that you can avoid cross-site scripting.

if person.name =

脚本将在第二种情况下执行,但在使用 c:out

the script will be executed in the second case, but not when using c:out

这篇关于JSP : JSTL 的 &lt;c:out&gt;标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆