ij运⾏tomcat_⼿把⼿教你⽤IntelliJIDEA创建jsp项⽬Idea创建Web项⽬步骤:
1、创建⼀个项⽬
File -> New Project -> 输⼊项⽬名称“Demos” ,选择Project SDK为1.7 -> Next -> Finish
image
2、创建⼀个Module
⿏标点中项⽬名称demos -> 右键选择New,选择Module
image
输⼊Module名称“firstweb” -> 点击Next
image
勾选“Web Application” -> 确认已勾选“l” -> Finish
image
3、创建好的web项⽬
image
4、在web/WEB-INF下创建两个⽂件夹:classes和lib
classes⽤来存放编译后输出的class⽂件,lib⽤于存放第三⽅jar包。
[图⽚上传失败...(image-7395ff-1532333798333)]
5、配置⽂件夹路径
File -> Project Structure (快捷键:Ctrl + Shift + Alt + S) -> 选择Module :
选择 Paths -> 选择"Use module compile output path" -> 将Output path和Test output path都选择刚刚创建的classes⽂件夹。image
接着选择Dependencies -> 将Module SDK选择为1.7 -> 点击右边的“+”号 -> 选择1 “Jars or Directories”
image
-> 选择刚刚创建的lib⽂件夹
image
-> 选择“jar directory” -> 接着返回⼀路OK就⾏了~~
image
6、配置Tomcat容器
打开菜单Run -> 选择Edit Configuration
[图⽚上传失败...(image-84f2ae-1532333798332)]
点击“+”号 -> 选择“Tomcat Server” -> 选择“Local”
image
在"Name"处输⼊新的服务名,点击"Application server"后⾯的"",弹出Tomcat Server窗⼝,选择本地安装的Tomcat⽬录-> OK
jsp创建image
在"Run/Debug Configurations"窗⼝的"Server"选项板中,取消勾选"After launch",设置"HTTP port"和"JMX port"(默认值即可),点击 Apply -> OK, ⾄此Tomcat配置完成。
image
**7、在Tomcat中部署并运⾏项⽬ **
Run -> Edit Configurations,进⼊"Run/Debug Configurations"窗⼝ -> 选择刚刚建⽴的Tomcat容器 -> 选择Deployment -> 点击右边的“+”号 -> 选择Artifact
image
->选择web项⽬ -> Application context可以填“/hello”(其实也可以不填的~~) -> OK
image
8、编辑index.jsp⽂件
image
9、运⾏Tomcat,在浏览器中查看运⾏结果
image
image

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。