From 742c74c4849d84276ebaf97149167d1bc175f5cb Mon Sep 17 00:00:00 2001
From: "@wks20050721" <2568429394@qq.com>
Date: Tue, 11 Jun 2024 20:24:59 +0800
Subject: [PATCH 1/2] =?UTF-8?q?feat:=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../circle.jsp" | 29 ++++++++++++++++
.../ladder.jsp" | 33 +++++++++++++++++++
.../main.jsp" | 26 +++++++++++++++
3 files changed, 88 insertions(+)
create mode 100644 "work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/circle.jsp"
create mode 100644 "work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/ladder.jsp"
create mode 100644 "work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/main.jsp"
diff --git "a/work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/circle.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/circle.jsp"
new file mode 100644
index 0000000..75c1b0f
--- /dev/null
+++ "b/work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/circle.jsp"
@@ -0,0 +1,29 @@
+<%--
+ Created by IntelliJ IDEA.
+ User: Administrator
+ Date: 2024-06-11
+ Time: 19:32
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+ 圆的面积
+
+
+
+<%!
+ //圆的半径
+ double r;
+%>
+
+
+<%
+ r = Double.parseDouble(request.getParameter("r"));
+%>
+圆的半径: ${param.r}
+
+圆的面积:<%=((r * r) * 3.14)%>
+
+
+
diff --git "a/work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/ladder.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/ladder.jsp"
new file mode 100644
index 0000000..7af7ddf
--- /dev/null
+++ "b/work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/ladder.jsp"
@@ -0,0 +1,33 @@
+<%--
+ Created by IntelliJ IDEA.
+ User: Administrator
+ Date: 2024-06-11
+ Time: 19:45
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+ 梯形
+
+
+<%!
+ // 上底
+ double top;
+ // 下底
+ double base;
+ // 高
+ double height;
+%>
+<%
+ top = Double.parseDouble(request.getParameter("top"));
+ base = Double.parseDouble(request.getParameter("base"));
+ height = Double.parseDouble(request.getParameter("height"));
+%>
+梯形的上底:${param.topLine}
+梯形的下底:${param.baseLine}
+梯形的高:${param.height}
+
+梯形的面积:<%=(top + base) * height / 2%>
+
+
diff --git "a/work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/main.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/main.jsp"
new file mode 100644
index 0000000..ca1f3d9
--- /dev/null
+++ "b/work/com/java/minxi/java_20240605/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/main.jsp"
@@ -0,0 +1,26 @@
+<%--
+ Created by IntelliJ IDEA.
+ User: Administrator
+ Date: 2024-06-11
+ Time: 19:45
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+ Title
+
+
+梯形
+
+
+
+
+
+圆
+
+
+
+
+
+
--
Gitee
From 502fbdc3b81a3396e07c406ce59633498abd129b Mon Sep 17 00:00:00 2001
From: "@wks20050721" <2568429394@qq.com>
Date: Tue, 11 Jun 2024 20:40:16 +0800
Subject: [PATCH 2/2] =?UTF-8?q?feat:=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../index.jsp" | 97 +++++++++++++++++++
.../index1.jsp" | 64 ++++++++++++
2 files changed, 161 insertions(+)
create mode 100644 "work/com/java/minxi/java_20240606/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/index.jsp"
create mode 100644 "work/com/java/minxi/java_20240606/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/index1.jsp"
diff --git "a/work/com/java/minxi/java_20240606/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/index.jsp" "b/work/com/java/minxi/java_20240606/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/index.jsp"
new file mode 100644
index 0000000..0b04bd2
--- /dev/null
+++ "b/work/com/java/minxi/java_20240606/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/index.jsp"
@@ -0,0 +1,97 @@
+<%@ page import="com.mysql.cj.jdbc.ConnectionGroupManager" %>
+<%@ page import="java.sql.DriverManager" %>
+<%@ page import="java.sql.Connection" %>
+<%@ page import="java.sql.Statement" %>
+<%@ page import="java.sql.ResultSet" %>
+<%@ page import="java.util.List" %>
+<%@ page import="java.util.ArrayList" %><%--
+ Created by IntelliJ IDEA.
+ User: Administrator
+ Date: 2024-06-06
+ Time: 09:35
+ 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 user_name ;
+ private String user_phone;
+
+
+ public UserInfo() {}
+
+ public UserInfo(int id, String user_name, String user_phone) {
+ this.id = id;
+ this.user_name = user_name;
+ this.user_phone = user_phone;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getUser_name() {
+ return user_name;
+ }
+
+ public void setUser_name(String username) {
+ this.user_name = username;
+ }
+
+ public String getUser_phone() {
+ return user_phone;
+ }
+
+ public void setUser_phone(String user_phone) {
+ this.user_phone = user_phone;
+ }
+ }
+ %>
+ <%
+ Class.forName("com.mysql.jdbc.Driver");
+ String url="jdbc:mysql://localhost:3306/student?serverTimezone=Asia/Shanghai";
+ String username="root";
+ String password="123456";
+ Connection conn = DriverManager.getConnection(url,username,password);
+ Statement stmt = conn.createStatement();
+ String sql="SELECT *from user_info;";
+ ResultSet rs = stmt.executeQuery(sql);
+ ArrayList userInfoList = new ArrayList();
+ while (rs.next()){
+ UserInfo userInfo = new UserInfo();
+ userInfo.setId(rs.getInt("id"));
+ userInfo.setUser_name(rs.getNString("user_name"));
+ userInfo.setUser_phone(rs.getString("user_phone"));
+ userInfoList.add(userInfo);
+ }
+
+ rs.close();
+ stmt.close();
+ conn.close();
+ %>
+
+ <%
+ for (UserInfo userInfo : userInfoList) {
+ out.println ( userInfo.getId () + userInfo.getUser_name () + userInfo.getUser_phone () );
+ }
+ %>
+
+
+
+
+
+
+
+
+
diff --git "a/work/com/java/minxi/java_20240606/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/index1.jsp" "b/work/com/java/minxi/java_20240606/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/index1.jsp"
new file mode 100644
index 0000000..63c5f8b
--- /dev/null
+++ "b/work/com/java/minxi/java_20240606/java_2302_\347\216\213\345\274\200\347\244\276_2344310220/index1.jsp"
@@ -0,0 +1,64 @@
+<%--
+ Created by IntelliJ IDEA.
+ User: Administrator
+ Date: 2024-06-11
+ Time: 20:31
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+ Title
+
+
+<%!
+ public static class UserInfo {
+ private int id;
+ private String userName;
+ private String userPhone;
+
+
+ public UserInfo(int id, String userName, String userPhone) {
+ this.id = id;
+ this.userName = userName;
+ this.userPhone = userPhone;
+ }
+
+ public UserInfo() {
+
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public String getUserPhone() {
+ return userPhone;
+ }
+
+ public void setUserPhone(String userPhone) {
+ this.userPhone = userPhone;
+ }
+
+
+
+ }
+%>
+<%
+ out.println(request.getParameter("userinfo"));
+%>
+
+
+
--
Gitee