我是否需要安装 Tomcat *除了* Eclipse WTP 提供的那个,以便从 Eclipse 在 DEBUG 中 运行?
Do I need to install Tomcat *in addition to* the one provided with Eclipse WTP in order to run in DEBUG from Eclipse?
我正在尝试关注来自 JournalDev 的 Spring MVC Example。
它在 Eclipse(包括 WTP 插件)中构建并且运行很好:
Jul 30, 2021 2:04:52 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 30, 2021 2:04:52 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Jul 30, 2021 2:04:52 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Jul 30, 2021 2:04:54 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jul 30, 2021 2:04:54 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
但是当我尝试从浏览器访问它时,出现以下“HTTP 状态 404”错误:
这告诉我 Apache Tomcat 以某种方式 运行ning 但配置错误(我对 http://localhost:8080/manager/html 得到相同的错误)
(运行在独立的 Tomcat 上运行这个示例 webapp 工作正常)
我需要直接从 Eclipse DEBUG 角度对 运行 这个 Web 应用程序 (http://localhost:8080/spring-mvc-example/) 做什么?
简短的回答是否定的。如果使用 Apache Tomcat Maven Plugin,则无需安装另一个 Tomcat 实例。
然而,在正确设置上下文路径并将 WAR 工件部署到 target/tomcat/web
方面存在挑战,因为默认情况下它部署到 target
.
https://www.baeldung.com/tomcat-root-application is a good resource for configuring the context path on a standalone Tomcat installation (i.e. one that is not destroyed and reinstalled upon debug build & run) but for a Tomcat plugin environment the following resource is more helpful: https://tomcat.apache.org/maven-plugin-2.0/tomcat7-maven-plugin/usage.html
我正在尝试关注来自 JournalDev 的 Spring MVC Example。
它在 Eclipse(包括 WTP 插件)中构建并且运行很好:
Jul 30, 2021 2:04:52 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 30, 2021 2:04:52 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Jul 30, 2021 2:04:52 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Jul 30, 2021 2:04:54 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jul 30, 2021 2:04:54 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
但是当我尝试从浏览器访问它时,出现以下“HTTP 状态 404”错误:
这告诉我 Apache Tomcat 以某种方式 运行ning 但配置错误(我对 http://localhost:8080/manager/html 得到相同的错误)
(运行在独立的 Tomcat 上运行这个示例 webapp 工作正常)
我需要直接从 Eclipse DEBUG 角度对 运行 这个 Web 应用程序 (http://localhost:8080/spring-mvc-example/) 做什么?
简短的回答是否定的。如果使用 Apache Tomcat Maven Plugin,则无需安装另一个 Tomcat 实例。
然而,在正确设置上下文路径并将 WAR 工件部署到 target/tomcat/web
方面存在挑战,因为默认情况下它部署到 target
.
https://www.baeldung.com/tomcat-root-application is a good resource for configuring the context path on a standalone Tomcat installation (i.e. one that is not destroyed and reinstalled upon debug build & run) but for a Tomcat plugin environment the following resource is more helpful: https://tomcat.apache.org/maven-plugin-2.0/tomcat7-maven-plugin/usage.html