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>
點擊左下角綠色三角運行即可: