第一个eclipse程序

1.配置Tomcat
2.右键-new-project-web-Dynamic Web Project【动态的web 工程】-next-输入Project name-next-finish
第一个eclipse程序完成后出现下列图片
第一个eclipse程序其中比较重要的文件夹是
Java Resources:编写Java程序
WebContent:防止配置文件
3.配置基础类库
第一个eclipse程序找到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
第一个eclipse程序11.启动tomcat,console启动了
12.网页上搜索
http//localhost:8080/test[工程]/hello[程序]