zoukankan      html  css  js  c++  java
  • jsp第三次作业

    main

    <%@ 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>
    <base href="<%=basePath%>">
    
    <title>My JSP 'main.jsp' starting page</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
    </head>
    
    <body>
        <jsp:include page="circle.jsp" flush="true">
            <jsp:param value="2" name="r" />
        </jsp:include>
        <br>
        <jsp:include page="ladder.jsp">
            <jsp:param value="2" name="shang" />
            <jsp:param value="3" name="xia" />
            <jsp:param value="4" name="high" />
        </jsp:include>
    
    </body>
    </html>

    circle

    <%@ 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>
    <base href="<%=basePath%>">
    
    <title>My JSP 'circle.jsp' starting page</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
    </head>
    <body>
        <%
      String a=request.getParameter("r");
      double b=Double.parseDouble(a);
      double pi=3.14;
      out.println("圆的半径为:"+b);
      
       %>
        <br>
        <%out.println("圆的面积为:"+(pi*b*b));
       %>
    </body>
    
    </html>

    ladder

    <%@ 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>
    <base href="<%=basePath%>">
    
    <title>My JSP 'ladder.jsp' starting page</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
    </head>
    
    <body>
    
        <%
      String a=request.getParameter("shang");
      String b=request.getParameter("xia");
      String c=request.getParameter("high");
      double d=Double.parseDouble(a);
      double e=Double.parseDouble(b);
      double f=Double.parseDouble(c);
      out.println("梯形的长宽高为:"+a+","+b+","+c);
      
       %>
        <br>
        <%out.println("梯形面积为:"+((d+e)*f/2));
       %>
    </body>
    </html>

  • 相关阅读:
    【每日一具3】推荐一个4K、蓝光、3D高清影视下载站,影视资源丰富 发烧友必备
    Python对程序中异常进行处理
    通过一个简单的例子,了解 Cypress 的运行原理
    ABAP 标准培训教程 BC400 学习教程之一:ABAP 服务器的架构和一个典型的 ABAP 程序结构介绍
    如何安装最新版本的 SAP ABAP Development Tool ( ADT ) 2021年度更新
    ABAP R3 时代著名的 SFLIGHT 航班模型测试数据,到了S/4HANA时代的进化版
    SAP Fiori Elements 应用的 i18n 语法使用方式
    SAP Fiori Elements List Report 里的表格类型(tableType)是如何决定出来的
    使用 XSLT 给 SAP PI 增加 CDATA
    SAP Fiori Elements 学习笔记
  • 原文地址:https://www.cnblogs.com/zhaoqibo1701121/p/12552328.html
Copyright © 2011-2022 走看看