在tomcat的server.xml文件中设置默认应用。

在tomcat文件目录里面的conf/server.xml文件中,在<Engine>...</Engine>中再增加一个<Host name="www.flx.com" appBase="c:\flx"><Context path="" docBase="c:\flx\mail"/></Host>

在应用的web.xml设置应用的默认主页

 <?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<!-- ==================== Default Welcome File List ===================== -->
<!-- When a request URI refers to a directory, the default servlet looks -->
<!-- for a "welcome file" within that directory and, if present, to the -->
<!-- corresponding resource URI for display. -->
<!-- If no welcome files are present, the default servlet either serves a -->
<!-- directory listing (see default servlet configuration on how to -->
<!-- customize) or returns a 404 status, depending on the value of the -->
<!-- listings setting. -->
<!-- -->
<!-- If you define welcome files in your own application's web.xml -->
<!-- deployment descriptor, that list *replaces* the list configured -->
<!-- here, so be sure to include any of the default values that you wish -->
<!-- to use within your application. --> <welcome-file-list>
<welcome-file>1.html</welcome-file>
</welcome-file-list> </web-app>

37-39行即设置了默认页面。

最新文章

  1. iOS开发系列--地图与定位
  2. 微信开发笔记:获取用户openid,以及用户头像昵称等信息
  3. Oracle VM VirtualBox 安装CentOS 配置图形界面记录
  4. CentOS7 下安装JDK1.7 和 Tomcat7
  5. Python起步(2)
  6. 笔记 《Effective Objective-C 2.0:编写高质量iOS与OS X代码的52个有效方法 》
  7. LESS CSS 总结
  8. MyEclipse x.x各版本终极优化配置指南
  9. 实例:图像载入、显示、混合与输出[OpenCV 笔记8]
  10. C语言之ASCII码
  11. 高级UIKit-05(CoreData)
  12. Magento 2 Block模板终极指南
  13. CodeForces992E 二分 + 树状数组(线段树)
  14. 搭建Harbor企业级docker仓库
  15. Matlab Euler's method
  16. 设计模式之抽象工厂模式(附带类似反射功能的实现/c++)
  17. Ubuntu PPA软件源
  18. Raft 为什么是更易理解的分布式一致性算法(转)
  19. 转:winform 打包自动安装数据库
  20. 项目--解决MySQL数据库插入中文乱码

热门文章

  1. intellij idea使用技巧
  2. svn服务的安装和使用
  3. 基础学习笔记之opencv(6):实现将图片生成视频
  4. python调试利器:最直观简洁的错误日志
  5. High Performance Browser Networking
  6. CountDownLatch,CyclicBarrier,Semaphore的使用
  7. IOS 关于 NSUserDefault
  8. 【转】如何让虚拟目录里面的webconfig不继承网站的设置
  9. office 2010 激活工具 迷你KMS使用说明
  10. SQL语句编写注意问题