[英]Cannot see Tomcat homepage( http://localhost:8080) when starting it from eclipse. But it loads when I start it from tomcat bin directory. Any idead?
[英]Where I define http://localhost:8080/“homepage”
我正在使用eclipse,並且使用Apache Tomcat運行我的項目。
我有以下文件:
1. applicationContext.xml
2. dispatcher-Servlet.xml
3. web.xml
4. pom.xml
我也有以下套餐
控制器,DAO,IMPL,模型。
我希望我的主頁為“ MyHomePage”。 因此,當我運行項目時,我的第一個URL將是: http:// localhost:8080 / MyHomePage 。
我必須在上面的哪個文件/包中定義此映射?
如果您的意思是http://localhost:8080/MyHomePage.html
然后像這樣在web.xml
指定主頁
<web-app>
....
<welcome-file-list>
<welcome-file>MyHomePage.html</welcome-file>
</welcome-file-list>
</web-app>
您還需要在網站的根文件夾中放置一個名為MyHomePage.html
的html文件,對於Tomcat,它是WebContent:
WebContent
|-- META-INF
|-- WEB-INF
| `-- web.xml
`-- MyHomePage.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.