手机做网站自己做,外国排版网站,视频下载网站软件做副屏,wordpress获取当前页面1. tomcat下载
官网#xff1a;https://tomcat.apache.org/
镜像地址#xff1a;https://mirrors.huaweicloud.com/apache/tomcat/ 1、选择一个版本下载#xff0c;官网下载速度缓慢#xff0c;推荐镜像 2、对压缩包进行解压#xff0c;无需进行安装#xff0c;解压放…1. tomcat下载
官网https://tomcat.apache.org/
镜像地址https://mirrors.huaweicloud.com/apache/tomcat/ 1、选择一个版本下载官网下载速度缓慢推荐镜像 2、对压缩包进行解压无需进行安装解压放置一个位置以后不挪动。
2. 配置环境变量
1、新建系统变量 变量名CATALINA_HOME 变量值tomcat路径 2、加入Path
3. tomcat启动
1、winR打开cmd输入startup之后弹出一个窗口不要关闭 2、浏览器输入localhost:8080/ 成功
4. IDEA配置tomcat
1、右上角-Edit Configuration 2、Tomcat Server - Local 3、配置Tomcat路径Configure - OK 4、配置JRE路径 5、Deployment - 至此IDEA配置Tomcat便完毕
5. IDEA测试Tomcat使用
写一个简单的测试程序代码结构如下 Person.java
package com.atguigu.demo;public class Person {public String getName() {return tom;}
}index.jsp
% page importcom.atguigu.demo.Person %
% page contentTypetext/html;charsetUTF-8 languagejava %
html
headtitle首页/title
/head
body
%new Person().getName() %
/body
/htmlweb.xml
?xml version1.0 encodingUTF-8?
web-app xmlnshttp://xmlns.jcp.org/xml/ns/javaeexmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsdversion4.0
/web-app运行代码 之后弹出页面 成功