gpt4 book ai didi

java - tomcat 无法显示 JSP,错误 : The requested resource is not available

转载 作者:行者123 更新时间:2023-11-28 23:55:41 25 4
gpt4 key购买 nike

<分区>

我已经创建了一个示例项目来测试 jspProject looks like this

我正在使用 tomcat 9Java SE 8_73。该项目的 web 模块版本为 3.1,未生成 web.xml

java代码是这样的

package pac;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Servlet implementation class JSPProject
*/
@WebServlet("/jspproject")
public class JSPProject extends HttpServlet {
private static final long serialVersionUID = 1L;

protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter cut = response.getWriter();
cut.println("hello world");
}
}

但是当在服务器上运行 JSPProject.java 时,会显示以下错误消息。

HTTP Status 404 - /DynamicJSP/jspproject
type Status report`
message /DynamicJSP/jspproject
description The requested resource is not available.
The requested resource is not available.

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com