From 8d753450b811d7188d148d1d5a341265005d9e85 Mon Sep 17 00:00:00 2001 From: Administrator <2823455505@qq.com> Date: Thu, 6 Jun 2024 11:39:43 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=E6=8F=90=E4=BA=A4=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/WEB-INF/web.xml | 6 +++++ .../Circle.jsp" | 27 +++++++++++++++---- .../Ladder.jsp" | 25 +++++++++++++++++ .../Main.jsp" | 20 ++++++++++++-- .../Index.jsp" | 0 5 files changed, 71 insertions(+), 7 deletions(-) create mode 100644 web/WEB-INF/web.xml create mode 100644 "work/com/java/minxi/java_20240606/java_2302_\351\231\210\346\204\210_2344310237/Index.jsp" diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml new file mode 100644 index 0000000..d80081d --- /dev/null +++ b/web/WEB-INF/web.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git "a/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Circle.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Circle.jsp" index 1958b19..756848b 100644 --- "a/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Circle.jsp" +++ "b/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Circle.jsp" @@ -1,4 +1,4 @@ -<%@ page import="java.util.Scanner" %> + <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> @@ -14,11 +14,28 @@ -
-

-<% -out.print("圆的面积为:"+200*200+"mm"); +

+ <%! + + + public String Arez(double a){ + double arez=3.14*a; + String ares = String.format(String.valueOf(arez)); + return ares; + } + %> +
+ +<% String sideA = request.getParameter("sideA"); +double a =Double.parseDouble(sideA); +%> +
+

+
给我传递的半径为<%= sideA %>
+
圆的面积为:<%= Arez(a) %>

+ +
\ No newline at end of file diff --git "a/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Ladder.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Ladder.jsp" index 55e20c9..3d4a7d1 100644 --- "a/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Ladder.jsp" +++ "b/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Ladder.jsp" @@ -17,6 +17,31 @@
+<%! + + public String Arez(double a,double b,double c){ + double arez=a+b; + double arec=(arez*c)/2; + String ares = String.format(String.valueOf(arec)); + return ares; + } + +%> + + +<% String sideA = request.getParameter("sideA"); + double a =Double.parseDouble(sideA); + String sideB = request.getParameter("sideB"); + double b =Double.parseDouble(sideA); + String sideC = request.getParameter("sideC"); + double c =Double.parseDouble(sideA); +%> +
+

+
给我传递的半径为<%= sideA %>,<%= sideB %>,<%= sideC %>
+
梯形的面积为:<%= Arez(a,b,c) %> +

+
\ No newline at end of file diff --git "a/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Main.jsp" "b/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Main.jsp" index de9843c..fc33812 100644 --- "a/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Main.jsp" +++ "b/work/com/java/minxi/java_20240605/java_2302_\351\231\210\346\204\210_2344310237/Main.jsp" @@ -4,8 +4,24 @@ +<% float a = 6; %> +

+
加载Circle.JSP并计算圆形面积 + + + +
+

+<% float a1 = 6,b1=7,c1=9; %> +

+
加载Ladder.JSP并计算梯形面积 + + + + + -<%@ include file="Circle.jsp" %> -<%@ include file="Ladder.jsp" %> +
+

