乘法表
原文链接:http://blog.csdn.net/redarmy_chen/article/details/8197928
index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
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 'index.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>
<center>
<p align="center">LOOK</p>
<form action="jiujiu.jsp" method="post">
<table border="2px" cellpadding="0" cellspacing="0">
<tr>
<td>startNumber:</td>
<td><input type="text" name="startNumber"/></td>
</tr>
<tr>
<td>endNumber:</td>
<td><input type="text" name="endNumber"/></td>
</tr>
<tr>
<td><center><input type="submit" value="queren"></center></td>
<td><center><input type="reset" value="chongzhi"/></center></td>
</table>
</form>
</center>
</body>
</html>
jiujiu.jsp
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
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 'jiujiu.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>
<font size=12 color=red>LOOK</font><br>
<%
int startNum=Integer.parseInt(request.getParameter("startNumber"));
int endNum=Integer.parseInt(request.getParameter("endNumber"));
for(int i=startNum; i<=endNum; i++)
{
for(int j=1; j<=i; j++)
{
out.print(j+"*"+i+"="+(i*j)+"\t");
out.print(" ");
}
out.print("<br/>");
}
%>
</body>
</html>