jsp第一次作业

1.环境搭建,运行出来一个JSP页面,显式hello
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
hello
</body>

</html>


 

 

 

 

 

 


2.英文字母表
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
        char a;
        char b;
        for(a='A';a<='Z';a++){
        b=(char)(a+32);
        out.print(a+"  "+"("+b+")"+"  ");
        }
     %>
</body>
</html>

  

 

 

3.99乘法表
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
for (int i = 1; i <= 9; i++) {
    for (int j = 1; j <= i; j++) {
        out.print(j + "*" + i + "=" + i * j + "  ");
    }
    out.print("<br>");
}
     %>
</body>
</html>

  

 

posted @ 2022-03-06 20:17  monster丶易  阅读(16)  评论(0编辑  收藏  举报