JSP关于首页静态化,求高手讲解! 我现在用的是首页jstl标签判断EL是否为空,为空就直接跳向Action。现在网站还小,但是首页数据大了估计就很慢了。在网上查到有首页静态化这个功能,然后凌晨自动刷新?这种方法怎么实现? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /* * Create by: zhouwenfan * Email:[email protected] * Time: 2010-09-08 */package com.lucene.mysql;import java.io.BufferedWriter;import java.io.File;import java.io.FileWriter;import org.apache.commons.httpclient.HttpClient;import org.apache.commons.httpclient.methods.GetMethod;public class CreateStaticPage { public static void main(String[] args) { try{ HttpClient client = new HttpClient(); //client.getHostConfiguration().setHost("http://www.baidu.com"); //读取要生成静态页面的页面 GetMethod get = new GetMethod("http://www.baidu.com"); client.executeMethod(get); String s = get.getResponseBodyAsString(); //生成的静态页面存放的位置及名称 BufferedWriter bw = new BufferedWriter(new FileWriter(new File("d://baidu.html"))); bw.write(s); bw.close(); get.releaseConnection(); }catch (Exception ex ){ System.out.print(ex); } } } 用到的jarcommons-codec-1.3.jarcommons-httpclient-3.0.jarcommons-logging-1.1.jar 求高效数据处理解决方案(java服务器) 不是编码工作咋办? 请教jpa如何取得po的字段(column) Excel 转换成 Html status,Action 问题 求一个java小程序 一个关于如何显示用户名的问题,请大家帮帮忙 struts关于生成class文件的疑惑 跪求tomcat配置jsp文件 关于Struts2的JSON插件中的includeProperties属性问题 struts2 json得不到继承过来的属性 Struts1升级到Struts2中的文件上传问题
/*
* Create by: zhouwenfan
* Email:[email protected]
* Time: 2010-09-08
*/package com.lucene.mysql;import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;public class CreateStaticPage {
public static void main(String[] args) {
try{
HttpClient client = new HttpClient();
//client.getHostConfiguration().setHost("http://www.baidu.com");
//读取要生成静态页面的页面
GetMethod get = new GetMethod("http://www.baidu.com");
client.executeMethod(get);
String s = get.getResponseBodyAsString();
//生成的静态页面存放的位置及名称
BufferedWriter bw = new BufferedWriter(new FileWriter(new File("d://baidu.html")));
bw.write(s);
bw.close();
get.releaseConnection();
}catch (Exception ex ){
System.out.print(ex);
}
} }