我在Meteor 1.1.0.2应用程序中有以下(简化的)SimpleSchema架构:
Tickers.attachSchema(
new SimpleSchema({
entries: {
type: [TickerEntries],
defaultValue: [],
optional: true
}
})
);
TickerEntries = new SimpleSchema({
id: {
type: String,
autoform: {
type: "hidden",
label: false,
readonly: true
},
optional: true,
autoValue: function () {
if (!this.isSet) {
return new Mongo.Collection.ObjectID()._str;
}
}
},
text: {
type: String,
label: 'Text'
}
};
Run Code Online (Sandbox Code Playgroud)
在数据库中,我有以下条目:
{
"_id" : "ZcEvq9viGQ3uQ3QnT",
"entries" : [
{
"text" : "a",
"id" : "fc29774dadd7b37ee0dc5e3e"
},
{
"text" : "b",
"id" : "8171c4dbcc71052a8c6a38fb"
} …Run Code Online (Sandbox Code Playgroud) 如何实现包含文本区域的jsp站点,该文本区域显示(tomcat)服务器上的日志文件并自动刷新.
我认为刷新很容易使用setTimeout轮询到服务器并发送ajax请求.但问题是如何监视服务器上的文件(它是一个Log4J日志文件 - 也许我可以使用自己的appender?)进行更改并在ajax请求到达时仅发送更改的行?
我不知道如何检测日志中更改的行...