gpt4 book ai didi

Tomcat和Weblogic部署纯html文件过程解析

转载 作者:qq735679552 更新时间:2022-09-29 22:32:09 24 4
gpt4 key购买 nike

CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.

这篇CFSDN的博客文章Tomcat和Weblogic部署纯html文件过程解析由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.

1、首先纯html文件,得有一个入口 index.html 。

2、Tomcat是不需要指定web.xml的,因为即使你的文件里没有web.xml,也会读取conf 目录下的web.xml,在这个文件里边指定了index.html的入口 。

Tomcat的话只要将原文件部署到 webapps\ 目录下,或者在\conf\Catalina\localhost 目录下新建xml文件,指向html页面 。

?
1
2
3
4
<? xml version = '1.0' encoding = 'utf-8' ?>
   < Context docBase = "C:\Users\jiashubing\Desktop\dist"
   reloadable = "false" privileged = "true" antiResourceLocking = "false" antiJARLocking = "false" >   
</ Context >

3、如果是Weblogic的话, 可以直接发布war包,但是如果想要发布纯html文件,必须要新建WEB-INF\web.xml 文件,否则无安装部署 。

web.xml 文件的写法也很简单,注意格式,不要有中文字符 。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
< 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 >index</ welcome-file >
  </ welcome-file-list >
 
  <!--或者写成这种形式-->
  <!--<welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>-->
 
</ web-app >

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我.

原文链接:https://www.cnblogs.com/acm-bingzi/p/tomcathtml.html 。

最后此篇关于Tomcat和Weblogic部署纯html文件过程解析的文章就讲到这里了,如果你想了解更多关于Tomcat和Weblogic部署纯html文件过程解析的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com