我有一个应用程序,当我转到 http://localhost:8080/application name/app/index.html#/home
我希望能够在我点击服务器名称时浏览它,例如 http://localhost:8080
如何做到?
最佳答案
使用tomcat时,在web.xml中可以添加:
<welcome-file-list>
<welcome-file>app/index.html</welcome-file>
</welcome-file-list>
然后你可以访问它:
http://localhost:8080/application_name/
这只会缩短你的应用程序的根页面,但我认为当你想要传播它时,这是更重要的。
完成后你应该看看:
关于java - Java Web 应用程序的短 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26648103/