![](/img/trans.png)
[英]Running Maven Spring project in eclipse using Web preview server
[英]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.