Java-乔晓松-Jsp页面九九乘法表

<%@ 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 %>&nbsp;&nbsp;</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">    
<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>
    <form  action="JspNum.jsp" method="post">
   StartNumber:<input type="text" name="start"/><br/>
   EndNumber:<input type="text" name="end"/>
   <br/><br/>
          <input type="submit" value="提交"/>
    <input type="reset" value="重置"/>
    </form>
  </body>

</html>








你可能感兴趣的:(Java-乔晓松-Jsp页面九九乘法表)