【转】bean:write 中filter的作用
STRUTS的标签有一个 filter 属性,默认值为true。如果 filter 为true,将把输出内容中的特殊HTML符号作为普通字符串来显示;如果 filter 属性为false,则不会把输出内容中的特殊HTML符号转化为普通字符串。例如: <% String boldStart=""; String boldEnd=""; request.serAttribute("bs",boldStart); request.serAttribute("be",boldEnd); %> This should not be in bold
This should be in bold 以上代码先定义了两个 request 范围内的变量 bs 和 be,它们得知分别为""和""。在HTML语言中,""和""为粗体字的标记。第一组标签没有设置filter属性,将采用它的默认值true,此时""和""作为普通文本,因此输出内容为: This should not be in bold 第一组标签的filter属性为false,此时""和""作为html的粗体字的标记来处理,因此输出内容为: This should not be in bold