zoukankan      html  css  js  c++  java
  • JSP第三次作业(1)

    <%@ 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 'index.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  name="right" value="7"/>
        </jsp:include>
        <br>
        <jsp:include page="ladder.jsp">
        <jsp:param value="4" name="shang"/>
        <jsp:param value="6" name="xia"/>
        <jsp:param value="3" name="high"/>
        </jsp:include>
         
      </body>
    </html>
    <%@ 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("right");
      double b=Double.parseDouble(a);
      double pi=3.14;
      out.print("圆的面积为:"+(pi*b*b));
       %>
      </body>
    </html>
    <%@ 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.print("梯形面积为:"+((d+e)*f/2));
       %>
        <br>
      </body>
    </html>
  • 相关阅读:
    PHP基础入门(五)---PHP面向对象实用基础知识
    PHP基础入门(四)---PHP数组实用基础知识
    PHP基础入门(三)---PHP函数基础
    PHP基础入门(二)---入门基础知识必备
    PHP基础入门(一)---世界上最好用的编程语言
    【JavaScript OPP基础】---新手必备
    高级软件工程第六次作业:“希希敬敬对”团队作业-3
    高级软件工程第五次作业:“希希敬敬对”团队作业-2
    第四次软件工程团队作业:“希希敬敬对”队团队展示
    高级软件工程第三次作业:数独游戏界面功能
  • 原文地址:https://www.cnblogs.com/mengjia0513/p/12558776.html
Copyright © 2011-2022 走看看