JSP第一次上机作业

上机任务

1.搭建环境,建个工程,输出hello

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
  <head>    
    <title>My JSP 'index.jsp' starting page</title>
  </head> 
  <body>
  Hello!!</br>
  </body>
</html>

2.输出字母表

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
  <head>    
    <title>My JSP 'index.jsp' starting page</title>
  </head> 
  <body>
  <%
    for(char m='A';m <='Z';m++){
    out.print(m+"("+(char)(m+32)+")"+" ");
    }
  %>
  </body>
</html>

 

3.输出99乘法表

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
  <head>    
    <title>My JSP 'index.jsp' starting page</title>
  </head> 
  <body>
  <%
    for(int i=1;i <=9;i++){
    for(int j=1;j<=i;j++){
    int m=i*j;
    out.print(i+"×"+j+"="+m+"  ");
    }
    out.print("<br>");
    }
  %>
  </body>
</html>

 

posted @ 2022-03-02 11:36  小猪哏哏  阅读(33)  评论(0编辑  收藏  举报