摘要: String sql = "select * from book where bid =?"; Map map = qr.query(sql, new MapHandler(),bid); //return qr.query(sql, ne... 阅读全文
posted @ 2015-11-06 16:11 暗夜小精灵~~ 阅读(528) 评论(0) 推荐(0) 编辑
摘要: servlet:public String active(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { /* ... 阅读全文
posted @ 2015-11-04 14:20 暗夜小精灵~~ 阅读(440) 评论(0) 推荐(0) 编辑
摘要: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //text/html, tex... 阅读全文
posted @ 2015-11-03 15:33 暗夜小精灵~~ 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1 ajax-lib/ajaxutils.js: 2 3 // 创建request对象 4 function createXMLHttpRequest() { 5 try { 6 return new XMLHttpRequest();//大多数浏览器 7 ... 阅读全文
posted @ 2015-11-03 10:12 暗夜小精灵~~ 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 1 演示JSON-LIB小工具 2 public class Demo1 { 3 /* 4 * 当map来用 5 */ 6 @Test 7 public void fun1() { 8 JSONObject map = new JSON... 阅读全文
posted @ 2015-11-03 10:10 暗夜小精灵~~ 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 1 package cn.itcast.demo1; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 import org.junit.Test; 7 8 import com.thoughtworks... 阅读全文
posted @ 2015-11-02 17:38 暗夜小精灵~~ 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 点击这里 servlet: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ... 阅读全文
posted @ 2015-11-02 15:41 暗夜小精灵~~ 阅读(284) 评论(0) 推荐(0) 编辑
摘要: request.setCharacterEncoding("utf-8");response.setContentType("text/html;charset=utf-8"); 阅读全文
posted @ 2015-11-02 10:03 暗夜小精灵~~ 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 第一步:完成index.jsp,只需要一个表单。注意表单必须是post的,而且enctype必须是mulitpart/form-data的。 用户名: 文件1: 第二步:完成FileUploadServletpublic void doPost(Ht... 阅读全文
posted @ 2015-10-30 17:42 暗夜小精灵~~ 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 下载1. 下载就是向客户端响应字节数据! 原来我们响应的都是html的字符数据! 把一个文件变成字节数组,使用response.getOutputStream()来各应给浏览器!!!2. 下载的要求 * 两个头一个流! > Content-Type:你传递给客户端的文件是什么MIME类型... 阅读全文
posted @ 2015-10-30 17:40 暗夜小精灵~~ 阅读(323) 评论(0) 推荐(0) 编辑