diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/workspace/study5/ssh-student/WebContent/WEB-INF/views/edit.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/workspace/study5/ssh-student/WebContent/WEB-INF/views/edit.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..5275453e54f9e3b7563034dde6f1ed5ee938fe5e
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/workspace/study5/ssh-student/WebContent/WEB-INF/views/edit.jsp"
@@ -0,0 +1,110 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 编辑学生 - SSH整合
+
+
+
+
+
+
+
+
+
+ ✏ 编辑学生
+ ID:
+
+
+
+
+
+
+
+ <%-- 回传 id(隐藏域) --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/workspace/study5/ssh-student/WebContent/WEB-INF/views/list.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/workspace/study5/ssh-student/WebContent/WEB-INF/views/list.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..19e70a5097340434279c83964a5813a6b8a7843f
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/workspace/study5/ssh-student/WebContent/WEB-INF/views/list.jsp"
@@ -0,0 +1,126 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 学生管理 - SSH整合
+
+
+
+
+
+
+
+
+
+ 架构:Struts2 Action → Spring Service (@Transactional)
+ → HibernateDaoSupport → SQL Server
+ | Action 由 Spring IoC 注入 Service(scope="prototype")
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无学生数据,点击右上角"添加学生"按钮添加。
+
+
+
+
+
+ | ID | 姓名 | 性别 | 年龄 | 专业 | 成绩 | 等级 | 操作 |
+
+
+
+
+
+ |
+ |
+
+ 👨👩
+
+ |
+ |
+ |
+ |
+
+ ">
+
+
+ |
+
+
+ "
+ class="btn btn-edit">编辑
+ "
+ class="btn btn-del"
+ onclick="return confirm('确定要删除学生「 」吗?')">删除
+
+ |
+
+
+
+
+
+
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/workspace/study5/ssh-student/WebContent/WEB-INF/web.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/workspace/study5/ssh-student/WebContent/WEB-INF/web.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..6d0a21fa7d7a140eb4b2c512f3d9f6674521da9d
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/workspace/study5/ssh-student/WebContent/WEB-INF/web.xml"
@@ -0,0 +1,55 @@
+
+
+
+ 实验8 - SSH整合学生管理
+
+
+
+
+ org.springframework.web.context.ContextLoaderListener
+
+
+
+ contextConfigLocation
+ classpath:applicationContext.xml
+
+
+
+
+ encodingFilter
+ org.springframework.web.filter.CharacterEncodingFilter
+
+ encoding
+ UTF-8
+
+
+ forceEncoding
+ true
+
+
+
+ encodingFilter
+ /*
+
+
+
+
+ struts2
+
+ org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
+
+
+
+ struts2
+ /*
+
+
+
+ index.jsp
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/README.md" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/README.md"
new file mode 100644
index 0000000000000000000000000000000000000000..80c1974671e8c69e071d9e0bb47f0bf9455aeaeb
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/README.md"
@@ -0,0 +1,60 @@
+# 实验一:开发环境配置及一个简单应用
+
+## 一、实验目的
+1. 掌握 Java EE 开发环境的配置方法
+2. 熟悉 MyEclipse 开发环境的使用
+
+## 二、实验内容
+1. 编写一个简单的 Servlet 应用程序,实现用户登录功能,并在另一页中显示输入的用户名和密码
+2. 编写一个简单的 JSP 应用程序,实现用户登录功能,并在另一页中显示输入的用户名和密码
+3. 编写一个 Struts 2 应用程序,实现简单的用户登录功能,并部署运行
+
+## 三、开发环境
+- JDK 1.6+ (本实验使用 JDK 1.8)
+- Tomcat 6.0+
+- MyEclipse 8.6+ 或 Eclipse + 插件
+
+## 四、项目结构
+```
+study1/
+├── README.md
+├── servlet-login/ # Servlet 登录示例
+│ ├── src/
+│ │ └── com/example/
+│ │ ├── LoginServlet.java
+│ │ └── SuccessServlet.java
+│ └── WebContent/
+│ ├── login.html
+│ └── success.jsp
+├── jsp-login/ # JSP 登录示例
+│ └── WebContent/
+│ ├── login.jsp
+│ └── success.jsp
+└── struts2-login/ # Struts 2 登录示例
+ ├── src/
+ │ └── com/example/
+ │ ├── LoginAction.java
+ │ └── struts.xml
+ └── WebContent/
+ ├── login.jsp
+ └── success.jsp
+```
+
+## 五、环境配置步骤
+
+### 1. 安装 JDK
+- 默认安装路径:`C:\Program Files\Java\jdk1.6.0_27`
+- 当前系统已安装:OpenJDK 1.8.0_302
+
+### 2. 设置环境变量
+- **JAVA_HOME**: `C:\Program Files\Java\jdk1.6.0_27`
+- **Path**: 添加 `;%JAVA_HOME%\bin`
+- **CLASSPATH**: `.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar`
+
+### 3. 配置 Tomcat
+- 安装路径:`C:\Program Files\Apache Software Foundation\Tomcat 6.0`
+- 在 MyEclipse 中配置 Tomcat 服务器
+
+### 4. 配置 MyEclipse
+- Windows → Preferences → Java → Installed JREs → Add JDK
+- Windows → Preferences → MyEclipse → Servers → Tomcat 6.0 → Enable
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/jsp-login/WebContent/login.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/jsp-login/WebContent/login.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..6c9f11b0f04046c033679cfdbf0454f7f3dceda4
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/jsp-login/WebContent/login.jsp"
@@ -0,0 +1,91 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+
+
+
+
+ 用户登录 - JSP 示例
+
+
+
+
+
用户登录 (JSP)
+ <%
+ String error = (String) request.getAttribute("error");
+ if (error != null) {
+ %>
+
<%= error %>
+ <% } %>
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/jsp-login/WebContent/success.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/jsp-login/WebContent/success.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..1991d56b9bf4432f2511493fe04f0fcdc9815ac1
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/jsp-login/WebContent/success.jsp"
@@ -0,0 +1,83 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%
+ // 处理登录逻辑
+ request.setCharacterEncoding("UTF-8");
+ String username = request.getParameter("username");
+ String password = request.getParameter("password");
+
+ // 将数据存入 session
+ session.setAttribute("username", username);
+ session.setAttribute("password", password);
+%>
+
+
+
+
+ 登录成功 - JSP 示例
+
+
+
+
+
✓ 登录成功
+
+
欢迎回来!
+
您输入的用户信息如下:
+
+
用户名: <%= session.getAttribute("username") %>
+
密码: <%= session.getAttribute("password") %>
+
+
+ 这是 JSP 处理登录后的结果展示页面
+
+
返回登录
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/WebContent/WEB-INF/web.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/WebContent/WEB-INF/web.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..f333b626c72ee0a3c1101a32030640c09292f647
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/WebContent/WEB-INF/web.xml"
@@ -0,0 +1,30 @@
+
+
+
+ Servlet Login Example
+
+
+ login.html
+
+
+
+ This is the login servlet
+ LoginServlet
+ LoginServlet
+ com.example.LoginServlet
+
+
+
+ LoginServlet
+ /LoginServlet
+
+
+
+ 30
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/WebContent/login.html" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/WebContent/login.html"
new file mode 100644
index 0000000000000000000000000000000000000000..2a545e3b0721e823d6d7cf5658fa15d48de07fe4
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/WebContent/login.html"
@@ -0,0 +1,84 @@
+
+
+
+
+ 用户登录 - Servlet 示例
+
+
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/WebContent/success.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/WebContent/success.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..e92d8ff3526e8e24bc69727b6cc5786768838c7a
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/WebContent/success.jsp"
@@ -0,0 +1,74 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ page session="true" %>
+
+
+
+
+ 登录成功 - Servlet 示例
+
+
+
+
+
✓ 登录成功
+
+
欢迎回来!
+
您输入的用户信息如下:
+
+
用户名: <%= session.getAttribute("username") %>
+
密码: <%= session.getAttribute("password") %>
+
+
+ 这是 Servlet 处理登录后的结果展示页面
+
+
返回登录
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/src/com/example/LoginServlet.java" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/src/com/example/LoginServlet.java"
new file mode 100644
index 0000000000000000000000000000000000000000..556abe965b8d131979901bf4d5a34ca9426587cb
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/servlet-login/src/com/example/LoginServlet.java"
@@ -0,0 +1,49 @@
+package com.example;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+/**
+ * Servlet 实现用户登录功能
+ */
+public class LoginServlet extends HttpServlet {
+
+ public LoginServlet() {
+ super();
+ }
+
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ // 设置请求编码
+ request.setCharacterEncoding("UTF-8");
+ response.setContentType("text/html;charset=UTF-8");
+
+ // 获取表单参数
+ String username = request.getParameter("username");
+ String password = request.getParameter("password");
+
+ // 简单验证(实际应用中应该查询数据库)
+ if (username != null && password != null && !username.trim().isEmpty()) {
+ // 将用户信息存入 Session
+ HttpSession session = request.getSession();
+ session.setAttribute("username", username);
+ session.setAttribute("password", password);
+
+ // 重定向到成功页面
+ response.sendRedirect("success.jsp");
+ } else {
+ // 验证失败,返回登录页面
+ request.setAttribute("error", "用户名不能为空!");
+ request.getRequestDispatcher("/login.html").forward(request, response);
+ }
+ }
+}
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/WebContent/WEB-INF/web.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/WebContent/WEB-INF/web.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..5df77cf2a50836bfffcb4ed897d33f2490f57d46
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/WebContent/WEB-INF/web.xml"
@@ -0,0 +1,25 @@
+
+
+
+ Struts 2 Login Example
+
+
+ login.jsp
+
+
+
+
+ struts2
+ org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
+
+
+
+ struts2
+ /*
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/WebContent/login.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/WebContent/login.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..8fe59ff926ea811589dfc52ceb3a799e20bb3d3a
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/WebContent/login.jsp"
@@ -0,0 +1,95 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 用户登录 - Struts 2 示例
+
+
+
+
+
用户登录 (Struts 2)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/WebContent/success.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/WebContent/success.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..4899583c3740a04f327899f4f5968ab4c95ca155
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/WebContent/success.jsp"
@@ -0,0 +1,74 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 登录成功 - Struts 2 示例
+
+
+
+
+
✓ 登录成功
+
+
欢迎回来!
+
您输入的用户信息如下:
+
+
用户名:
+
密码:
+
+
+ 这是 Struts 2 处理登录后的结果展示页面
+
+
返回登录
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/src/com/example/LoginAction.java" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/src/com/example/LoginAction.java"
new file mode 100644
index 0000000000000000000000000000000000000000..8ffa4fa02ef521f993008dbd48861a282a25242a
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/src/com/example/LoginAction.java"
@@ -0,0 +1,50 @@
+package com.example;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ * Struts 2 登录 Action
+ */
+public class LoginAction extends ActionSupport {
+
+ private String username;
+ private String password;
+
+ public LoginAction() {
+ super();
+ }
+
+ // 执行登录逻辑
+ public String execute() throws Exception {
+ // 简单验证
+ if (username != null && !username.trim().isEmpty() &&
+ password != null && !password.trim().isEmpty()) {
+ return SUCCESS;
+ } else {
+ if (username == null || username.trim().isEmpty()) {
+ addFieldError("username", "用户名不能为空");
+ }
+ if (password == null || password.trim().isEmpty()) {
+ addFieldError("password", "密码不能为空");
+ }
+ return INPUT;
+ }
+ }
+
+ // Getter 和 Setter
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+}
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/src/struts.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/src/struts.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..00dd34ee9e5beeee7c9e81583239adbe640a4be5
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study1/struts2-login/src/struts.xml"
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ /success.jsp
+ /login.jsp
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/README.md" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/README.md"
new file mode 100644
index 0000000000000000000000000000000000000000..0a7322decc78f2bd0456ead88622df341cf6fe4b
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/README.md"
@@ -0,0 +1,40 @@
+# 实验二:JSP 应用
+
+## 一、实验目的
+1. 熟练掌握 JSP 基本语法及其应用
+2. 掌握常用 JSP 内置对象及其应用
+3. 熟悉 JavaBean 在 JSP 中的使用
+
+## 二、实验内容
+实现一个网上商店 netshop,具有以下功能:
+1. 建立 Web 应用 netshop
+2. 实现用户登录、注册功能
+
+### 页面设计要求:
+1. 完成首页、用户登录、注册功能
+2. 首页实现商品浏览、登录用户计数(采用 application 对象)等功能;包含按钮:登录、注册
+3. 登录页中输入用户名、密码,当密码为空时提示错误
+4. 使用 session 对象保存登录用户信息
+5. 使用 application 对象统计在线用户数
+
+## 三、项目结构
+```
+study2/
+├── README.md
+├── src/
+│ └── com/netshop/
+│ ├── User.java # 用户 JavaBean
+│ └── Product.java # 商品 JavaBean
+└── WebContent/
+ ├── index.jsp # 首页
+ ├── login.jsp # 登录页
+ ├── register.jsp # 注册页
+ ├── success.jsp # 登录成功页
+ └── WEB-INF/
+ └── web.xml
+```
+
+## 四、技术要点
+- **JSP 内置对象**:request, response, session, application, out
+- **JavaBean**:封装用户和商品数据
+- **作用域**:pageScope, requestScope, sessionScope, applicationScope
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/WEB-INF/web.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/WEB-INF/web.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..bce7da3dfab319b65a5d6a442e465e4f329f0a8d
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/WEB-INF/web.xml"
@@ -0,0 +1,14 @@
+
+
+
+ NetShop - JSP Example
+
+
+ index.jsp
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/index.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/index.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..1c3a26ff0b41accf132077e702e58bf80bb567dc
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/index.jsp"
@@ -0,0 +1,169 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ page import="java.util.*, com.netshop.*" %>
+
+
+
+
+ NetShop 网上商店 - 首页
+
+
+
+ <%
+ // 初始化商品列表(首次访问时)
+ List products = (List) application.getAttribute("products");
+ if (products == null) {
+ products = new ArrayList<>();
+ products.add(new Product(1, "iPhone 15", 7999.00));
+ products.add(new Product(2, "MacBook Pro", 14999.00));
+ products.add(new Product(3, "AirPods Pro", 1899.00));
+ products.add(new Product(4, "iPad Air", 4799.00));
+ products.add(new Product(5, "Apple Watch", 3199.00));
+ products.add(new Product(6, "HomePod", 2299.00));
+ application.setAttribute("products", products);
+ }
+
+ // 在线用户计数
+ Integer onlineCount = (Integer) application.getAttribute("onlineCount");
+ if (onlineCount == null) {
+ onlineCount = 0;
+ }
+ onlineCount++;
+ application.setAttribute("onlineCount", onlineCount);
+
+ // 检查用户是否登录
+ User currentUser = (User) session.getAttribute("currentUser");
+ %>
+
+
+
+
+
+
<%= onlineCount %>
+
当前在线用户
+
+
+
<%= products.size() %>
+
商品总数
+
+
+
+ <%= application.getAttribute("visitCount") == null ? 1 : (Integer)application.getAttribute("visitCount") + 1 %>
+
+
总访问量
+
+
+
+ <%
+ // 更新总访问量
+ Integer visitCount = (Integer) application.getAttribute("visitCount");
+ if (visitCount == null) {
+ visitCount = 0;
+ }
+ visitCount++;
+ application.setAttribute("visitCount", visitCount);
+ %>
+
+
+ <% for (Product p : products) { %>
+
+
📦
+
+
<%= p.getName() %>
+
高品质数码产品
+
¥<%= String.format("%.2f", p.getPrice()) %>
+
+
+ <% } %>
+
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/login.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/login.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..cc783a129a4ddd43c62284c4d3a106b7b1f08760
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/login.jsp"
@@ -0,0 +1,142 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ page import="com.netshop.User" %>
+
+
+
+
+ 用户登录 - NetShop
+
+
+
+
+
🔐 用户登录
+
+ <%
+ String error = (String) request.getAttribute("error");
+ if (error != null) {
+ %>
+
<%= error %>
+ <% } %>
+
+
+
+
+
+
+ <%
+ // 处理登录请求
+ if ("POST".equalsIgnoreCase(request.getMethod())) {
+ String username = request.getParameter("username");
+ String password = request.getParameter("password");
+
+ // 验证
+ if (username == null || username.trim().isEmpty()) {
+ request.setAttribute("error", "用户名不能为空!");
+ } else if (password == null || password.trim().isEmpty()) {
+ request.setAttribute("error", "密码不能为空!");
+ } else {
+ // 简单验证(实际应该查询数据库)
+ // 这里模拟登录成功
+ User user = new User(username, password);
+ session.setAttribute("currentUser", user);
+
+ // 重定向到首页
+ response.sendRedirect("index.jsp");
+ return;
+ }
+ }
+ %>
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/logout.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/logout.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..940d390d017f46031a2c1b5a3fdbc7b6e6f1ba2a
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/logout.jsp"
@@ -0,0 +1,47 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+
+
+
+
+ 退出登录 - NetShop
+
+
+
+
+ <%
+ // 清除 session
+ session.invalidate();
+
+ // 减少在线计数
+ Integer onlineCount = (Integer) application.getAttribute("onlineCount");
+ if (onlineCount != null && onlineCount > 0) {
+ onlineCount--;
+ application.setAttribute("onlineCount", onlineCount);
+ }
+ %>
+
+
✓ 已成功退出登录
+
2 秒后跳转到首页...
+
立即跳转
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/register.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/register.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..54da95b4e384374f03a65a3b01ea71d832f7a83d
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/WebContent/register.jsp"
@@ -0,0 +1,150 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ page import="com.netshop.User" %>
+
+
+
+
+ 用户注册 - NetShop
+
+
+
+
+
📝 用户注册
+
+ <%
+ String error = (String) request.getAttribute("error");
+ String success = (String) request.getAttribute("success");
+
+ if (error != null) {
+ %>
+
<%= error %>
+ <% } else if (success != null) { %>
+
<%= success %>
+ <% } %>
+
+
+
+
+
+
+ <%
+ if ("POST".equalsIgnoreCase(request.getMethod())) {
+ String username = request.getParameter("username");
+ String password = request.getParameter("password");
+ String email = request.getParameter("email");
+
+ // 验证
+ if (username == null || username.length() < 3) {
+ request.setAttribute("error", "用户名至少 3 个字符!");
+ } else if (password == null || password.length() < 6) {
+ request.setAttribute("error", "密码至少 6 个字符!");
+ } else if (email == null || !email.contains("@")) {
+ request.setAttribute("error", "请输入有效的邮箱地址!");
+ } else {
+ // 注册成功
+ User user = new User(username, password);
+ user.setEmail(email);
+ session.setAttribute("currentUser", user);
+ request.setAttribute("success", "注册成功!欢迎加入 NetShop!");
+ }
+ }
+ %>
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/src/com/netshop/Product.java" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/src/com/netshop/Product.java"
new file mode 100644
index 0000000000000000000000000000000000000000..6b4e9abcdc1243570809337fe553964c620cc2bd
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/src/com/netshop/Product.java"
@@ -0,0 +1,76 @@
+package com.netshop;
+
+import java.io.Serializable;
+
+/**
+ * 商品 JavaBean
+ */
+public class Product implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private int id;
+ private String name;
+ private String description;
+ private double price;
+ private String category;
+ private int stock;
+
+ public Product() {
+ super();
+ }
+
+ public Product(int id, String name, double price) {
+ this.id = id;
+ this.name = name;
+ this.price = price;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public double getPrice() {
+ return price;
+ }
+
+ public void setPrice(double price) {
+ this.price = price;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public int getStock() {
+ return stock;
+ }
+
+ public void setStock(int stock) {
+ this.stock = stock;
+ }
+}
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/src/com/netshop/User.java" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/src/com/netshop/User.java"
new file mode 100644
index 0000000000000000000000000000000000000000..8b2636218475101ac27ecbf3d433b6a8d7389f38
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study2/src/com/netshop/User.java"
@@ -0,0 +1,57 @@
+package com.netshop;
+
+import java.io.Serializable;
+
+/**
+ * 用户 JavaBean
+ */
+public class User implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String username;
+ private String password;
+ private String email;
+ private String phone;
+
+ public User() {
+ super();
+ }
+
+ public User(String username, String password) {
+ this.username = username;
+ this.password = password;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+}
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/README.md" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/README.md"
new file mode 100644
index 0000000000000000000000000000000000000000..32825da87fbdba5e057c4826d70a34b0cc13501a
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/README.md"
@@ -0,0 +1,27 @@
+# 实验三:Struts 2 框架应用
+
+## 一、实验目的
+1. 熟练掌握 Struts 2 框架的应用开发过程
+2. 熟练掌握 Struts 2 框架的处理流程
+3. 熟练掌握 Struts 2 配置文件的应用
+
+## 二、实验内容
+应用 Struts 2 框架,实现一个简单的学生信息录入功能:
+1. 建立基于 Struts 2 的 Web 应用 studentStruts2
+2. 完成用户登录和学生信息录入功能(页面分别为 login.jsp 和 input.jsp)
+3. login.jsp 页面实现用户登录,验证通过后进入信息录入页面
+
+## 三、项目结构
+```
+study3/
+├── README.md
+├── src/
+│ ├── com/example/
+│ │ ├── LoginAction.java
+│ │ └── StudentAction.java
+│ └── struts.xml
+└── WebContent/
+ ├── login.jsp
+ ├── input.jsp
+ └── WEB-INF/web.xml
+```
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/WEB-INF/web.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/WEB-INF/web.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..f02129d7a281cb1fdd47702e5b667d224be84955
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/WEB-INF/web.xml"
@@ -0,0 +1,10 @@
+
+
+ Struts 2 Student Example
+ login.jsp
+
+ struts2
+ org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
+
+ struts2/*
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/input.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/input.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..1cb204750ca7ed39fde7ea04ef39f3d329ae8449
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/input.jsp"
@@ -0,0 +1,48 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 学生信息录入
+
+
+
+
+
📝 学生信息录入
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/login.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/login.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..0869c43784780559e4e0b1a47eb19ed07d562509
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/login.jsp"
@@ -0,0 +1,40 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 学生登录 - Struts 2
+
+
+
+
+
🎓 学生系统登录
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
测试账号:admin / 123456
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/success.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/success.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..52059ebfb1e2556d1c9bc924c5ab35afa843ae1c
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/WebContent/success.jsp"
@@ -0,0 +1,29 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 提交成功
+
+
+
+
+
✓ 提交成功
+
+
学号:
+
姓名:
+
性别:
+
年龄:
+
专业:
+
+
返回登录
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/src/com/example/LoginAction.java" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/src/com/example/LoginAction.java"
new file mode 100644
index 0000000000000000000000000000000000000000..28d5bcf7d700be82fa0ecaf08b0da138517b7264
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/src/com/example/LoginAction.java"
@@ -0,0 +1,26 @@
+package com.example;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ * Struts 2 登录 Action
+ */
+public class LoginAction extends ActionSupport {
+
+ private String username;
+ private String password;
+
+ public String execute() throws Exception {
+ if ("admin".equals(username) && "123456".equals(password)) {
+ return SUCCESS;
+ } else {
+ addFieldError("username", "用户名或密码错误");
+ return INPUT;
+ }
+ }
+
+ public String getUsername() { return username; }
+ public void setUsername(String username) { this.username = username; }
+ public String getPassword() { return password; }
+ public void setPassword(String password) { this.password = password; }
+}
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/src/com/example/StudentAction.java" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/src/com/example/StudentAction.java"
new file mode 100644
index 0000000000000000000000000000000000000000..486890b6d32cfdbf50992d4496cabe5c04923e92
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/src/com/example/StudentAction.java"
@@ -0,0 +1,35 @@
+package com.example;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ * 学生信息 Action
+ */
+public class StudentAction extends ActionSupport {
+
+ private String studentId;
+ private String studentName;
+ private String gender;
+ private String age;
+ private String major;
+
+ public String execute() throws Exception {
+ return SUCCESS;
+ }
+
+ public String input() throws Exception {
+ return INPUT;
+ }
+
+ // Getters and Setters
+ public String getStudentId() { return studentId; }
+ public void setStudentId(String studentId) { this.studentId = studentId; }
+ public String getStudentName() { return studentName; }
+ public void setStudentName(String studentName) { this.studentName = studentName; }
+ public String getGender() { return gender; }
+ public void setGender(String gender) { this.gender = gender; }
+ public String getAge() { return age; }
+ public void setAge(String age) { this.age = age; }
+ public String getMajor() { return major; }
+ public void setMajor(String major) { this.major = major; }
+}
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/src/struts.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/src/struts.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..4188b19d250f577f66ae7062817dbaa463c678db
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study3/src/struts.xml"
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+ /input.jsp
+ /login.jsp
+
+
+
+ /success.jsp
+ /input.jsp
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/README.md" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/README.md"
new file mode 100644
index 0000000000000000000000000000000000000000..e2def2608dde0cd55315b09d0d1b0e3414195189
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/README.md"
@@ -0,0 +1,31 @@
+# 实验四:Struts 2 输入校验
+
+## 一、实验目的
+1. 理解 Struts 2 的输入校验机制
+2. 熟练掌握 Struts 2 校验框架的使用
+
+## 二、实验内容
+完成一个用户注册程序,用户信息包括用户名、密码、再次输入密码、出生日期、身高、电话、电子邮箱、博客、地址等。
+
+### 校验规则:
+1. 用户名不能为空
+2. 用户名长度必须在 4~20 位之间且由字母、数字和下划线组成
+3. 密码不能为空,长度至少 6 位
+4. 两次密码输入必须一致
+5. 出生日期必须在 1900-01-01 到 2013-12-31 之间
+6. 身高必须在 1.0 到 2.5 米之间
+7. 电话格式验证
+
+## 三、项目结构
+```
+study4/
+├── README.md
+├── src/
+│ ├── com/example/
+│ │ ├── RegisterAction.java
+│ │ └── RegisterAction-validation.xml
+│ └── struts.xml
+└── WebContent/
+ ├── register.jsp
+ └── WEB-INF/web.xml
+```
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/WebContent/WEB-INF/web.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/WebContent/WEB-INF/web.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..5d12fe7abe4d8e87b8ecc988b248b7e39826db09
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/WebContent/WEB-INF/web.xml"
@@ -0,0 +1,10 @@
+
+
+ Struts 2 Register Example
+ register.jsp
+
+ struts2
+ org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
+
+ struts2/*
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/WebContent/register.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/WebContent/register.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..3c86d4acd17818b5a2d6b4182c2d55085216cc07
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/WebContent/register.jsp"
@@ -0,0 +1,75 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 用户注册 - Struts 2 校验
+
+
+
+
+
📝 用户注册
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/WebContent/success.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/WebContent/success.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..23050030532d673d034c443e228f8838d522098c
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/WebContent/success.jsp"
@@ -0,0 +1,28 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 注册成功
+
+
+
+
+
✓ 注册成功
+
+
用户名:
+
邮箱:
+
电话:
+
身高: 米
+
+
返回注册
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/src/com/example/RegisterAction.java" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/src/com/example/RegisterAction.java"
new file mode 100644
index 0000000000000000000000000000000000000000..f7b800bd4ecc893cfea8e515ebe5e3d4768763fa
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/src/com/example/RegisterAction.java"
@@ -0,0 +1,108 @@
+package com.example;
+
+import com.opensymphony.xwork2.ActionSupport;
+import java.text.*;
+import java.util.regex.*;
+
+/**
+ * 用户注册 Action - 包含输入校验
+ */
+public class RegisterAction extends ActionSupport {
+
+ private String username;
+ private String password;
+ private String confirmPassword;
+ private String birthDate;
+ private String height;
+ private String phone;
+ private String email;
+ private String blog;
+ private String address;
+
+ // 自定义校验方法
+ public void validate() {
+ // 用户名校验:4-20 位,字母数字下划线
+ if (username == null || username.trim().isEmpty()) {
+ addFieldError("username", "用户名不能为空");
+ } else if (!username.matches("^[a-zA-Z0-9_]{4,20}$")) {
+ addFieldError("username", "用户名必须是 4-20 位的字母、数字或下划线");
+ }
+
+ // 密码校验
+ if (password == null || password.length() < 6) {
+ addFieldError("password", "密码长度至少 6 位");
+ }
+
+ // 确认密码校验
+ if (!password.equals(confirmPassword)) {
+ addFieldError("confirmPassword", "两次密码输入不一致");
+ }
+
+ // 出生日期校验:必须在 1900-01-01 到 2013-12-31 之间
+ if (birthDate != null && !birthDate.trim().isEmpty()) {
+ try {
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ sdf.setLenient(false);
+ java.util.Date date = sdf.parse(birthDate);
+ java.util.Date minDate = sdf.parse("1900-01-01");
+ java.util.Date maxDate = sdf.parse("2013-12-31");
+ if (date.before(minDate) || date.after(maxDate)) {
+ addFieldError("birthDate", "出生日期必须在 1900-01-01 到 2013-12-31 之间");
+ }
+ } catch (ParseException e) {
+ addFieldError("birthDate", "请输入有效的日期格式(yyyy-MM-dd)");
+ }
+ }
+
+ // 身高校验:必须在 1.0 到 2.0 米之间
+ if (height != null && !height.trim().isEmpty()) {
+ try {
+ double h = Double.parseDouble(height);
+ if (h < 1.0 || h > 2.0) {
+ addFieldError("height", "身高必须在 1.0 到 2.0 米之间");
+ }
+ } catch (NumberFormatException e) {
+ addFieldError("height", "请输入有效的身高数值");
+ }
+ }
+
+ // 博客地址校验
+ if (blog != null && !blog.trim().isEmpty() && !blog.matches("^(https?://).+$")) {
+ addFieldError("blog", "请输入有效的博客地址(以 http:// 或 https:// 开头)");
+ }
+
+ // 电话校验
+ if (phone != null && !phone.matches("^1[3-9]\\d{9}$") && !phone.matches("^0\\d{2,3}-\\d{7,8}$")) {
+ addFieldError("phone", "请输入有效的电话号码");
+ }
+
+ // 邮箱校验
+ if (email != null && !email.matches("^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+$")) {
+ addFieldError("email", "请输入有效的邮箱地址");
+ }
+ }
+
+ public String execute() throws Exception {
+ return SUCCESS;
+ }
+
+ // Getters and Setters
+ public String getUsername() { return username; }
+ public void setUsername(String username) { this.username = username; }
+ public String getPassword() { return password; }
+ public void setPassword(String password) { this.password = password; }
+ public String getConfirmPassword() { return confirmPassword; }
+ public void setConfirmPassword(String confirmPassword) { this.confirmPassword = confirmPassword; }
+ public String getBirthDate() { return birthDate; }
+ public void setBirthDate(String birthDate) { this.birthDate = birthDate; }
+ public String getHeight() { return height; }
+ public void setHeight(String height) { this.height = height; }
+ public String getPhone() { return phone; }
+ public void setPhone(String phone) { this.phone = phone; }
+ public String getEmail() { return email; }
+ public void setEmail(String email) { this.email = email; }
+ public String getBlog() { return blog; }
+ public void setBlog(String blog) { this.blog = blog; }
+ public String getAddress() { return address; }
+ public void setAddress(String address) { this.address = address; }
+}
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/src/struts.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/src/struts.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..21b5495084adfc214ec8cd29be960da8ca12cde9
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study4/src/struts.xml"
@@ -0,0 +1,10 @@
+
+
+
+
+
+ /success.jsp
+ /register.jsp
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/README.md" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/README.md"
new file mode 100644
index 0000000000000000000000000000000000000000..a3c3a537380295928a8c0eb594c97b6c41247d26
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/README.md"
@@ -0,0 +1,24 @@
+# 实验五:Struts 2 标签库应用
+
+## 一、实验目的
+熟练掌握 Struts 2 标签库的使用
+
+## 二、实验内容
+应用 Struts 2 框架,实现一个简单的商品分类搜索功能:
+1. 建立基于 Struts 2 的 Web 应用 struts2shop
+2. 完成商品的分类搜索和商品信息显示功能(search.jsp 和 display.jsp)
+3. 使用表单标签、控制标签等实现
+
+## 三、项目结构
+```
+study5/
+├── README.md
+├── src/
+│ ├── com/example/
+│ │ └── SearchAction.java
+│ └── struts.xml
+└── WebContent/
+ ├── search.jsp
+ ├── display.jsp
+ └── WEB-INF/web.xml
+```
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/WebContent/WEB-INF/web.xml" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/WebContent/WEB-INF/web.xml"
new file mode 100644
index 0000000000000000000000000000000000000000..d377f7f12219396f8ad155528907042a79d42bd0
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/WebContent/WEB-INF/web.xml"
@@ -0,0 +1,10 @@
+
+
+ Struts 2 Shop Example
+ search.jsp
+
+ struts2
+ org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
+
+ struts2/*
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/WebContent/display.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/WebContent/display.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..cfb6ccf61fcb6a65292049990cc2178625d063f4
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/WebContent/display.jsp"
@@ -0,0 +1,46 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 搜索结果
+
+
+
+
+
📦 搜索结果
+
+
+
+
+ 暂无商品
+
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/WebContent/search.jsp" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/WebContent/search.jsp"
new file mode 100644
index 0000000000000000000000000000000000000000..80672b4d2b577ea40705f75aac97ea1490a5de83
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/WebContent/search.jsp"
@@ -0,0 +1,33 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+
+
+
+ 商品搜索 - Struts 2 标签库
+
+
+
+
+
🔍 商品搜索
+
+
+
+
+
+
+
+
+
+
+
+
diff --git "a/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/src/com/example/SearchAction.java" "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/src/com/example/SearchAction.java"
new file mode 100644
index 0000000000000000000000000000000000000000..e584c967ade5a44cb26e130017ca0b7496bd5fdb
--- /dev/null
+++ "b/JavaEEweb\347\250\213\345\272\217\350\256\276\350\256\241\345\256\236\351\252\2142026-\347\216\213\351\235\236\350\200\201\345\270\210-\350\214\203\347\272\257\346\257\223/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/\343\200\220\344\272\244\344\273\230\346\261\207\346\200\273\343\200\221/1.\345\205\250\351\203\250\345\256\236\351\252\214\344\273\243\347\240\201/study5/src/com/example/SearchAction.java"
@@ -0,0 +1,58 @@
+package com.example;
+
+import com.opensymphony.xwork2.ActionSupport;
+import java.util.*;
+
+/**
+ * 商品搜索 Action
+ */
+public class SearchAction extends ActionSupport {
+
+ private String category;
+ private List