web程序首页配置
来源:互联网 发布:淘宝直通车如何出价 编辑:程序博客网 时间:2024/04/30 05:36
使用Tomcat容易默认首页为index.html,index.jsp,index.htm
即使我们工程中WEB-INF/web.xml中并没有设置welcome-file。
因为Tomcat的安装文件中默认就设置了这三个页面,路径:D:\apache-tomcat-7.0.67\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>
一、当我们在server.xml中,直接指定域名时,通过spring指定的首页会生效。不会去访问index.html
<Host name="a.com" appBase="/Data/WEB_APP.01/a.com" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="ROOT" workDir="/Data/WEB_APP.01/work/a.com"/>
</Host>
二、可是当使用端口和IP方式时,通过spring指定的首页不会生效。会访问index.html
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
</Host>
这样会第二种方式导致存在一个问题。若webapp目录下有index.html,通过域名访问会直接访问index.html页面,而不是通过spring配置的首页跳转。
spring框架设置的跳转如下:
<!-- 配置默认首页 -->
<mvc:view-controller path="/" view-name="redirect:/page/redirect"/>
本来是想设置index.html为一个测试页面,用来验证服务器是否启动成功。这种问题存在于首页不是index.html的项目
这个问题的原因还没有找到,与大家一起分享下。
- web程序首页配置
- SpringMVC默认访问首页配置及web.xml配置
- SpringMVC默认访问首页配置及web.xml配置
- JAVA WEB学习——tomcat服务器首页配置
- WEB程序 IIS 的配置
- web首页加载优化
- 微信小程序商城首页
- tomcat5.5首页配置
- Tomcat 配置首页
- springMVC 配置默认首页
- webconfig 配置 默认首页
- apache 首页配置
- 首页配置页面
- struts2配置默认首页
- idea 默认首页配置
- tomcat修改首页配置
- SpringMVC 配置首页
- Nginx服务器配置首页
- 16.7.20
- ios 竖屏支持个别界面横屏
- python联网安装缺乏的包
- AIDL的实现
- JSON序列化与反序列化,读、写
- web程序首页配置
- C#与C++STL的容器对应说明
- MAC下安装MySQL以及重置初始密码详细教程
- csdn博客记录日志第一天
- 从"student a am i"到"i am a student"
- iOS 随状态改变的几个方法
- 画流程图的一些方法
- 在 Windows 上安装Rabbit MQ 指南
- android app 弱网测试