gpt4 book ai didi

Java 8 App Engine 在 Eclipse 中运行,@WebServlet 不起作用

转载 作者:行者123 更新时间:2023-12-01 16:28:43 25 4
gpt4 key购买 nike

我在 Eclipse 中运行 App Engine Standard

我的两个“servlet”使用“@WebServlet”工作,但 3 个不工作。这有效:

com.ifmrestoration.corrigo.CustomFieldServlet
@SuppressWarnings("serial")
@WebServlet(name = "CFAAppEngine", urlPatterns = { "/customfields" })
public class CustomFieldServlet extends HttpServlet {

这不是:

com.ifmrestoration.webscraper.ImageDownloaderServlet
@WebServlet(name = "DownloadServer", urlPatterns = { "/corrigoimagesdownload" })
public class ImageDownloaderServlet extends HttpServlet {

这是 web.xml

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>

最佳答案

您需要 web.xmlappengine-web.xml如果您将 GAE 标准与 Java 一起使用,因为它们用于描述如何配置您的应用程序。您可以查看文档,详细了解您的应用程序所需的配置设置。

关于Java 8 App Engine 在 Eclipse 中运行,@WebServlet 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62095564/

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