zoukankan      html  css  js  c++  java
  • JavaWeb_tomcat设置默认应用

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

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

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

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

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

  • 相关阅读:
    着迷
    网上找的所谓过滤
    最近很郁闷
    属性应用
    新版微软一站式示例代码浏览器全球发布 – Metro 界面带给你全新示例搜索浏览体验
    微软一站式示例代码库 2012示例代码发布第一期
    微软一站式示例代码库 8 月新代码示例发布
    如何在Visual Studio中直接使用示例代码浏览器搜索下载和管理代码示例
    一周最新示例代码回顾 (3/19–3/25)
    微软一站式示例代码库 2012 年2月示例代码更新。8个全新示例为您的开发保驾护航
  • 原文地址:https://www.cnblogs.com/LoganChen/p/6369446.html
Copyright © 2011-2022 走看看