• 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>

  • 相关阅读:
    借助baidu的jsonp接口,做一个自己的候选词组件
    Cannot set property 'innerHTML' of null
    Win下端口占用问题:OSError: [WinError 10013] 以一种访问权限不允许的方式做了一个访问套接字的尝试
    一文读懂ES6(附PY3对比)
    Wireshark:couldn't run dumpcap in child process(附带Linux下探索过程)
    一个模块导入的简单小测试
    万物互联之~网络编程加强篇
    网罗天下之~正则表达
    (转)RTSP协议详解
    (转)HLS协议,html5视频直播一站式扫盲
  • 原文地址:https://www.cnblogs.com/zhaoqibo1701121/p/12552328.html
Copyright © 2020-2023  润新知