偶是个菜鸟,现在迷路了,望大侠给予指点!
在jive/admin/filter.jsp中添加删除编辑过滤器,其最终结果都是保存在了jive_filtets.xml文件里面。这个我
明白了。
可是就是不明白对于一个message的过滤动作究竟发生在哪一步。
下面的是message接口中的注释
/**
* Returns the message body. If message filters are active, the body
* returned will be a filtered one. Because filters often provide security
* functionality such as stripping out HTML and Javascript, this method is
* the preferred way to get the body of a message.
*
* @return the body of the message.
public String getBody();
这个是在DbForumMessage中的的实现代码。
public String getBody() {
// Return cached filter value if it exists.
if (filteredBody != null) {
return filteredBody;
}
// Otherwise, return normal value.
else {
return body;
}
}
不明白这里的判断,在哪一个地方改变了filteredBody的值使他不等于null值。
改变是肯定的,可是我找不到具体动作在哪一步发生。
我清楚
ForumMessage,DbForumMessage,ForumMessageFilter(以及继承于他的具体过滤器类),
FilterManager,DbFilterManager之间的关系
但是下面的这段代码真的让我迷惑了,到底在那个调用了具体的过滤器类使message发生改变,找了很长时间
都没有找到,可能就差那一步。
望大虾不吝赐教,不胜感激
if (filteredBody != null) {
return filteredBody;
}