Microsoft Windows [版本 10.0.26100.3476] (c) Microsoft Corporation。保留所有权利。 (base) D:\test>D:/miniconda3/python.exe d:/test/tsst.py (base) D:\test>D:/miniconda3/python.exe d:/test/tsst.py Traceback (most recent call last): File "d:\test\tsst.py", line 49, in <module> print(read()) ^^^^^^ File "d:\test\tsst.py", line 3, in read with open('his.txt').read().split() as his_ls: ^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'his.txt' (base) D:\test>D:/miniconda3/python.exe d:/test/tsst.py Traceback (most recent call last): (base) D:\test>D:/miniconda3/python.exe d:/test/tsst.py Traceback (most recent call last): File "d:\test\tsst.py", line 49, in <module> Traceback (most recent call last): File "d:\test\tsst.py", line 49, in <module> File "d:\test\tsst.py", line 49, in <module> print(read('his.txt')) print(read('his.txt')) ^^^^^^^^^^^^^^^ TypeError: read() takes 0 positional arguments but 1 was given (base) D:\test>D:/miniconda3/python.exe d:/test/tsst.py Traceback (most recent call last): File "d:\test\tsst.py", line 51, in <module> print("原始数据:", read(filename)) ^^^^^^^^^^^^^^ File "d:\test\tsst.py", line 3, in read with open('his.txt') as f: ^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'his.txt' (base) D:\test>
时间: 2025-07-08 07:28:26 浏览: 24
<think>好的,我现在需要分析用户提供的错误信息,并给出解决方案。用户多次运行Python脚本时遇到了不同的错误,主要集中在文件未找到和函数参数不匹配的问题。让我逐步梳理这些错误,并思考如何解释和解决它们。
首先看第一个错误:FileNotFoundError: 'his.txt'。用户运行脚本时,Python尝试打开当前目录下的'his.txt'文件,但系统找不到该文件。可能的原因包括文件不存在、文件名拼写错误、或者文件不在当前工作目录中。需要检查这些可能性。
接下来,用户修改代码后出现TypeError: read() takes 0 positional arguments but 1 was given。这说明用户可能在函数调用时传递了一个参数,但函数定义中没有相应的参数接收。需要检查函数定义和调用是否一致,确保参数匹配。
第三个错误仍然是FileNotFoundError,但这次用户可能在代码中硬编码了文件名,导致即使传递参数也无法找到文件。需要确认文件路径是否正确,或者是否应该使用相对路径/绝对路径。
可能的解决方案包括:确保文件存在且路径正确,检查函数定义和调用的一致性,使用try-except处理异常,以及使用os模块检查文件是否存在。此外,指导用户如何正确传递文件名参数,并验证当前工作目录是否正确。
需要分步骤解释每个错误的原因,并提供具体的解决步骤,比如如何检查当前目录、确认文件名、修改函数定义等。同时,提醒用户在编程时注意错误处理和路径管理,避免类似问题。</think>通过分析你提供的错误信息,可以梳理出以下问题及解决方案:
### 一、错误类型分析
#### 1. 首次错误
```python
FileNotFoundError: [Errno 2] No such file or directory: 'his.txt'
```
**原因**:代码试图打开当前目录下的 `his.txt` 文件,但该文件不存在
#### 2. 第二次错误
```python
TypeError: read() takes 0 positional arguments but 1 was given
```
**原因**:函数定义 `def read():` 没有参数,但调用时使用了 `read('his.txt')` 传递参数
#### 3. 第三次错误
```python
FileNotFoundError: [Errno 2] No such file or directory: 'his.txt'
```
**原因**:虽然函数改为接收参数,但代码中仍硬编码了 `open('his.txt')`
### 二、分步解决方案
#### 步骤 1:确认文件存在
在命令行中执行:
```powershell
dir his.txt
```
如果提示找不到文件,说明需要:
1. 创建文件
2. 检查文件名拼写(区分大小写)
3. 确保文件在 `D:\test` 目录下
#### 步骤 2:修正函数定义
原始错误代码:
```python
def read():
with open('his.txt') as f: # 硬编码文件名
```
修改后应支持参数传递:
```python
def read(filename): # 添加参数
with open(filename) as f: # 使用参数
return f.read().split()
```
#### 步骤 3:统一函数调用
确保调用方式与定义匹配:
```python
print(read('his.txt')) # 传递正确参数
```
### 三、补充建议
1. **路径验证**:添加文件存在检查
```python
import os
def read(filename):
if not os.path.exists(filename):
raise FileNotFoundError(f"{filename} 不存在")
# 其他代码
```
2. **异常处理**:增强代码健壮性
```python
try:
print(read('his.txt'))
except FileNotFoundError as e:
print(f"错误:{e}")
```
3. **路径规范**:建议使用原始字符串处理Windows路径
```python
file_path = r'd:\test\his.txt' # 注意开头的 r
```
### 四、典型错误场景示例
假设你的目录结构为:
```
D:\test
├── tsst.py
└── his.txt <-- 必须存在
```
正确代码示例:
```python
def read(filename):
with open(filename, 'r') as f:
return f.read().split()
if __name__ == "__main__":
filename = 'his.txt'
print(read(filename))
```
请检查以上要点后重新运行程序。如果仍有问题,可以提供 `tsst.py` 的完整代码,我们可以进一步分析。
阅读全文
相关推荐










