[英]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.