在做一个报表,用jsp画出报表生成出excel。要求是定时执行报表,定时我知道可以用java.util.Timer实现,然后在tomcat启动时候初始化一个servlet,这个servlet我是这样写的package axtic.utils;import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;public class Startup extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=GBK"; //Initialize global variables
public void init() throws ServletException
{
try
{
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" http://192.168.1.17:8080/ICBC_jcsys/temp/Report1.jsp");
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" http://192.168.1.17:8080/ICBC_jcsys/temp/Report3.jsp");
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" http://192.168.1.17:8080/ICBC_jcsys/temp/Report4.jsp");
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" http://192.168.1.17:8080/ICBC_jcsys/temp/Report5.jsp");
}
catch (IOException e)
{
e.printStackTrace();
}
} //Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
} //Clean up resources
public void destroy() {
}
}
tomcat启动后,系统进程里面有4个ie进程,可是没有效果,也不能关闭。
请各位指点一下,先谢谢拉。
import javax.servlet.http.*;
import java.io.*;public class Startup extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=GBK"; //Initialize global variables
public void init() throws ServletException
{
try
{
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" http://192.168.1.17:8080/ICBC_jcsys/temp/Report1.jsp");
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" http://192.168.1.17:8080/ICBC_jcsys/temp/Report3.jsp");
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" http://192.168.1.17:8080/ICBC_jcsys/temp/Report4.jsp");
Runtime.getRuntime().exec("\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" http://192.168.1.17:8080/ICBC_jcsys/temp/Report5.jsp");
}
catch (IOException e)
{
e.printStackTrace();
}
} //Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
} //Clean up resources
public void destroy() {
}
}
tomcat启动后,系统进程里面有4个ie进程,可是没有效果,也不能关闭。
请各位指点一下,先谢谢拉。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货