jsp第一周作业
1.搭建环境,建个工程,输出hello
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> Holle <br> </body> </html>
2.输出字母表
<%@ 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> </head> <body> <br>英语字母表 <br> <% for(int i='A';i<='Z';i++){ out.print((char)i+"("+(char)(i+32)+")"+"<br>"); } %> </body> </html>
![](https://img2022.cnblogs.com/blog/2321477/202203/2321477-20220306173758372-1919264831.jpg)
3.输出99乘法表 <%@ 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> </head> <body> <br>99乘法表 <br> <% for(int i=1;i<=9;i++){ for(int j=1;j<=i;j++){ int n=i*j; out.print(i+"*"+j+"="+n+" ");} out.print("<br>"); } %> </body> </html>