摘要:tomcat引擎1.解析请求地址2.创建servlet对象3.创建request对象 获取 内容和response对象 设置当在servlet的配置时 加上一个配置 <load-on-startup> servlet对象在服务器启动时就创建<!--设置该 servlet在启动时创建(值越小优先级越高
阅读全文
摘要:HTTP协议 连接网页用的 http协议 客户端 http请求 服务器 服务器 http响应 客户端请求 才会 响应HTTP请求 请求行: 请求方式 请求地址 请求协议版本 请求头: 是客户端发送给服务器端的一些信息 请求体: get请求方式没有请求体 post有请求体HTTP响应 响应行 http
阅读全文
摘要:创建一个xml文件 建一个文件夹导入jar包 building add 点入 public static void main(String[] args) throws DocumentException, ClassNotFoundException, InstantiationException
阅读全文
摘要:XML里面可以是用户自定义的 还是1.0版本 文档声明必须为<?xml开头,以?>结束; 注释也不可以 自动生成 : 1. versioin:指定XML文档版本。必须属性 2.encoding:指定当前文档的编码。可选属性,默认值是。utf-8: 元素命名:区分大小写 不能用空格,不能使用 :(冒号
阅读全文
摘要:第一种 用继承的方式 /////////////////////////////////////////////// public class MyThread extends Thread { public void run() { //获取线程的名称getName() System.out.pr
阅读全文
摘要:THIS //this 只能完成本类中所有构造方法之间的调用 public Person(){ this("张三",28); } public Person(String name,int age){ this.name=name; this.age=age; } SUPER super :子类中调
阅读全文
摘要:构造方法 修饰符 构造方法名=类名 (参数){ } 构造方法只能是由一次,他的使用周期短 普通的方法可以执行无数次 有构造方法也要有get,set方法, //构造方法getName=1; public Person(String name,int age){ this.name=name; this
阅读全文
摘要:////获取文件扩展名 String ext= FilenameUtils.getExtension("E:\\Java0322\\a.txt"); System.out.println("扩展名为"+ext); //获取文件名 String fname=FilenameUtils.getName(
阅读全文
摘要://明确目的地 FileOutputStream fos= new FileOutputStream("src/com/oracle/demo01/pro.properties",true); //创建properties集合 Properties pro=new Properties(); pro
阅读全文
摘要://明确数据源 FileInputStream fis= new FileInputStream("E:\\JAVA\\eclipse\\eclipse.zip"); //创建字节缓冲 BufferedInputStream bis= new BufferedInputStream(fis); //
阅读全文
摘要://1.明确数据源 FileInputStream fis= new FileInputStream("E:\\Java0322\\a.txt"); //2.创建字符输入转换流 InputStreamReader isr= new InputStreamReader(fis,"UTF-8"); //
阅读全文
摘要:这是数据输出到哪个位置 //创建字节输出流对象 //构造方法指定文件地址时,若果存在则覆盖 //如果不存在则创建 FileOutputStream fos=new FileOutputStream("E:\\Java0322\\d.txt"); /* //向文件中写入一个字节write(int b)
阅读全文
摘要:遍历所有.txt文件 public static void main(String[] args) { File file =new File("E:\\Java0322"); look(file); } public static void look(File file){ //获取该路径下的所有
阅读全文
摘要://file类: //文件:file //目录:文件夹:direction //路径:path //与系统有关的路径分隔符 win ; linux : System.out.println(File.pathSeparator); //与系统有关的路径名称分隔符 win \ linux / Syst
阅读全文