commit db8393b0f718cbcb72739350bddde65dc708a414
Author: wangheng <2896983134@qq.com>
Date: Sun Dec 15 10:18:32 2024 +0800
test
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/.idea/artifacts/MyServlet2_war_exploded.xml b/.idea/artifacts/MyServlet2_war_exploded.xml
new file mode 100644
index 0000000..4371685
--- /dev/null
+++ b/.idea/artifacts/MyServlet2_war_exploded.xml
@@ -0,0 +1,13 @@
+
+
+ $PROJECT_DIR$/out/artifacts/MyServlet2_war_exploded
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..1983e47
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..5a2f139
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_4.xml b/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_4.xml
new file mode 100644
index 0000000..756c871
--- /dev/null
+++ b/.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_4.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml b/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml
new file mode 100644
index 0000000..668da3a
--- /dev/null
+++ b/.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml b/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml
new file mode 100644
index 0000000..c6c5e44
--- /dev/null
+++ b/.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__javax_servlet_javax_servlet_api_4_0_1.xml b/.idea/libraries/Maven__javax_servlet_javax_servlet_api_4_0_1.xml
new file mode 100644
index 0000000..958c654
--- /dev/null
+++ b/.idea/libraries/Maven__javax_servlet_javax_servlet_api_4_0_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__javax_servlet_jsp_javax_servlet_jsp_api_2_3_3.xml b/.idea/libraries/Maven__javax_servlet_jsp_javax_servlet_jsp_api_2_3_3.xml
new file mode 100644
index 0000000..9c16743
--- /dev/null
+++ b/.idea/libraries/Maven__javax_servlet_jsp_javax_servlet_jsp_api_2_3_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__javax_servlet_jsp_jstl_jstl_1_2.xml b/.idea/libraries/Maven__javax_servlet_jsp_jstl_jstl_1_2.xml
new file mode 100644
index 0000000..93b87a1
--- /dev/null
+++ b/.idea/libraries/Maven__javax_servlet_jsp_jstl_jstl_1_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_taglibs_taglibs_standard_impl_1_2_5.xml b/.idea/libraries/Maven__org_apache_taglibs_taglibs_standard_impl_1_2_5.xml
new file mode 100644
index 0000000..97db272
--- /dev/null
+++ b/.idea/libraries/Maven__org_apache_taglibs_taglibs_standard_impl_1_2_5.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..979c1e9
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..6313f45
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MyServlet2.iml b/MyServlet2.iml
new file mode 100644
index 0000000..4d894dc
--- /dev/null
+++ b/MyServlet2.iml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/artifacts/MyServlet2_war_exploded/META-INF/MANIFEST.MF b/out/artifacts/MyServlet2_war_exploded/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..72bad49
--- /dev/null
+++ b/out/artifacts/MyServlet2_war_exploded/META-INF/MANIFEST.MF
@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Created-By: IntelliJ IDEA
+Built-By: 86159
+Build-Jdk: Amazon Corretto version 17.0.12
+
diff --git a/out/artifacts/MyServlet2_war_exploded/WEB-INF/classes/Person.class b/out/artifacts/MyServlet2_war_exploded/WEB-INF/classes/Person.class
new file mode 100644
index 0000000..04d6af1
Binary files /dev/null and b/out/artifacts/MyServlet2_war_exploded/WEB-INF/classes/Person.class differ
diff --git a/out/artifacts/MyServlet2_war_exploded/WEB-INF/classes/PersonServlet.class b/out/artifacts/MyServlet2_war_exploded/WEB-INF/classes/PersonServlet.class
new file mode 100644
index 0000000..d980822
Binary files /dev/null and b/out/artifacts/MyServlet2_war_exploded/WEB-INF/classes/PersonServlet.class differ
diff --git a/out/artifacts/MyServlet2_war_exploded/WEB-INF/web.xml b/out/artifacts/MyServlet2_war_exploded/WEB-INF/web.xml
new file mode 100644
index 0000000..2496706
--- /dev/null
+++ b/out/artifacts/MyServlet2_war_exploded/WEB-INF/web.xml
@@ -0,0 +1,15 @@
+
+
+
+ PersonServlet
+ PersonServlet
+
+
+ PersonServlet
+ /personServlet
+
+
+
\ No newline at end of file
diff --git a/out/artifacts/MyServlet2_war_exploded/greeting.jsp b/out/artifacts/MyServlet2_war_exploded/greeting.jsp
new file mode 100644
index 0000000..2e7c9e6
--- /dev/null
+++ b/out/artifacts/MyServlet2_war_exploded/greeting.jsp
@@ -0,0 +1,21 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+
+
+ 时间问候
+
+
+
+
+
+ 上午好!
+
+
+ 下午好!
+
+
+ 晚上好!
+
+
+
+
diff --git a/out/artifacts/MyServlet2_war_exploded/index.jsp b/out/artifacts/MyServlet2_war_exploded/index.jsp
new file mode 100644
index 0000000..cf43da6
--- /dev/null
+++ b/out/artifacts/MyServlet2_war_exploded/index.jsp
@@ -0,0 +1,16 @@
+<%--
+ Created by IntelliJ IDEA.
+ User: 86159
+ Date: 2024/12/12
+ Time: 10:28
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+ $Title$
+
+
+ $END$
+
+
diff --git a/out/artifacts/MyServlet2_war_exploded/inputOutput.jsp b/out/artifacts/MyServlet2_war_exploded/inputOutput.jsp
new file mode 100644
index 0000000..eab9ef7
--- /dev/null
+++ b/out/artifacts/MyServlet2_war_exploded/inputOutput.jsp
@@ -0,0 +1,20 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+
+
+ 文本框输入显示
+
+
+
+
+ 输入的内容是:${param.inputText}
+
+
+
+
+
+
+
diff --git a/out/artifacts/MyServlet2_war_exploded/person.jsp b/out/artifacts/MyServlet2_war_exploded/person.jsp
new file mode 100644
index 0000000..a6c713c
--- /dev/null
+++ b/out/artifacts/MyServlet2_war_exploded/person.jsp
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+
+
+ Person 信息
+
+
+Person 信息
+姓名:${person.name}
+年龄:${person.age}
+
+
diff --git a/out/artifacts/MyServlet2_war_exploded/personForm.jsp b/out/artifacts/MyServlet2_war_exploded/personForm.jsp
new file mode 100644
index 0000000..d04204a
--- /dev/null
+++ b/out/artifacts/MyServlet2_war_exploded/personForm.jsp
@@ -0,0 +1,5 @@
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..832a91b
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,47 @@
+
+
+ 4.0.0
+
+ com.spring
+ MyServlet2
+ 1.0-SNAPSHOT
+
+
+
+ javax.servlet
+ javax.servlet-api
+ 4.0.1
+ provided
+
+
+ javax.servlet.jsp
+ javax.servlet.jsp-api
+ 2.3.3
+ provided
+
+
+ javax.servlet.jsp.jstl
+ jstl
+ 1.2
+
+
+ org.apache.taglibs
+ taglibs-standard-impl
+ 1.2.5
+
+
+ commons-beanutils
+ commons-beanutils
+ 1.9.4
+ compile
+
+
+
+
+ 17
+ 17
+
+
+
\ No newline at end of file
diff --git a/src/main/java/Person.java b/src/main/java/Person.java
new file mode 100644
index 0000000..c7696d5
--- /dev/null
+++ b/src/main/java/Person.java
@@ -0,0 +1,22 @@
+public class Person {
+ private String name;
+ private int age;
+
+ public Person() {} // 必须有无参构造
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+}
diff --git a/src/main/java/PersonServlet.java b/src/main/java/PersonServlet.java
new file mode 100644
index 0000000..47f2b05
--- /dev/null
+++ b/src/main/java/PersonServlet.java
@@ -0,0 +1,31 @@
+import org.apache.commons.beanutils.BeanUtils;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebServlet("/personServlet")
+public class PersonServlet extends HttpServlet {
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ Person person = new Person();
+ try {
+ BeanUtils.populate(person, request.getParameterMap());
+ request.setAttribute("person", person);
+ // 转发到 person.jsp 页面
+ RequestDispatcher dispatcher = request.getRequestDispatcher("/person.jsp");
+ dispatcher.forward(request, response);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/target/classes/Person.class b/target/classes/Person.class
new file mode 100644
index 0000000..04d6af1
Binary files /dev/null and b/target/classes/Person.class differ
diff --git a/target/classes/PersonServlet.class b/target/classes/PersonServlet.class
new file mode 100644
index 0000000..d980822
Binary files /dev/null and b/target/classes/PersonServlet.class differ
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
new file mode 100644
index 0000000..73bc127
--- /dev/null
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -0,0 +1,2 @@
+D:\java代码\MyServlet2\src\main\java\Person.java
+D:\java代码\MyServlet2\src\main\java\PersonServlet.java
diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml
new file mode 100644
index 0000000..2496706
--- /dev/null
+++ b/web/WEB-INF/web.xml
@@ -0,0 +1,15 @@
+
+
+
+ PersonServlet
+ PersonServlet
+
+
+ PersonServlet
+ /personServlet
+
+
+
\ No newline at end of file
diff --git a/web/greeting.jsp b/web/greeting.jsp
new file mode 100644
index 0000000..2e7c9e6
--- /dev/null
+++ b/web/greeting.jsp
@@ -0,0 +1,21 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+
+
+ 时间问候
+
+
+
+
+
+ 上午好!
+
+
+ 下午好!
+
+
+ 晚上好!
+
+
+
+
diff --git a/web/index.jsp b/web/index.jsp
new file mode 100644
index 0000000..cf43da6
--- /dev/null
+++ b/web/index.jsp
@@ -0,0 +1,16 @@
+<%--
+ Created by IntelliJ IDEA.
+ User: 86159
+ Date: 2024/12/12
+ Time: 10:28
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+ $Title$
+
+
+ $END$
+
+
diff --git a/web/inputOutput.jsp b/web/inputOutput.jsp
new file mode 100644
index 0000000..eab9ef7
--- /dev/null
+++ b/web/inputOutput.jsp
@@ -0,0 +1,20 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+
+
+ 文本框输入显示
+
+
+
+
+ 输入的内容是:${param.inputText}
+
+
+
+
+
+
+
diff --git a/web/person.jsp b/web/person.jsp
new file mode 100644
index 0000000..a6c713c
--- /dev/null
+++ b/web/person.jsp
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+
+
+ Person 信息
+
+
+Person 信息
+姓名:${person.name}
+年龄:${person.age}
+
+
diff --git a/web/personForm.jsp b/web/personForm.jsp
new file mode 100644
index 0000000..d04204a
--- /dev/null
+++ b/web/personForm.jsp
@@ -0,0 +1,5 @@
+