摘要: 第一种经典模式 <%-- Created by IntelliJ IDEA. User: 60590 Date: 2019/12/4 Time: 16:08 To change this template use File | Settings | File Templates. --%> <%@ 阅读全文
posted @ 2019-12-04 19:58 wu110111‬ 阅读(197) 评论(0) 推荐(0) 编辑
摘要: AJax的响应 1.普通文本方式(字符串) resp.getWriter().print("你好"); 2.JSON格式当要给前台页面传输 集合或者对象时 使用普通文本传输的时String 所以要引入JSON 后台servlet代码 Student stu = new Student(16, "五五 阅读全文
posted @ 2019-12-04 19:52 wu110111‬ 阅读(165) 评论(0) 推荐(0) 编辑
摘要: @WebServlet("/reply") public class ReplyServlet extends HttpServlet { @Override protected void service(HttpServletRequest req, HttpServletResponse res 阅读全文
posted @ 2019-11-29 08:54 wu110111‬ 阅读(983) 评论(0) 推荐(0) 编辑
摘要: 案例:当登陆密码或账号不正确时 提示 使用Requset对象中的作用域存储数据 语法:req.setAttribute(key, value);//键值对存在 当密码不存在时,设置作用域 else { // resp.sendRedirect("login.jsp"); req.setAttribu 阅读全文
posted @ 2019-11-29 08:47 wu110111‬ 阅读(126) 评论(0) 推荐(0) 编辑
摘要: jsp页面 <%-- Created by IntelliJ IDEA. User: 60590 Date: 2019/11/28 Time: 14:10 To change this template use File | Settings | File Templates. --%> <%@ p 阅读全文
posted @ 2019-11-28 22:14 wu110111‬ 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Cookie 概念:Cookie技术是客户端浏览器的数据储存技术,客户端浏览器负责储存,但是具体储存的内容由服务器决定, 如果没有设置有效期,默认有效期为浏览器关闭,默认有效期是浏览器关闭(一次会话) 解决的问题:同一个客户的不同请求之间的数据共享问题 特点: 浏览器端的数据存储技术 适合少量数据 阅读全文
posted @ 2019-11-28 22:01 wu110111‬ 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 请求转发 概念:是一种在服务器内部实现跳转的方式 1.步骤 request.getRequestDispatcher("path").forward(requset,response);path:请求转发的路径只能是当前服务器中的内部资源 forward:转发的资源 2.特点①浏览器地址的路径不会发 阅读全文
posted @ 2019-11-27 22:16 wu110111‬ 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 例子:登陆失败后重新返回登陆页面 第一次请求就是客户端发来的HTTP的请求,http://localhost:8080/day13/login.jsp的请求 服务器的sendRedirect方法对请求发出响应,响应头中有重定向的地址http://localhost:8080/day13/login. 阅读全文
posted @ 2019-11-27 19:22 wu110111‬ 阅读(1512) 评论(0) 推荐(0) 编辑
摘要: 解决乱码 1.控制台乱码 加一行 2.客户端(浏览器)乱码问题 ?? 在java代码加 resp.setContentType("text/html;charset=utf-8");//解决乱码 阅读全文
posted @ 2019-11-26 15:00 wu110111‬ 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-11-01 14:26 wu110111‬ 阅读(78) 评论(0) 推荐(0) 编辑