1.
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> Hello! <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> <p>英文字母:</p> <% for(char a='A';a<='Z';a++){ out.print(a+"("+(char)(a+32)+")"+" "); } %> <br> </body> </html>
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> <p>九九乘法表:<p/> <% for(int j=1;j<=9;j++){ for(int i=1;i<=j;i++){ int n=i*j; out.print(i+"x"+j+"="+n+" "); } out.print("<br>"); } %> <br> </body> </html>