zoukankan      html  css  js  c++  java
  • Tomcat目录映射设置

    方法一:

    confserver.xml

    <Host>内插入<Context path="虚拟目录" docBase="文件目录" />

    <Context path="虚拟目录" docBase="文件目录" />

    注:需重启Tomcat

    方法二:

    confCatalinalocalhost

    新建文件 虚拟目录.xml 文件内写入

    <Context path="" docBase="文件目录" />

    注:

    多级目录写法 虚拟一级目录#虚拟二级目录#虚拟三级目录.xml

    根目录起始页设置

    confCatalinalocalhost

    1.新建文件 ROOT.xml 文件内写入

    <Context path="" docBase="文件目录" />

    2.文件目录下新建必须文件夹 "WEB-INF","WEB-INF"下新建文件夹"classes"和"lib"

    3.新建文件 web.xml 文件内写入

    复制代码
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--
    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://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">
    <welcome-file-list>
    <welcome-file>起始页1.html</welcome-file>
    <welcome-file>起始页2.html</welcome-file>
    <welcome-file>起始页3.html</welcome-file>
    </welcome-file-list>

    </web-app>
    复制代码

    本地域名映射

    1.C:WindowsSystem32driversetchosts

    127.0.0.1 域名

    2.confserver.xml

    <Engine></Engine>内插入

    <Host name="域名"  appBase="域名基准文件路径">
    <Context path="虚拟目录" docBase="文件路径(相对基准文件路径)"/>
    </Host>


    *端口

    <Connector port="80" protocol="HTTP/1.1"
    connectionTimeout="20000"
    redirectPort="8443" />
  • 相关阅读:
    CSS 圣杯/双飞翼布局
    java 面向对象编程-- 第15章 集合框架
    java 面向对象编程--第十四章 多线程编程
    java 面向对象编程-- 第十三章 反射、类加载与垃圾回收
    java 面向对象编程 --第十二章 JDK常用类
    java 面向对象编程--第十章 接口
    java面向对象编程--第十一章 异常处理
    java面向对象编程--第九章 多态和抽象
    java面向对象编程——第八章 类的高级概念
    java面向对象编程— —第七章 继承
  • 原文地址:https://www.cnblogs.com/liutt1989/p/5938132.html
Copyright © 2011-2022 走看看