我已经把我的如下:当我通过tomcat启动我的应用程序时,为什么仍然会显示“http:// localhost:8080”?
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
当我在Netbeans的一切单击运行是好的,但第一页还是
http://localhost:8080
我还能做什么? 我是否需要在java代码或tomcat中配置其他文件?
我已经把我的如下:当我通过tomcat启动我的应用程序时,为什么仍然会显示“http:// localhost:8080”?
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
当我在Netbeans的一切单击运行是好的,但第一页还是
http://localhost:8080
我还能做什么? 我是否需要在java代码或tomcat中配置其他文件?
欢迎页面在上下文中有意义。如果您有多个WAR,则会有多个上下文,每个上下文都有一组单独的欢迎页面。尝试将您的应用部署为ROOT.war并测试它是否属于这种情况
有关更多信息,请参阅以下帖子。
在$ TOMCAT_HOME/conf目录/ web.xml中有一个叫做部分,它看起来像这样:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
默认的servlet尝试加载索引。*文件按所列顺序排列。您可以通过在$ TOMCAT_HOME/webapps/ROOT中创建index.html文件轻松覆盖index.jsp文件。这个文件包含一个新的静态主页或者重定向到一个servlet的主页是比较常见的。重定向将如下所示:
<html>
<head>
<meta http-equiv="refresh" content="0;URL=http://webaddress.com/some/path/to/servlet/homepage/">
</head>
<body>
</body>
</html>