摘要: 通过HttpServletRequest获取表单提交的数据: 前端页面: 前端页面的name和value对应request对象中Map集合的name和value Servlet程序: 具体介绍HttpServletRequest接口的常用方法: 代码示例: 代码示例(包含请求转发,在两个Servle 阅读全文
posted @ 2017-02-06 20:36 拉夫德尔 阅读(1217) 评论(0) 推荐(0) 编辑
摘要: 第一步改进,GenericServlet: 我们目前所有放入Servlet类直接实现了javax.servlet.Servlet接口,但是这个接口中有很多方法是目前不需要的,我们可能只需要编写service。直接实现Servlet接口代码丑陋,有必要在中间添加一个适配器,以后所有的Servlet类不 阅读全文
posted @ 2017-02-06 19:24 拉夫德尔 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 欢迎页面: 代码详解: web.xml配置文件: WelcomeServlet: HTTP状态码: 阅读全文
posted @ 2017-02-06 15:42 拉夫德尔 阅读(1369) 评论(0) 推荐(0) 编辑
摘要: ServletConfig接口: ServletContext接口: 代码详解: (1)web.xml配置文件: (2) 前端页面: (3)辅助实体类: (4) Servlet程序: 阅读全文
posted @ 2017-02-06 14:39 拉夫德尔 阅读(561) 评论(0) 推荐(0) 编辑