02 2019 档案
摘要:单个参数:以"?"开头+参数名+"="符号+参数值 例如 多个参数:以"?"开头+参数名1+"="符号+参数值1+"&"符号+参数名2+"="符号+参数值2
阅读全文
摘要:protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub //response.getWriter().append("Served at...
阅读全文
摘要:Cookie[] cookies = request.getCookies();//从会话里取出Cookie并放在Cookie数组里 if(cookies!=null) { for(Cookie c:cookies) { //循环遍历Cookie数组 String name =c.getName(); //...
阅读全文
摘要:Cookie cookie =new Cookie("user","黄花菜");//实例化一个Cookie对象 cookie.setMaxAge(7*24*60*60); //设置Cookie生命周期(有效时间);单位:秒 response.addCookie(cookie); //添加Cookie到会话
阅读全文
摘要:public void method1() { FileWriter fw = null; try { //如果文件存在,则追加内容;如果文件不存在,则创建文件 File f=new File("E:\\dd.txt"); fw = new FileWriter(f, true); } catch (IOException e) { e.printStack...
阅读全文
摘要:当工作空间路径有空格时,空格会被转成%20,将导致路径无法识别,于是就找不到路径了.
阅读全文
摘要:String[] item = request.getParameterValues("参数名");
阅读全文