主题:初学jsp请叫高手!
jackey8166
[专家分:0] 发布于 2006-11-18 18:58:00
我们上jsp课,老师给我们留了这样一道题:编写程序实现网页显示格式为word格式,在页面中显示系统时间,并每隔30秒刷新一次。我折腾了半天没弄出来,想请教下大哥大姐!谢谢!
回复列表 (共2个回复)
沙发
kenshu [专家分:0] 发布于 2006-11-25 10:20:00
我找到这个`~我也是菜鸟..你看下有没有用~~
// resp.Charset = "utf-8"
// resp.AddFileDependency(FileName)
// resp.ContentType = "Text/HTML"
//resp.ContentType = "application/vnd.ms-excel";
//resp.AppendHeader("Content-Type", "text/html; charset=gb2312");
板凳
zhangheng77 [专家分:5510] 发布于 2006-11-26 18:35:00
我这个是3秒刷新的,你要是要30秒<%response.setHeader("Refresh","30");%> 这里改一下即可
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.Date"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body >
<%response.setHeader("Refresh","3");%>
<h1>Time show</h1>
<%
out.println("Now the time is :");
out.print(new Date());
%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello ${param.name}!
</c:if>
--%>
</body>
</html>
我来回复