添加第三方的JAR包
GSON 谷歌 快速封装JSON数据和解析JSON数据
mysql-connetcor 数据驱动 数据库创建链接,可以事物操作,数据的维护
tomcat系列框架 class文件,url生产基于服务器,servlet库,把目录、clas文件变成url让外部通过浏览器地址栏|请求访问
1.选择web-info创建lib文件夹,粘贴第三方jar包到该目录
2.copy paht 复制tomcat下方lib文件夹的路径
/Library/apache-tomcat-8.5.49/lib
/Library/apache-tomcat-8.5.49/lib
3.选择项目,右键 open module settings,找到librarise,选择lib
4.web.xml配置文件
<?xml version="1.0" encoding="UTF-8"?>
<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_4_0.xsd"
version="4.0">
<!-- 服务器部署项目:第一个编译的文件,项目的配置、清淡文件 -->
<!-- 启动:第一个显示的页面 -->
<welcome-file-list>
<welcome-file>login.html</welcome-file>
</welcome-file-list>
</web-app>
5.点击run,运行服务器,查看日志信息是否成功
6.其他设备内网访问
验证本地IP地址
cmd:ifconfig
把localhost换成本机IP就可以访问
http://localhost:8080/XialiaoWorld_war_exploded/
http://192.168.1.2:8080/XialiaoWorld_war_exploded/
查看服务器部署和项目url