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 0000000000000000000000000000000000000000..2e258cde69ed8091414cf12f423564b3e7dcf1af --- /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 0000000000000000000000000000000000000000..8dbdf7c9a9ce4389a826fb2809abc6c66025a851 --- /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 0000000000000000000000000000000000000000..9a1f5a6f1ba3a698b4b5d6a4908f3be5dafc705b --- /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 0000000000000000000000000000000000000000..c3a7118ffbca08b21e864eab556bc9e611f0198b --- /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 0000000000000000000000000000000000000000..5f712dd9e76bf64118efa8a62f4eecc44717c209 --- /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); +%> + +