From e3d4a431851cd68e8e98cd498821aaa137939c46 Mon Sep 17 00:00:00 2001 From: Takagi Date: Wed, 12 Jun 2024 17:41:11 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=8F=90=E4=BA=A40605/0606?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circle.jsp" | 19 ++++++ .../ladder.jsp" | 21 ++++++ .../main.jsp" | 30 +++++++++ .../zy1/index.jsp" | 65 +++++++++++++++++++ .../zy1/index1.jsp" | 41 ++++++++++++ 5 files changed, 176 insertions(+) create mode 100644 "work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/circle.jsp" create mode 100644 "work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/ladder.jsp" create mode 100644 "work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/main.jsp" create mode 100644 "work/com/java/minxi/java_20240606/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/zy1/index.jsp" create mode 100644 "work/com/java/minxi/java_20240606/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/zy1/index1.jsp" diff --git "a/work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/circle.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/circle.jsp" new file mode 100644 index 0000000..2e258cd --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/circle.jsp" @@ -0,0 +1,19 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-12 + Time: 16:34 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<% + float r=Float.parseFloat(request.getParameter("r")); + out.print(3.14*r*r); +%> + + diff --git "a/work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/ladder.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/ladder.jsp" new file mode 100644 index 0000000..8dbdf7c --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/ladder.jsp" @@ -0,0 +1,21 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-12 + Time: 16:41 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<% + float top=Float.parseFloat(request.getParameter("top")); + float bottom=Float.parseFloat(request.getParameter("bottom")); + float height=Float.parseFloat(request.getParameter("height")); + out.print((top+bottom)*height/2); +%> + + diff --git "a/work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/main.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/main.jsp" new file mode 100644 index 0000000..9a1f5a6 --- /dev/null +++ "b/work/com/java/minxi/java_20240605/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/main.jsp" @@ -0,0 +1,30 @@ +<%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-12 + Time: 16:35 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + + 圆的面积: + + + + +
+ + 梯形的面积: + + + + + + + + diff --git "a/work/com/java/minxi/java_20240606/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/zy1/index.jsp" "b/work/com/java/minxi/java_20240606/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/zy1/index.jsp" new file mode 100644 index 0000000..c3a7118 --- /dev/null +++ "b/work/com/java/minxi/java_20240606/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/zy1/index.jsp" @@ -0,0 +1,65 @@ +<%@ page import="java.sql.*" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.List" %><%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-12 + Time: 16:53 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<%! + Connection connection; + PreparedStatement preparedStatement; + ResultSet resultSet; + void getConnection() throws Exception{ + Class.forName("com.mysql.cj.jdbc.Driver"); + connection= DriverManager.getConnection("jdbc:mysql://localhost:3306/student?serverTimezone=Asia/Shanghai", "root", "123456"); + preparedStatement=connection.prepareStatement("select id,user_name,user_phone from user_info"); + resultSet=preparedStatement.executeQuery(); + } + public class userInfo{ + private int id; + private String name; + private long phone; + + public userInfo(int id, String name, long phone) { + this.id = id; + this.name = name; + this.phone = phone; + } + + @Override + public String toString() { + return "userInfo{" + + "id=" + id + + ", name='" + name + '\'' + + ", phone=" + phone + + '}'; + } + } +%> +<% + getConnection(); + List list= new ArrayList(); + + while (resultSet.next()){ + list.add(new userInfo(resultSet.getInt("id"),resultSet.getString("user_name"),resultSet.getLong("user_phone"))); + } + resultSet.close(); + preparedStatement.close(); + connection.close(); + request.setAttribute("list",list); + out.print(list); +%> +


+ + + + + diff --git "a/work/com/java/minxi/java_20240606/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/zy1/index1.jsp" "b/work/com/java/minxi/java_20240606/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/zy1/index1.jsp" new file mode 100644 index 0000000..5f712dd --- /dev/null +++ "b/work/com/java/minxi/java_20240606/java_2302_\346\235\216\346\224\277\345\223\262_2344310218/zy1/index1.jsp" @@ -0,0 +1,41 @@ +<%@ page import="java.util.List" %><%-- + Created by IntelliJ IDEA. + User: Administrator + Date: 2024-06-12 + Time: 17:18 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<%! + public class userInfo{ + private int id; + private String name; + private long phone; + + public userInfo(int id, String name, long phone) { + this.id = id; + this.name = name; + this.phone = phone; + } + + @Override + public String toString() { + return "userInfo{" + + "id=" + id + + ", name='" + name + '\'' + + ", phone=" + phone + + '}'; + } + } +%> +<% + List list= (List) request.getAttribute("list"); + out.println(list); +%> + + -- Gitee