一、SpringMVC 表单元素标签 如下:
<form:textarea path="remarks" htmlEscape="false" class="input-xlarge"/>
其中的属性 htmlEscape的作用是? 大致的意思是起转义作用。

二、测试如下
1、htmlEscape="false" , 输入内容 "<" ;结果如下图

SpringMVC 表单标签中 htmlEscape 属性的作用

 

 

 2、htmlEscape="true" , 输入内容 "<" ;结果如下图

SpringMVC 表单标签中 htmlEscape 属性的作用

 

 3、去掉 htmlEscape 属性 , 输入内容 "<" ;结果如下图

SpringMVC 表单标签中 htmlEscape 属性的作用

 

 

三、 总结

1、htmlEscape 属性作用理解为:是否转义字符, 默认为 true ,若要设置不对特殊字符进行转移,需设置为 false 。  如果不添加这个属性的话,默认的此属性是有的,且默认值是true
2、转义字符为: <    、 "    & ( 转义字符是 XML中5个预定义的实体引用)

 

 


参考链接:https://blog.csdn.net/HaHa_Sir/article/details/78609183

相关文章:

  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-01-07
  • 2021-04-26
  • 2021-11-19
  • 2022-12-23
  • 2021-09-11
猜你喜欢
  • 2022-12-23
  • 2021-08-09
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案