JTBC(CMS)

开源与免费的跨平台网站内容管理系统解决方案

首页 » 在线论坛 » JAVA版本 
帖子内容
1 楼
jetiben
管理员
积分 4714
注册 2006-06-28
     
JSP自动定时生成首页HTML程序
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>
本帖由 jetiben 于 2010-02-22 21:49:51 编辑过
2010-02-03 01:26:44 http://www.jetiben.com/
2 楼
new
银牌会员
积分 526
注册 2009-06-30
     
回复: JSP自动定时生成首页HTML程序
转述:此贴必火,广告位待租
本帖由 new 于 2010-02-03 08:57:45 编辑过
2010-02-03 08:41:16 new start...
3 楼
tuotuo
金牌会员
积分 876
注册 2008-03-21
     
回复: JSP自动定时生成首页HTML程序
2010-02-04 01:36:32 XUPEM前沿媒体 时尚生活杂志 www.xupem.com
4 楼
tuotuo
金牌会员
积分 876
注册 2008-03-21
     
回复: JSP自动定时生成首页HTML程序
看了下  觉得好像没懂  用不来
2010-02-18 02:16:45 XUPEM前沿媒体 时尚生活杂志 www.xupem.com
5 楼
nilcay
注册会员
积分 360
注册 2008-10-27
     
回复: JSP自动定时生成首页HTML程序
俺们现在不用JSP,先占个广告位吧!
2010-02-20 01:07:17 去我的世界看看:www.seeble.cn
6 楼
tuotuo
金牌会员
积分 876
注册 2008-03-21
     
回复: JSP自动定时生成首页HTML程序
jt又犯错误了

2010-02-21 18:07:56 XUPEM前沿媒体 时尚生活杂志 www.xupem.com
7 楼
hilly
注册会员
积分 8
注册 2010-03-05
     
回复: JSP自动定时生成首页HTML程序
只有首页的吗?
2010-03-09 09:16:46 安之信网络:http://www.anzhixin.com
回复帖子
发表人
主题
内容
验证码