2018.3.19 Java web notes 004:

第二次研究出现问题,我停止电脑服务,还是没用,然后反复的startup.bat   和   shutdown.bat   没有用;

然后用命令行运行启动就成功了,很神奇的,win+R  cmd    d:   cd toact/bin/startup.bat    紧接着出现以下成功的页面;



配置快捷打开网页方式;

D: omactwebappsmywebWEB-INF       这是路径;

这是文档文件:

源代码:是conf文件夹下的文件,web.xml,可扩展标记语言,修改如下;

<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_3_1.xsd"
version="3.1">

<welcome-file-list>
<welcome-file>hellow.html</welcome-file>
</welcome-file-list>

</web-app>


在命令行下打包;

 D: omactwebappsmyweb>jar cvf D: omactmywebname.war .

       myweb文件夹下的文件   打包到    tomact文件夹下,名字问mywebname.war   到那个文件夹(这个点很重要)

注意一个细节上图路径打包没有打到webapps下不会自动解压的,然手动移动到webapps即会立即解压,自然去到localhost:8080/webapps/mywebname即可自动打开所有文件了;

This moment will nap, you will have a dream; but this moment study, you will interpret a dream.
原文地址:https://www.cnblogs.com/mawenqi-barry/p/8599650.html