摘要: 动态页面技术(JSP/EL/JSTL) php,asp(.net):在html中嵌套响应语言 java不行 servlet技术:在java代码中嵌套html response.getWriter().write("<html>"); jsp技术:在html中嵌套java代码,擅长写html代码 本质 阅读全文
posted @ 2019-01-18 09:37 博客张C 阅读(914) 评论(0) 推荐(0) 编辑
摘要: Session技术(存放在服务器 基于cookie(存储sessionId)) 每个客户端 第一次会话请求时 创建独自的session域+JSESSIONID 服务端 响应 set-cookie:JSESSIONID:xxxxx 存入客户端 客户端 请求时 携带cookie:JSESSIONID:x 阅读全文
posted @ 2019-01-18 09:29 博客张C 阅读(830) 评论(0) 推荐(0) 编辑
摘要: 会话技术Cookie&Session (记录这次会话中客户端的状态与数据 不登陆情况下,保存数据到本地) 一次会话:从打开浏览器访问某个站点,到关闭这个浏览器(关页面不算) Cookie:数据存储在客户端本地,减少服务器端存储压力,客户端可清除 Session:将数据存储到服务器端,安全性相对好 C 阅读全文
posted @ 2019-01-18 09:24 博客张C 阅读(221) 评论(0) 推荐(0) 编辑
摘要: HttpServletRequest(HttpServlet类的请求对象) public class LoginServlet extends HttpServlet { public void doGet(...) throws ServletException, IOException { St 阅读全文
posted @ 2019-01-18 09:15 博客张C 阅读(548) 评论(0) 推荐(0) 编辑
摘要: 客户端访问地址 tomcat从web.xml中根据地址 找到servlet类 并创建servlet对象 (第一次访问) 包含 (请求信息封装)请求对象和 (空/从中获取响应信息)响应对象 servlet对象对其进行操作 servlet 对象 写入响应缓冲区+响应...封装 public class 阅读全文
posted @ 2019-01-18 09:05 博客张C 阅读(680) 评论(0) 推荐(0) 编辑