摘要: ServletConfig类 ServletConfig类是Servlet程序的配置信息类 ServletConfig类的三大作用 1、可以获取Servlet程序的别名servlet-name的值 2、获取初始化参数init-param 3、获取ServletContext对象 以下为测试代码: s 阅读全文
posted @ 2021-05-18 15:44 ice--cream 阅读(70) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2020.cnblogs.com/blog/1865532/202105/1865532-20210518150358860-421950649.png) 阅读全文
posted @ 2021-05-18 15:02 ice--cream 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 使用IDEA创建Servlet程序 1、选中包,右键选择servlet, 2、按如下选项配置 3、点击OK,这时候HelloServlet3程序已经创建完,web.html中已配置了servlet标签,只需再配置servlet-mapping标签即可。 阅读全文
posted @ 2021-05-18 14:41 ice--cream 阅读(446) 评论(0) 推荐(0) 编辑
摘要: 通过继承HttpServlet类实现servlet程序 一般在实际项目开发中,都是使用继承HttpServlet类的方式去实现servlet程序 步骤如下: 1、编写一个类去继承HttpServlet类。 2、根据业务需要重写doGet()方法或doPost()方法 3、到web.xml中配置ser 阅读全文
posted @ 2021-05-18 14:22 ice--cream 阅读(384) 评论(0) 推荐(0) 编辑