\ No newline at end of file diff --git "a/work/com/java/minxi/java_20240606/java_2302_\351\231\210\346\204\210_2344310237/Index.jsp" "b/work/com/java/minxi/java_20240606/java_2302_\351\231\210\346\204\210_2344310237/Index.jsp" new file mode 100644 index 0000000..e69de29 -- Gitee From b916c772e427ba89271296fecc7e81eeb8847113 Mon Sep 17 00:00:00 2001 From: Administrator <2823455505@qq.com> Date: Thu, 6 Jun 2024 20:35:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=E6=8F=90=E4=BA=A4=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Index.jsp" | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git "a/work/com/java/minxi/java_20240606/java_2302_\351\231\210\346\204\210_2344310237/Index.jsp" "b/work/com/java/minxi/java_20240606/java_2302_\351\231\210\346\204\210_2344310237/Index.jsp" index e69de29..6a29727 100644 --- "a/work/com/java/minxi/java_20240606/java_2302_\351\231\210\346\204\210_2344310237/Index.jsp" +++ "b/work/com/java/minxi/java_20240606/java_2302_\351\231\210\346\204\210_2344310237/Index.jsp" @@ -0,0 +1,38 @@ +<%@ page import="java.sql.Connection" %> +<%@ page import="java.sql.DriverManager" %> +<%@ page import="java.sql.Statement" %> +<%@ page import="java.sql.ResultSet" %> +<%@ page import="java.util.List" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + + +<%! public class user { + public static void main(String[] args) throws Exception{ + Class.forName("com.mysql.cj.jdbc.Driver"); + String url= "jdbc:mysql://localhost:3306/base?serverTimezone=Asia/Shanghai"; + String name="root"; + String password="123456"; + + Connection con = DriverManager.getConnection(url,name,password); + String sql="select * from user_info;"; + Statement statement = con.createStatement(); + ResultSet resultSet =statement.executeQuery(sql); + while (resultSet.next()){ + System.out.println(resultSet.getInt("id")+resultSet.getString("user_name")); + + } + resultSet.close(); + statement.close(); + con.close(); + } + } +%> + +<%! public class UserInfo{ +} %> + + + \ No newline at end of file -- Gitee From d3a076f50c1881c6301eda63abbc59dd59130ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AF=8C=E5=BC=BA=E6=B0=91=E4=B8=BB=E6=96=87=E6=98=8E?= =?UTF-8?q?=E5=92=8C=E8=B0=90?= <2823455505@qq.com> Date: Fri, 7 Jun 2024 16:48:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=E6=8F=90=E4=BA=A4=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Index1.jsp" | 78 +++++++++++++++++++ .../Index2.jsp" | 0 2 files changed, 78 insertions(+) create mode 100644 "work/com/java/minxi/java_20240607/java_2302_\351\231\210\346\204\210_2344310237/Index1.jsp" create mode 100644 "work/com/java/minxi/java_20240607/java_2302_\351\231\210\346\204\210_2344310237/Index2.jsp" diff --git "a/work/com/java/minxi/java_20240607/java_2302_\351\231\210\346\204\210_2344310237/Index1.jsp" "b/work/com/java/minxi/java_20240607/java_2302_\351\231\210\346\204\210_2344310237/Index1.jsp" new file mode 100644 index 0000000..ea26a74 --- /dev/null +++ "b/work/com/java/minxi/java_20240607/java_2302_\351\231\210\346\204\210_2344310237/Index1.jsp" @@ -0,0 +1,78 @@ +/* +题目一:创建index1.jsp,index2.jsp页面,在index1.jsp中编写表单信息,通过按钮提交表单信息至index2.jsp中,通过jdbc校验用户名和密码后,实现登录功能,并在登录成功后要跳转至index2.jsp页面。 + +index1.jsp表单中包含:用户名输入框、密码输入框、提交按钮 + +index2.jsp页面上需展示成:xxx,登录成功! + +备注:数据库脚本 + +-- 删除数据库 +drop database if exists student; + +-- 创建公司数据库 +create database if not exists student; + +-- 使用该数据库 +use student; + +drop table if exists user_info; + +-- 创建客户表 +create table if not exists user_info ( +id int(11) primary key auto_increment NOT NULL, +user_name varchar(255) NOT NULL, +user_pwd varchar(255) NOT NULL, +user_age int(2) NOT NULL, +user_sex int(1), +user_phone varchar(11) NOT NULL, +user_address varchar(255) NOT NULL, +user_time datetime(0) NOT NULL, +role_type int(1) +); + +-- 插入员工数据 +insert into user_info(id,user_name,user_pwd,user_age,user_sex,user_phone, +user_address,user_time,role_type) values +(1,'admin','e10adc3949ba59abbe56e057f20f883e',19,1,'15103021550','福建省','2005-01-02',1), +(2,'张三','e10adc3949ba59abbe56e057f20f883e',20,1,'15201321007','广东省','2004-03-20',2), +(3,'王丽','e10adc3949ba59abbe56e057f20f883e',21,2,'18001013568','云南省','2003-06-08',2) +; +*/ + + +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + + + +
+ + + + + + + + + + + + + + + +
姓名 + +
密码: + +
+ +
+
+ + + + diff --git "a/work/com/java/minxi/java_20240607/java_2302_\351\231\210\346\204\210_2344310237/Index2.jsp" "b/work/com/java/minxi/java_20240607/java_2302_\351\231\210\346\204\210_2344310237/Index2.jsp" new file mode 100644 index 0000000..e69de29 -- Gitee