[英]index.jsp in war file under Tomcat
我試圖在我的本地tomcat上運行簡單的Web應用程序 - 該應用程序基本上是你在IntelliJ中創建“web應用程序”時所獲得的,因此目錄結構是“vanilla”。 我實際上沒有觸及index.jsp或web.xml。
我在Maven下這樣做,所以這是我的pom文件:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.testapps</groupId>
<artifactId>Test_App_1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>web\WEB-INF\web.xml</webXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
所以這就是我在做的事情:
mvn compile install
catalina start
我做錯了什么? 我不了解一些基本概念或遺漏一些基本的東西? 我應該以某種方式明確地將這個index.jsp包含到我的.war文件中嗎? 如果是這樣,我如何在IntelliJ下執行此操作? 我真的只是試圖運行這個“vanilla”應用程序而且我的印象是,index.jsp應該是這個.war文件的一部分,它應該“自動”顯示。 當我手動執行此操作時,我將在webapps文件夾中創建一些TestDirectory,復制相同的index.jsp文件並將其放在該目錄中,然后訪問它http:// localhost:8080 / TestDirectory - 它會自動顯示index.jsp文件應該如此。
對不起,可能,愚蠢的問題,我真的很新,我找不到解決方案。
在構建並重新部署並在服務器中測試之后刪除maven-war-plugin
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.