2018.3.19 Java web notes 004:

 

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

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


 


配置快捷打开网页方式;

D:\tomact\webapps\myweb\WEB-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:\tomact\webapps\myweb>jar cvf D:\tomact\mywebname.war .

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

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

 

posted on 2018-03-19 09:39  马文奇  阅读(90)  评论(0编辑  收藏  举报

导航