java web应用程序的简短URL

时间:2014-10-30 08:23:00

标签: java tomcat

当我转到http://localhost:8080/application name/app/index.html#/home

时,我有一个可以浏览的应用程序

我希望能够在我点击服务器名称时浏览它,例如http://localhost:8080

怎么做?

1 个答案:

答案 0 :(得分:1)

使用tomcat时,在web.xml中可以添加:

<welcome-file-list>
    <welcome-file>app/index.html</welcome-file>
</welcome-file-list>

然后您可以使用以下方式访问它:

http://localhost:8080/application_name/

这只会缩短应用程序的根页面,但我认为当你想要传播它时,这一点就更重要了。

完成此操作后,您应该看看:

Deploying my application at the root in Tomcat

相关问题