contactList.jsp:<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>${isBlacklist ? '黑名单' : '联系人列表'}</title>
<style>
:root {
--primary-color: #4361ee;
--secondary-color: #3f37c9;
--success-color: #4cc9f0;
--danger-color: #f72585;
--warning-color: #f8961e;
--light-color: #f8f9fa;
--dark-color: #212529;
}
body {
background-color: #f5f7fa;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.container {
max-width: 1400px;
padding: 20px;
}
.header-section {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
color: white;
border-radius: 15px;
padding: 2rem;
margin-bottom: 2rem;
box-shadow: 0 10px 20px rgba(67, 97, 238, 0.15);
}
.page-title {
font-weight: 700;
margin: 0;
display: flex;
align-items: center;
}
.page-title i {
font-size: 2rem;
margin-right: 1rem;
}
.action-buttons .btn {
border-radius: 50px;
padding: 0.5rem 1.5rem;
font-weight: 500;
margin-left: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
}
.action-buttons .btn:hover {
transform: translateY(-2px);
box-shadow: 0 7px 14px rgba(0, 0, 0, 0.15);
}
.nav-tabs {
border-bottom: none;
margin: 1.5rem 0;
}
.nav-tabs .nav-link {
border: none;
color: #6c757d;
font-weight: 500;
padding: 0.75rem 1.5rem;
border-radius: 50px;
margin-right: 0.5rem;
transition: all 0.3s ease;
}
.nav-tabs .nav-link.active {
background-color: var(--primary-color);
color: white;
box-shadow: 0 4px 6px rgba(67, 97, 238, 0.3);
}
.nav-tabs .nav-link:not(.active):hover {
color: var(--primary-color);
background-color: rgba(67, 97, 238, 0.1);
}
.search-box {
background: white;
border-radius: 50px;
padding: 0.5rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.search-box input {
border: none;
border-radius: 50px 0 0 50px;
padding: 0.75rem 1.5rem;
}
.search-box input:focus {
box-shadow: none;
}
.search-box button {
border-radius: 0 50px 50px 0;
background-color: var(--primary-color);
color: white;
border: none;
padding: 0.75rem 1.5rem;
transition: all 0.3s ease;
}
.search-box button:hover {
background-color: var(--secondary-color);
}
.contact-card {
background: white;
border-radius: 15px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease;
margin-bottom: 1.5rem;
overflow: hidden;
}
.contact-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}
.contact-avatar {
width: 80px;
height: 80px;
border-radius: 50%;
object-fit: cover;
border: 3px solid white;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.contact-info {
padding: 1.5rem;
}
.contact-name {
font-weight: 600;
color: var(--dark-color);
margin-bottom: 0.5rem;
}
.contact-phone {
color: #6c757d;
font-size: 0.9rem;
}
.status-badge {
font-size: 0.8rem;
padding: 0.35rem 0.75rem;
border-radius: 50px;
font-weight: 500;
}
.action-btn {
min-width: 100px;
border-radius: 50px;
font-size: 0.85rem;
font-weight: 600;
padding: 0.5rem 1rem;
margin: 0.25rem;
transition: all 0.3s ease;
}
.action-btn:hover {
transform: translateY(-2px);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}
.pagination {
margin-top: 3rem;
justify-content: center;
}
.page-item .page-link {
border-radius: 50px !important;
margin: 0 0.25rem;
border: none;
color: var(--dark-color);
font-weight: 500;
min-width: 40px;
text-align: center;
}
.page-item.active .page-link {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
color: white;
box-shadow: 0 4px 6px rgba(67, 97, 238, 0.3);
}
.no-contacts {
text-align: center;
padding: 3rem;
color: #6c757d;
}
.no-contacts i {
font-size: 3rem;
color: #dee2e6;
margin-bottom: 1rem;
}
/* 天气预报样式 */
.weather-widget {
background: linear-gradient(135deg, #1e3c72, #2a5298);
color: white;
border-radius: 15px;
padding: 2rem;
margin-bottom: 2rem;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
position: relative;
overflow: hidden;
}
.weather-widget::before {
content: "";
position: absolute;
top: -50%;
right: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
z-index: 0;
}
.weather-content {
position: relative;
z-index: 1;
}
.weather-title {
font-weight: 700;
margin: 0;
display: flex;
align-items: center;
font-size: 1.5rem;
}
.weather-title i {
font-size: 1.8rem;
margin-right: 1rem;
}
.weather-details {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 1.5rem;
}
.weather-info {
flex: 1;
}
.weather-city {
font-size: 1.8rem;
font-weight: 600;
margin-bottom: 0.5rem;
}
.weather-desc {
font-size: 1.2rem;
opacity: 0.9;
margin-bottom: 0.5rem;
text-transform: capitalize;
}
.weather-temp {
font-size: 3rem;
font-weight: 700;
margin: 0;
line-height: 1;
}
.weather-icon-container {
width: 100px;
height: 100px;
display: flex;
align-items: center;
justify-content: center;
}
.weather-icon {
width: 100%;
height: 100%;
object-fit: contain;
filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}
.weather-extra {
display: flex;
justify-content: space-between;
margin-top: 1.5rem;
padding-top: 1rem;
border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.weather-extra-item {
text-align: center;
flex: 1;
}
.weather-extra-label {
font-size: 0.9rem;
opacity: 0.8;
margin-bottom: 0.3rem;
}
.weather-extra-value {
font-size: 1.2rem;
font-weight: 600;
}
/* 天气动画 */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.weather-animate {
animation: fadeIn 0.5s ease-out forwards;
}
/* 移动端特定样式 */
@media (max-width: 768px) {
.header-section {
padding: 1.5rem;
}
.action-buttons {
margin-top: 1rem;
}
.contact-avatar {
width: 60px;
height: 60px;
}
.action-btn {
min-width: auto;
padding: 0.4rem 0.8rem;
font-size: 0.8rem;
}
.search-box input, .search-box button {
padding: 0.5rem 1rem;
}
.nav-tabs .nav-link {
padding: 0.5rem 1rem;
margin-right: 0.25rem;
}
.weather-widget {
padding: 1.5rem;
}
.weather-temp {
font-size: 2rem;
}
.weather-city {
font-size: 1.2rem;
}
}
/* 触摸友好元素 */
.btn, .form-control, .nav-link, .page-link {
touch-action: manipulation;
}
</style>
</head>
<body>
${isBlacklist ? '黑名单管理' : '联系人中心'}
新增联系人
查看事项
实时天气
唐山
--
--°C
湿度
--%
风速
-- m/s
气压
-- hPa
正常联系人
黑名单
筛选条件
<form class="row g-3" method="get" action="${pageContext.request.contextPath}/contact">
<input type="hidden" name="action" value="${isBlacklist ? 'blacklist' : ''}">
<input type="text" class="form-control" name="search" placeholder="搜索姓名/电话"
value="${param.search}" aria-label="Search">
<button class="btn btn-primary" type="submit">
搜索了一个
</button>
<select class="form-select" name="gender" onchange="this.form.submit()">
<option value="">所有性别</option>
<option value="男" ${param.gender == '男' ? 'selected' : ''}>男</option>
<option value="女" ${param.gender == '女' ? 'selected' : ''}>女</option>
</select>
重置
</form>
<c:if test="${empty contacts}">
暂无联系人数据
点击"新增联系人"按钮添加您的第一个联系人
</c:if>
<c:forEach var="contact" items="${contacts}">
${contact.ctName}
<c:if test="${contact.ctDelete == 1}">
已屏蔽
</c:if>
${contact.ctPhone}
${isBlacklist ? '黑名单' : '正常'}
详情
事项
<c:choose>
<c:when test="${isBlacklist}">
恢复
</c:when>
<c:otherwise>
<c:if test="${contact.ctDelete == 0}">
屏蔽
</c:if>
</c:otherwise>
</c:choose>
</c:forEach>
<c:if test="${not empty contacts}">
<c:if test="${currentPage > 1}">
</c:if>
<c:forEach begin="1" end="${totalPages}" var="i">
${i}
</c:forEach>
<c:if test="${currentPage < totalPages}">
</c:if>
</c:if>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script>
// 获取天气数据
function getWeather() {
const apiKey = "d9bd1b0c215b38f1ceba3a8b06818789"; // OpenWeatherMap API密钥
const city = "Tangshan"; // 唐山的英文名
// 获取唐山天气
fetch(https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric&lang=zh_cn)
.then(response => {
if (!response.ok) {
throw new Error("网络响应错误:" + response.statusText);
}
return response.json();
})
.then(data => {
updateWeatherUI(data);
})
.catch(error => {
console.error('获取天气数据失败:', error);
showWeatherError();
});
}
// 更新天气UI
function updateWeatherUI(data) {
document.getElementById('weatherTemp').textContent = ${Math.round(data.main.temp)}°C;
document.getElementById('weatherDesc').textContent = data.weather[0]?.description || "--";
document.getElementById('weatherIcon').src = https://openweathermap.org/img/wn/${data.weather.icon}@2x.png;
document.getElementById('weatherHumidity').textContent = ${data.main.humidity}%;
document.getElementById('weatherWind').textContent = ${data.wind.speed} m/s;
document.getElementById('weatherPressure').textContent = ${data.main.pressure} hPa;
}
// 显示天气错误
function showWeatherError() {
document.getElementById('weatherCity').textContent = "天气数据获取失败";
document.getElementById('weatherDesc').textContent = "请检查网络连接";
document.getElementById('weatherTemp').textContent = "--°C";
document.getElementById('weatherHumidity').textContent = "--%";
document.getElementById('weatherWind').textContent = "-- m/s";
document.getElementById('weatherPressure').textContent = "-- hPa";
}
// 页面加载完成后获取天气数据
document.addEventListener('DOMContentLoaded', getWeather);
</script>
</body>
</html>控制台日志:D:\apache-tomcat-8.5.99\bin\catalina.bat run
[2025-06-10 09:39:00,390] Artifact firstweb2:war: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\DELL\AppData\Local\JetBrains\IntelliJIdea2022.2\tomcat\673dafd6-7580-4107-962c-bab19e459aa1"
Using CATALINA_HOME: "D:\apache-tomcat-8.5.99"
Using CATALINA_TMPDIR: "D:\apache-tomcat-8.5.99\temp"
Using JRE_HOME: "D:\java"
Using CLASSPATH: "D:\apache-tomcat-8.5.99\bin\bootstrap.jar;D:\apache-tomcat-8.5.99\bin\tomcat-juli.jar"
Using CATALINA_OPTS: ""
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server.服务器版本: Apache Tomcat/8.5.99
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 服务器构建: Feb 14 2024 22:52:13 UTC
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 服务器版本号: 8.5.99.0
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 操作系统名称: Windows 11
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS.版本: 10.0
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 架构: amd64
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java 环境变量: D:\java
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java虚拟机版本: 18.0.2.1+1-1
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM.供应商: Oracle Corporation
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: C:\Users\DELL\AppData\Local\JetBrains\IntelliJIdea2022.2\tomcat\673dafd6-7580-4107-962c-bab19e459aa1
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\apache-tomcat-8.5.99
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: --add-opens=java.base/java.lang=ALL-UNNAMED
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: --add-opens=java.base/java.io=ALL-UNNAMED
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: --add-opens=java.base/java.util=ALL-UNNAMED
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Djava.util.logging.config.file=C:\Users\DELL\AppData\Local\JetBrains\IntelliJIdea2022.2\tomcat\673dafd6-7580-4107-962c-bab19e459aa1\conf\logging.properties
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Dcom.sun.management.jmxremote=
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Dcom.sun.management.jmxremote.port=1099
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Dcom.sun.management.jmxremote.ssl=false
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Dcom.sun.management.jmxremote.password.file=C:\Users\DELL\AppData\Local\JetBrains\IntelliJIdea2022.2\tomcat\673dafd6-7580-4107-962c-bab19e459aa1\jmxremote.password
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Dcom.sun.management.jmxremote.access.file=C:\Users\DELL\AppData\Local\JetBrains\IntelliJIdea2022.2\tomcat\673dafd6-7580-4107-962c-bab19e459aa1\jmxremote.access
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Djava.rmi.server.hostname=127.0.0.1
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Djdk.tls.ephemeralDHKeySize=2048
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Dignore.endorsed.dirs=
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Dcatalina.base=C:\Users\DELL\AppData\Local\JetBrains\IntelliJIdea2022.2\tomcat\673dafd6-7580-4107-962c-bab19e459aa1
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Dcatalina.home=D:\apache-tomcat-8.5.99
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: 命令行参数: -Djava.io.tmpdir=D:\apache-tomcat-8.5.99\temp
6月 10, 2025 9:39:01 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: 使用APR版本[1.7.4]加载了基于APR的Apache Tomcat本机库[1.2.39]。
6月 10, 2025 9:39:01 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR功能:IPv6[true]、sendfile[true]、accept filters[false]、random[true]、UDS [{4}]。
6月 10, 2025 9:39:01 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR/OpenSSL配置:useAprConnector[false],useOpenSSL[true]
6月 10, 2025 9:39:01 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL成功初始化 [OpenSSL 3.0.11 19 Sep 2023]
6月 10, 2025 9:39:01 下午 org.apache.coyote.AbstractProtocol init
信息: 初始化协议处理器 ["http-nio-8080"]
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 370 ms
6月 10, 2025 9:39:01 下午 org.apache.catalina.core.StandardService startInternal
信息: 正在启动服务[Catalina]
6月 10, 2025 9:39:01 下午 org.apache.catalina.core.StandardEngine startInternal
信息: 正在启动 Servlet 引擎:[Apache Tomcat/8.5.99]
6月 10, 2025 9:39:01 下午 org.apache.coyote.AbstractProtocol start
信息: 开始协议处理句柄["http-nio-8080"]
6月 10, 2025 9:39:01 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 82 ms
Connected to server
[2025-06-10 09:39:01,626] Artifact firstweb2:war: Artifact is being deployed, please wait...
6月 10, 2025 9:39:02 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。
־ ʼ
=== ݿ ===
û (user_message)
ϵ ˱ (contact_message)
ϵ ͼƬ (contact_picture_message)
ϵ (contact_matter_message)
=== ===
־ ʼ
=== ݿ ===
û (user_message)
ϵ ˱ (contact_message)
ϵ ͼƬ (contact_picture_message)
ϵ (contact_matter_message)
=== ===
[2025-06-10 09:39:02,537] Artifact firstweb2:war: Artifact is deployed successfully
[2025-06-10 09:39:02,537] Artifact firstweb2:war: Deploy took 911 milliseconds
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/
: GET
: null
û ỰID:
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/
: GET
: null
û ỰID:
=== Ӧ Ϣ ===
Ӧ״̬: 200
ʱ : 2ms
=== ===
=== Ӧ Ϣ ===
Ӧ״̬: 200
ʱ : 3ms
=== ===
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/login
: POST
: null
û ỰID:
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/login
: POST
: null
û ỰID:
=== Ӧ Ϣ ===
Ӧ״̬: 302
ʱ : 29ms
=== ===
=== Ӧ Ϣ ===
Ӧ״̬: 302
ʱ : 29ms
=== ===
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: GET
: null
û ỰID: EDB570CA9B045C3BD0946687C2639008
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: GET
: null
û ỰID: EDB570CA9B045C3BD0946687C2639008
6月 10, 2025 9:39:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: 把web 应用程序部署到目录 [D:\apache-tomcat-8.5.99\webapps\manager]
6月 10, 2025 9:39:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Web应用程序目录[D:\apache-tomcat-8.5.99\webapps\manager]的部署已在[153]毫秒内完成
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: GET
: action=detail&ctId=0000000002
û ỰID: EDB570CA9B045C3BD0946687C2639008
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: GET
: action=detail&ctId=0000000002
û ỰID: EDB570CA9B045C3BD0946687C2639008
=== Ӧ Ϣ ===
Ӧ״̬: 200
ʱ : 180ms
=== ===
=== Ӧ Ϣ ===
Ӧ״̬: 200
ʱ : 180ms
=== ===
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: POST
: action=update&ctId=0000000002
û ỰID: EDB570CA9B045C3BD0946687C2639008
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: POST
: action=update&ctId=0000000002
û ỰID: EDB570CA9B045C3BD0946687C2639008
=== Ӧ Ϣ ===
Ӧ״̬: 302
ʱ : 93ms
=== ===
=== Ӧ Ϣ ===
Ӧ״̬: 302
ʱ : 93ms
=== ===
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: GET
: action=detail&ctId=0000000002
û ỰID: EDB570CA9B045C3BD0946687C2639008
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: GET
: action=detail&ctId=0000000002
û ỰID: EDB570CA9B045C3BD0946687C2639008
=== Ӧ Ϣ ===
Ӧ״̬: 200
ʱ : 31ms
=== ===
=== Ӧ Ϣ ===
Ӧ״̬: 200
ʱ : 32ms
=== ===
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: GET
: null
û ỰID: EDB570CA9B045C3BD0946687C2639008
=== Ϣ ===
URL: http://localhost:8080/firstweb2_war/contact
: GET
: null
û ỰID: EDB570CA9B045C3BD0946687C2639008
还是无法查看天气情况,无法更新,请基于我的代码给出具体的解决措施和代码,代码要完完整整的,要全部的








