如何在tomcat上运行所选的webapp

我尝试在Tomcat上首次运行Webapp而不使用IDE(IntelliJ)。

我在/ webapps /中部署了我的项目的.war文件,并启动了Tomcat服务器。我以前在同一8080端口上创建了不同的Web应用程序,但我真的不知道如何更改这些应用程序接管该端口的优先级。

我真的不想更改端口,因为这很明显,而且我在考虑也许对web.xml文件的正确配置,或者在没有部署其他Web应用程序的情况下运行tomcat的新实例。我认为现在创建服务器的新实例已经太多了。

您能告诉我有什么方法可以选择哪个Webapp首先在端口8080上启动吗?

tomcat / webapps的内容:

$ ll
total 45
drwxr-xr-x 1 ThinkPad 197121    0 cze  4 21:29 docs/
drwxr-xr-x 1 ThinkPad 197121    0 cze  4 21:29 examples/
drwxr-xr-x 1 ThinkPad 197121    0 cze  4 21:29 host-manager/
drwxr-xr-x 1 ThinkPad 197121    0 lip 14 14:32 jspwebapp_war/
drwxr-xr-x 1 ThinkPad 197121    0 cze  4 21:29 manager/
drwxr-xr-x 1 ThinkPad 197121    0 cze  4 21:29 ROOT/
drwxr-xr-x 1 ThinkPad 197121    0 cze 22 13:31 sample/
-rw-r--r-- 1 ThinkPad 197121 4606 cze 22 13:31 sample.war
drwxr-xr-x 1 ThinkPad 197121    0 lis  9 22:59 teltuskoDemoApp/
-rw-r--r-- 1 ThinkPad 197121  342 lis  9 21:15 teltuskoDemoApp.war
drwxr-xr-x 1 ThinkPad 197121    0 cze 30 10:39 TestowyWebApp/
-rw-r--r-- 1 ThinkPad 197121 2215 cze 22 14:32 TestowyWebApp.war
drwxr-xr-x 1 ThinkPad 197121    0 lip 21 13:46 twitter_war/

其中一些项目是在spring和IntelliJ的帮助下完成的

我的项目继续执行web / index.jsp以及web / WEB-INF / web.xml:

<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_4_0.xsd"
         version="4.0">
</web-app>
renguopeng55 回答:如何在tomcat上运行所选的webapp

如果端口8080中已在运行某个应用程序,则另一个应用程序将无法开始使用端口8080。

在使用同一端口启动应用程序之前,必须终止使用8080端口的应用程序。

我相信最好的解决方案是在不同端口中启动应用程序。

本文链接:https://www.f2er.com/3130766.html

大家都在问