第一周

  1. 环境搭建,运行出来一个JSP页面,显式hello

 

 

 

  1. 英文字母表

 

 

 

 1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 2 <%
 3 String path = request.getContextPath();
 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 5 %>
 6 
 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 8 <html>
 9   <head>
10     <base href="<%=basePath%>">
11     
12     <title>My JSP 'index.jsp' starting page</title>
13     <meta http-equiv="pragma" content="no-cache">
14     <meta http-equiv="cache-control" content="no-cache">
15     <meta http-equiv="expires" content="0">    
16     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
17     <meta http-equiv="description" content="This is my page">
18     <!--
19     <link rel="stylesheet" type="text/css" href="styles.css">
20     -->
21   </head>
22   
23   <body>
24     <h3>乘法表</h3>
25     <p style ="font-family:宋体;font-size:15;colcr:bule">
26     <% 
27     for(int j=1;j<=9;j++){
28      for(int i=1;i<=j;i++){
29        int n=i*j;
30        out.print (i+"x"+j+"="+n+" ");
31       }
32       out.print("<br>");
33     }
34       %>
35     </p>
36   </body>
37 </html>

 

  1. 99乘法表

 

 

 1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 2 <%
 3 String path = request.getContextPath();
 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 5 %>
 6 
 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 8 <html>
 9   <head>
10     <base href="<%=basePath%>">
11     
12     <title>My JSP 'index.jsp' starting page</title>
13     <meta http-equiv="pragma" content="no-cache">
14     <meta http-equiv="cache-control" content="no-cache">
15     <meta http-equiv="expires" content="0">    
16     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
17     <meta http-equiv="description" content="This is my page">
18     <!--
19     <link rel="stylesheet" type="text/css" href="styles.css">
20     -->
21   </head>
22   
23   <body>
24     <p style = "font-family:黑体;gont-size:36">
25     <br>英文字母表:</br>
26     </p>
27     <p style ="font-family:宋体;font-size:25;colcr:bule">
28     <% char upperCase;
29       char lowerCase;
30       for(upperCase = 'A';upperCase <='Z';upperCase++){
31       lowerCase=(char)(upperCase+32);
32       out.print(upperCase +"("+lowerCase + ")"+ " ");
33       if(upperCase == 'M')
34       out.print("<br>");
35       } 
36       %>
37     </p>
38   </body>
39 </html>

 

posted @ 2022-03-05 19:31  1902sjw  阅读(27)  评论(0编辑  收藏  举报