蜗牛—JSP学习乘法表页面输出

时间:2023-11-28 18:33:14
<%@page import="java.text.SimpleDateFormat" pageEncoding="utf-8"%>
<%@ page language="java" import="java.util.*"
contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>My JSP 'show_date.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head> <body> <!-- 实现撒旦撒旦 -->
<%--sssasddsadas --%> <%--
String dateStr = "";
Date date = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
"yyyy-MM-dd");
dateStr = simpleDateFormat.format(date);
String str = fmtDate(new Date());
--%> <%--!String temp = ""; public String fmtDate(Date date) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String dateStr = simpleDateFormat.format(date);
return dateStr;
}--%>
<table>
<%
for (int i = 1; i <= 9; i++) {
%>
<tr>
<%
for (int j = 1; j <= i; j++) {
%>
<td><%=i%>*<%=j%>=<%=i * j%></td>
<%
}
%>
</tr>
<%
}
%>
</table>
<div id="show_date"></div>
</body>
</html>

版权声明:本文博主原创文章,博客,未经同意不得转载。