From 4edb5b806cb3d1e296206ca444df785081898cb6 Mon Sep 17 00:00:00 2001 From: Gtq <2149154091@qq.com> Date: Tue, 17 Dec 2024 17:20:10 +0800 Subject: [PATCH 01/12] test --- wechat-master/web/index.jsp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/wechat-master/web/index.jsp b/wechat-master/web/index.jsp index 2ea9e27..3daf969 100644 --- a/wechat-master/web/index.jsp +++ b/wechat-master/web/index.jsp @@ -481,19 +481,38 @@ - + + +//关闭WebSocket连接 +function closeWebSocket() { +websocket.close(); - //关闭WebSocket连接 - function closeWebSocket() { - websocket.close(); - - } +} -- 2.34.1 From a48b8934c4067611668f27ff5e8af57e882121ed Mon Sep 17 00:00:00 2001 From: gtq <2149154091@qq.com> Date: Tue, 17 Dec 2024 22:58:04 +0800 Subject: [PATCH 10/12] test --- wechat-master/web/error.jsp | 44 ++++++- wechat-master/web/login.jsp | 222 +++++++++++++++++++++++---------- wechat-master/web/register.jsp | 170 +++++++++++++++---------- 3 files changed, 297 insertions(+), 139 deletions(-) diff --git a/wechat-master/web/error.jsp b/wechat-master/web/error.jsp index 21d87e8..d910bf5 100644 --- a/wechat-master/web/error.jsp +++ b/wechat-master/web/error.jsp @@ -21,21 +21,59 @@ Time: 17:59 To change this template use File | Settings | File Templates. --%> +<%-- + 这是一个JSP页面指令,用于设置页面的内容类型、字符集和脚本语言。 + contentType="text/html;charset=UTF-8" 指定了页面返回给客户端的内容类型为HTML,并且使用UTF-8字符集进行编码。 + language="java" 指定了页面中使用的脚本语言为Java。 +--%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> + + 错误信息 + <%-- + 页面的标题设置为“错误信息”,这个标题会显示在浏览器的标签页上。 + --%> +<%-- + 页面的主体部分开始。 +--%>
+ <%-- + 使用了一个类名为“container”的div元素,通常用于布局和样式化页面内容。 + --%>
+ <%-- + “jumbotron”是一个Bootstrap框架中的类,用于创建一个大的、醒目的容器,通常用于展示重要的信息或标题。 + --%>

系统提示

+ <%-- + 居中对齐的标题,显示“系统提示”。 + --%>
-
+ <%-- + 水平线,用于分隔内容。 + --%> +
+ <%-- + 换行标签,用于在元素之间添加垂直间距。 + --%>

${message}

-
+ <%-- + 居中对齐的段落,使用标签使文本加粗。 + ${message} 是一个EL(Expression Language)表达式,用于从请求、会话或应用程序作用域中获取名为“message”的属性值,并将其显示在页面上。 + --%> +
+ <%-- + 再次添加换行间距。 + --%>

+<%-- + 页面底部的水平线,用于分隔内容或作为页面的结束标记。 +--%> - + \ No newline at end of file diff --git a/wechat-master/web/login.jsp b/wechat-master/web/login.jsp index 21a6384..9d6e971 100644 --- a/wechat-master/web/login.jsp +++ b/wechat-master/web/login.jsp @@ -21,132 +21,220 @@ Time: 3:51 To change this template use File | Settings | File Templates. --%> +<%-- + 页面指令,设置页面的内容类型、字符集、脚本语言和页面编码。 + contentType 指定了返回给客户端的内容类型为 HTML,并使用 UTF-8 编码。 + language 指定了页面中使用的脚本语言为 Java。 + pageEncoding 明确指定了页面本身的编码为 UTF-8,虽然通常与 contentType 中的 charset 相同,但在这里为了清晰起见还是单独设置了。 +--%> <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %> + +<%-- + 引入 JSTL 核心标签库,前缀为 c。 + 这允许我们在 JSP 页面中使用 JSTL 标签,如 等。 +--%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + +<%-- + 使用 标签设置一个名为 host 的变量,其值为 "localhost:8080/wechat"。 + 这个变量稍后在页面中用于构建 URL。 +--%> <%--设置主机名--%> + + - - wechat - + <%-- 设置页面的字符集为 UTF-8 --%> + wechat <%-- 页面标题 --%> + + <%-- 引入微信图标 --%> + + + <%-- 引入 Bootstrap CSS 框架 --%> + + <%-- 引入 jQuery 库 --%> + + <%-- + 发送请求脚本的占位符,目前为空。 + 可以在这里添加 JavaScript 代码来处理发送请求的逻辑。 + --%> + +<%-- 页面背景容器 --%>
- <%-- 页面头部--%> + + <%-- 页面头部 --%> + + <%-- + 使用 标签检查 message 变量是否不为 null。 + 如果不为 null,则使用 JavaScript 显示一个警告框。 + --%> + + <%-- 输入框容器 --%>
+ + <%-- 输入字段的容器,带有自定义样式 --%>
-
+ + <%-- + 表单,提交到 http://${host}/wechat/user?method=login.do。 + 使用 POST 方法提交。 + --%> + + + <%-- + 一个隐藏的提交按钮,可能用于触发某些 JavaScript 事件,但在这里被设置为不显示。 + --%> -

