第一个eclipse程序

1.配置Tomcat
2.右键-new-project-web-Dynamic Web Project【动态的web 工程】-next-输入Project name-next-finish
在这里插入图片描述完成后出现下列图片
在这里插入图片描述其中比较重要的文件夹是
Java Resources:编写Java程序
WebContent:防止配置文件
3.配置基础类库
在这里插入图片描述找到D:\Spring Mybatis2\codes\02\SpringMVCTest\WebContent\WEB-INF\lib
将其Ctrl+A->ctrl +c
在eclipse中找到lib,Ctrl+V
4.配置web.xml
将D:\Spring Mybatis2\codes\02\SpringMVCTest\WebContent\WEB-INF路径下的web.xml复制粘贴到eclipse中的WEB-INF路径下【想看代码的话,点击下方的source】
5.springmvc的配置
将D:\Spring Mybatis2\codes\02\SpringMVCTest\WebContent\WEB-INF地址下的 springmvc-config.xml文件复制粘贴到eclipse中的WEB-INF路径下
6.复制springmvc-config.xml文件下的org.fkit.controller.HelloController
7.在src下右键-new-class-
上面是包org.fkit.controller
下面是类HelloController
-finish
8.打开D:\Spring Mybatis2\codes\02\SpringMVCTest\src\org\fkit\controller路径下的HelloController.java文件,CTRL A, CTRL c复制到eclipse的HelloController类下
9.建立网页:
WEB-INF下右键-new-solder-content
将D:\Spring Mybatis2\codes\02\SpringMVCTest\WebContent\WEB-INF\content路径下的
welcome.jsp复制到eclipse中的content下
10.发布到服务器
tomct右键-add and remove
在这里插入图片描述11.启动tomcat,console启动了
12.网页上搜索
http//localhost:8080/test[工程]/hello[程序]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值