简单的Servlet文档创建

一、创建Servlet文件

选中项目,New,Servlet

这里会出错,因为环境没有设置好

设置J2EE环境:

选中项目,properties,选中Java  Build Path ,Libraries,Add Library

之后,选中Server Runtime,点击Next,选中相应的Tomcat,finish。

二、修改Servlet文档

图片中,表明,访问我们Servlet的url地址,此项目可以修改为/hello

这里如果出错:

1.停止tomcat

2.移除项目

3.重新导入

4.debug启动 

原文地址:https://www.cnblogs.com/zxj-262410/p/10778136.html