摘要: 下面是XML格式异步获取代码: 点击不同的a连接,获取不同的xml文本中的数据 获取的xml文本的代码如下: 优点: 缺点: 阅读全文
posted @ 2019-06-26 11:56 Tamako521 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 解析HTML 准备装载数据的html文本include.html 负责对服务器请求的页面 效果: 点击超链接,在a标签下面的div中插入html代码 阅读全文
posted @ 2019-06-26 10:33 Tamako521 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 利用XMLHttpRequest实例与服务器进行通讯包含以下3个关键部分: -onreadystatechange时间时间事件处理函数 (用服务器触发,每次readystate属性改变都会触发readystatechange事件) -open方法 -send方法 readystate属性有五个值 0 阅读全文
posted @ 2019-06-25 21:11 Tamako521 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 最近对于request中的几种“路径”有点混淆,查找网上资源都没有很好的总结,希望此文章能够帮助我理解一下这几种“路径”。 +++++++++++++++++++++++++++++++++++++++++++++++++ 本文章主要讨论以下几种request获取路径的方法: 以一个简单的例子说明: 阅读全文
posted @ 2019-06-25 12:17 Tamako521 阅读(1006) 评论(0) 推荐(0) 编辑
摘要: 1.首先准备上传页面uoload.html 注意:method必须设置为post 加入属性enctype="multipart/form-data",准备type=file“选择文件框 2.准备 UploadPhotoServlet 这里利用两个第三方的jar 需要导入commons-io-1.4. 阅读全文
posted @ 2019-06-24 14:43 Tamako521 阅读(232) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>switch</title> <script> /** * switch中的语句后面一般都会加上break,否则一个case匹配后不仅会执行当前的语句, * 还会继 阅读全文
posted @ 2019-06-13 16:35 Tamako521 阅读(124) 评论(0) 推荐(0) 编辑
摘要: ifnull函数的参数有两个,如果不是null,返回第一个参数,如果为null返回第二个参数 阅读全文
posted @ 2019-06-07 15:04 Tamako521 阅读(1559) 评论(0) 推荐(0) 编辑
摘要: public class CategoryDAO { public int getTotal() { int total = 0; try (Connection c = DBUtil.getConnection(); Statement s = c.createStatement()) { String sql = "sele... 阅读全文
posted @ 2019-06-06 17:08 Tamako521 阅读(666) 评论(0) 推荐(0) 编辑
摘要: public void add(Category bean) { String sql = "insert into category values(null,?)"; try (Connection c = DBUtil.getConnection(); PreparedStatement ps = c.prepareStatement(sql)) { ... 阅读全文
posted @ 2019-06-06 16:54 Tamako521 阅读(859) 评论(0) 推荐(0) 编辑
摘要: 请求转发 RequestDispatcher 重定向 Redirect 代码的执行: 无论是 request.getRequestDispatcher(path).forward(request, response)还是response.sendRedirect,程序都会在执行完该句的情况下继续向下 阅读全文
posted @ 2019-06-06 15:52 Tamako521 阅读(263) 评论(0) 推荐(0) 编辑