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>

  • 相关阅读:
    osg控制相机移动
    osg绘制胶囊体
    Pset_RampFlightCommon
    osg抓图
    osg截取场景图片
    osg实现三视图
    Sonar系列:Gitlab集成Sonarqube实现自动检测代码并发送报告给提交者(五)
    Sonar系列:通过Jenkins集成sonarqube做持续扫描(四)
    来到这座城市3年了
    DongTai--被动型IAST工具部署体验
  • 原文地址:https://www.cnblogs.com/zhaoqibo1701121/p/12552328.html
Copyright © 2011-2022 走看看