邮箱登陆

- -
- -
- 记住登陆 -
- -
- + + <%-- 输入框标题 --%> +

邮箱登陆

+ + <%-- 邮箱输入框,带有占位符和必填验证 --%> + +
+ + <%-- 密码输入框,带有占位符和必填验证 --%> + + + <%-- 记住登陆选项 --%> +
+ 记住登陆 +
+ + <%-- 提交按钮 --%> + +
+ + <%-- 切换按钮,包含注册链接和游客模式链接 --%> +
+ 立即注册 + <%-- + 游客模式链接,带有 onclick 事件处理器(尽管这里没有定义 visitor() 函数,可能需要在 JavaScript 中定义)。 + 注意:这里的 URL 拼接方式可能会导致安全问题,建议使用更安全的参数传递方式。 + --%> + | 游客模式 +
+
+ + + + + - + + + \ No newline at end of file diff --git a/wechat-master/web/register.jsp b/wechat-master/web/register.jsp index 5dde950..17823b2 100644 --- a/wechat-master/web/register.jsp +++ b/wechat-master/web/register.jsp @@ -21,55 +21,69 @@ Time: 21:23 To change this template use File | Settings | File Templates. --%> +<%-- 设置页面的内容类型为HTML,并指定字符集和页面编码为UTF-8 --%> <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %> +<%-- 引入JSTL核心标签库,并设置前缀为c --%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%-- 设置一个名为host的变量,其值为localhost:8080/wechat --%> -<%--设置主机名--%> +<%-- 注释:设置主机名 --%> + wechat - + <%-- 设置网页的快捷图标(favicon) --%> + + <%-- 引入Bootstrap的CSS样式 --%> + <%-- 引入jQuery库 --%> +<%-- 如果message变量不为空,则弹出系统提示 --%>
- <%-- 页面头部--%> + <%-- 页面头部 --%> - + + + - - - + -- 2.34.1 From 81323a749882206c604149220a05fa7c9bd880a9 Mon Sep 17 00:00:00 2001 From: gtq <2149154091@qq.com> Date: Tue, 17 Dec 2024 23:22:51 +0800 Subject: [PATCH 11/12] test --- wechat-master/web/index.jsp | 247 ++++++++++++++++++++---------------- 1 file changed, 136 insertions(+), 111 deletions(-) diff --git a/wechat-master/web/index.jsp b/wechat-master/web/index.jsp index 959d7c2..9d07d8a 100644 --- a/wechat-master/web/index.jsp +++ b/wechat-master/web/index.jsp @@ -21,105 +21,139 @@ Time: 15:55 To change this template use File | Settings | File Templates. --%> +<%-- JSP页面指令,设置内容类型、字符集和页面编码为UTF-8 --%> <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %> +<%-- 引入JSTL核心标签库,用于在JSP中简化Java对象的操作 --%> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - -<%--设置主机名--%> +<%-- 设置一个名为host的变量,值为localhost:8080/wechat(注意:这个设置实际上没有生效,因为缺少标签的闭合和正确的使用方式) --%> +<%-- 正确的使用应该像这样:,但此处代码有误,仅作为注释说明意图 --%> + <%-- 设置主机名(此行代码有误,应包含在标签内部,并指定作用域)--%> +<%-- JSP注释,不会输出到客户端 --%> + - + <%-- 设置网页的字符编码为UTF-8 --%> - wechat + wechat <%-- 网页标题 --%> + <%-- 设置网页的图标,这里使用的是微信的一个图标链接 --%> + <%-- 引入Bootstrap的CSS文件,用于快速开发响应式页面 --%> + <%-- 引入jQuery库,用于简化JavaScript的DOM操作和Ajax请求 --%> + +
- + - - + - - + +
+ +
+ + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + +