上一页 1 ··· 65 66 67 68 69 70 71 72 73 ··· 99 下一页
摘要: 1. register.jsp 2. VerifyUsernameServlet.java 3. UserService.java 4. VerifyUsernameServlet.java 5. register.jsp 效果: 阅读全文
posted @ 2020-08-19 00:58 Jasper2003 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 1. 在AjaxServlet.java中: 2. 在ajax.jsp中: 效果: 访问ajax.jsp时, 控制台输出"收到了ajax请求"(每两秒) 3. 发起ajax请求的时候,数据互相传递 <1> 服务器端向客户端传递数据: 在ajax.jsp中得到服务器端发送的数据: 效果: <2> 客户 阅读全文
posted @ 2020-08-18 11:15 Jasper2003 阅读(544) 评论(0) 推荐(0) 编辑
摘要: 1. 序列化 2. 反序列化 (json的解析) 3. 反序列化 - 较复杂的数据 也需要有对应的类来接受它: 阅读全文
posted @ 2020-08-18 09:40 Jasper2003 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1. index:jsp 原 <% Object user = session.getAttribute("user"); if(user == null){ %> <a href="<%=request.getContextPath()%>/login.jsp">登录</a> <a href="< 阅读全文
posted @ 2020-08-18 04:20 Jasper2003 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 1. 用法 <1> 引入jar包 <2> 引入jstl标签库 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> // 引入jstl标签库 <3> 与数据存储相关的三个标签 <4> jstl中的条件标签 1. if 2. 阅读全文
posted @ 2020-08-17 23:01 Jasper2003 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 1. 用法: <body> <% session.setAttribute("name","Jasper"); %> Hi, my name is: ${name} </body> 例子: 在login.jsp 和 register.jsp中 <% if(request.getAttribute(" 阅读全文
posted @ 2020-08-17 10:32 Jasper2003 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1. goods_list.jsp <table border="1"> <tr> <td>Name</td><td>Description</td><td>Price</td><td>Available</td><td>Operation</td> </tr> <% List<Goods> lis 阅读全文
posted @ 2020-08-17 07:32 Jasper2003 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 1. Goods.java 2. DBUtil.java public class DBUtil { public static Map<String,User> userMap = new HashMap<String,User>(); public static List<Goods> good 阅读全文
posted @ 2020-08-17 06:58 Jasper2003 阅读(278) 评论(0) 推荐(0) 编辑
摘要: goods_list.jsp <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <style type="te 阅读全文
posted @ 2020-08-17 04:33 Jasper2003 阅读(250) 评论(0) 推荐(0) 编辑
摘要: /* LoginServlet*/User user = service.login(username, password); if (user != null) { req.getSession().setAttribute("user", user); if(user.isAdmin()) { 阅读全文
posted @ 2020-08-16 21:54 Jasper2003 阅读(292) 评论(0) 推荐(0) 编辑
上一页 1 ··· 65 66 67 68 69 70 71 72 73 ··· 99 下一页