Jsp页面九九乘法表
2012-11-08 19:42:24 来源:WEB开发网 <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="org.omg.CORBA.Request"%>
<%
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 'JspNum.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>
<table >
<%
int x = Integer.valueOf(request.getParameter("start"));
int y = Integer.valueOf(request.getParameter("end"));
for(int i=x;i<=y;i++){%>
<tr bgcolor="red">
<% for(int j=1;j<=i;j++){
%>
<td><%=i %>*<%=j %>=<%=i*j %> </td><%} %>
</tr>
<%} %>
</table>
<br/>
<table>
<%
int q = Integer.valueOf(request.getParameter("start"));
int w = Integer.valueOf(request.getParameter("end"));
for(int i=q;i<=w;i++){
out.print("<tr >");
for(int j=1;j<=i;j++){
out.print("<td bgcolor='orange'>");
out.print(i+"*"+j+"="+(i*j)+"\t");
out.print("<td>");
}
out.print("</tr><br/>");
}
%>
</table>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="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 'Num.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">
更多精彩
赞助商链接