IDEA配置Tomcat并新建web项目
以下链接下载TomCat&IntelliJ IDEA:
TomCat官网链接
IDEA官网链接
配置Tomcat与IDEA在此忽略
注意:IDEA必须使用的是企业版!!!
运行环境:Ubuntu18.04 IDEA
下面进行配置:
打开IDEA->Run->Edit Configurations
选择左上角‘+’
选择‘TomCat Sever’
选择‘Local’
点击‘configure’添加自定义路径。点击OK!
Create Project
File->New->Project
在web文件夹下新建index.html
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome Web Page</title>
<script>
document.write("Welcome")
</script>
</head>
<body>
<h1>Welcome</h1>
</body>
</html>
点击左下角绿色三角运行即可: