簡體   English   中英

在Eclipse中使用Maven創建一個動態Web項目並在服務器上運行它

[英]Creating a dynamic web project with maven in eclipse and running it on server

當我在Eclipse和Tomcat服務器中使用maven創建一個動態Web項目時,它顯示為“ Hello World”。 我的問題是在index.jsp文件中說“ hello World”,但我找不到它被添加到“ web.xml”文件中。 不將其添加到web.xml中如何工作? 提前致謝。

Tomcat在$ TOMCAT_HOME / conf中具有其默認的“ web.xml”,如果在您的項目“ web.xml”中未找到映射,它將搜索默認的映射。

看一下該文件,您會發現:

<servlet-mapping>
    <servlet-name>jsp</servlet-name>
    <url-pattern>*.jsp</url-pattern>
    <url-pattern>*.jspx</url-pattern>
</servlet-mapping>

它還具有默認的歡迎文件列表:

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM