一.web.xml配置文件(jsp页面可直接被访问)
1.在web.xml文件中配置
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
二.controller控制器(jsp页面只能被controller访问)
1.在mvc配置文件件中加入
<mvc:view-controller path="/" view-name=“redirect:login” />
2.在web.xml文件中加入
<welcome-file-list>
<welcome-file>login</welcome-file>
</welcome-file-list>
三.页面
1.在默认启动页面加
<meta http-equiv=“refresh” content=“0; url=login”>
原文链接:https://blog.youkuaiyun.com/weixin_44811846/article/details/96168909
本文介绍三种配置Web应用启动默认页面的方法:通过web.xml设置欢迎文件列表,利用MVC控制器重定向,及使用meta标签自动跳转。适用于希望了解如何在不同场景下设定Web应用入口页面的开发者。
707

被折叠的 条评论
为什么被折叠?



