idx.jsp <%@ page contentType = "text/html;charset=utf-8" %> <%@ include file = "common/codefile/idx.inc.jsp" %> <% module module = new module(); module.Init(request, response); String nOutput = module.getOutput(); out.clear(); out.print(nOutput); %> common/codefile/idx.inc.jsp <%@ page import = "jtbc.*" %> <% class module extends jpage { public String getOutput() { PageInit(); String tmpstr = ","; long tnTime = cls.getUnixStamp(); long tLastTime = cls.getNum64(cls.toString(conf.application.getAttribute(conf.getAppKey("update"))), 0L); if (tLastTime == 0L || (tnTime - tLastTime) > 1200) { tmpstr += "1,"; String tIndexHTML = ""; conf.cntitle(conf.jt.itake("default.channel_title", "lng")); tIndexHTML = conf.jt.itake("default.default", "tpl"); tIndexHTML = conf.jt.creplace(tIndexHTML); conf.common.filePutContents(conf.application.getRealPath(conf.getMapPath("index.html")).toString(), tIndexHTML); conf.application.setAttribute(conf.getAppKey("update"), tnTime); } PageClose(); return tmpstr; } } %> common/template/default.jtbc 代码中在合适的位置加入调用即可: <script type="text/javascript">cls.tigets('idx.jsp', nll);</script>
|