首页 > 其他 > 详细

20151119

时间:2015-11-19 22:30:48      阅读:240      评论:0      收藏:0      [点我收藏+]

技术分享

技术分享
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" errorPage="error.jsp"%>
<!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>Insert title here</title>
</head>
<body>
网页正文
<br>
<br>
<%@
include file="include.jsp"
%>

</body>
</html>
网页错误的跳转--错误页面
技术分享
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isErrorPage="true"%>
<!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>Insert title here</title>
</head>
<body>
页面出错了!
</body>
</html>
网页错误的跳转--跳转到的页面
技术分享
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

    <%@ page import="java.util.Date" %>
    <%@ page import="java.text.SimpleDateFormat" %>

<!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>Insert title here</title>
</head>
<body>

<%

// 声明和实例化了Date对象,获取系统时间

// 在页面上显示当前时间
// 声明和实例化了一个Date对象
Date date = new Date();
// 格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

String dt = sdf.format(date);

%>

输出当前时间:<%=dt %>

<br>

显示汉字!!!

</body>
</html>
实例化服务器当前时间,并将当前时间输出出来

 

20151119

原文:http://www.cnblogs.com/name-hanlin/p/4978985.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!