zoukankan      html  css  js  c++  java
  • java基础(server)

    反射: 

      反射Reflection: 把java类中的各种结构(方法、属性、构造器、类名)映射成一个个的Java对象。
              利用反射技术可以对一个类进行解剖,反射是框架设计的灵魂。
        
      //在运行期间,一个类,只有一个Class对象产生。
        1、源头: 获取class对象Class clz =Class.forName(“com.shsxt.Student")
        2、创建对象:com.shsxt.Student stu=(com.shsxt.Student)clz.newInstance();

    XML解析: 

      XML:Extensible Markup Language,可扩展标记语言,作为数据的一种存储格式或用于存储软件的参数,
          程序解析此配置文件,就可以到达不修改代码就能更改程序的目的。
      
      //SAX解析 流解析:从上往下
      //1、获取解析工厂
        SAXParserFactory factory=SAXParserFactory.newInstance();
      //2、从解析工厂获取解析器
        SAXParser parse =factory.newSAXParser();
      //3、加载文档 Document 注册处理器
      //4、编写处理器
        PersonHandler handler=new PersonHandler();parse.parse(Thread.currentThread().getContextClassLoader().getResourceAsStream("person.xml"),handler );

    HTTP协议:

      超文本传输协议(HTTP,HyperText Transfer Protocol)是互联网上应用最为广泛的一种网络协议,所有的WWW文件都必须遵守这个标准。
       请求协议1、请求行:方法(GET/POST)、URI、协议/版本
          2、请求头:(Request Header)
          3、请求正文: 
      
       响应协议1、状态行:协议/版本 状态码 状态描述
            2、响应头(Response Header)
                 3、响应正文:
     
      HTTP请求协议
      典型GET的请求协议:
      1、请求行 GET /index.html? name=test&pwd=123456 HTTP /1.1
      2、请求体 Accept: text/html, application/xhtml+xml, *
         / * Accept-Language: zh-CN
          User- Agent: Mozilla/5.0 (compatible; MSIE 9.0; W indows NT 6.1; Trident/5.0)
          Accept-Encoding: gzip, deflate Host: localhost Connection: Keep-Alive
      3、请求正文 
     
      
      典型POST的请求协议:
      1、请求行 POST /index.html HTTP/1.1
      2、请求体Accept: text/html, application/xhtml+xml,
       * / *Accept-Language: zh-CNUserAgent: Mozilla/5.0 (compatible; MSIE 9.0;
        Windows NT 6.1; Trident/5.0)Accept-Encoding: gzip, deflateHost:
         localhostConnection: Keep-Alive
      3、请求正文name=test&pwd=123456
     
      
      HTTP响应协议典型的响应协议::                                                                          
      1、状态行:HTTP/1.0 200 OK
      2、请求头Date:Mon,31Dec209904:25:57GMTServer:shsxt Server/0.0.1    
      ;charset=GBK Content-type:text/htmlContent-length:39725426
       3、请求正文 (注意与请求头之间有个空行) xxxxxx 

    手写服务器:

  • 相关阅读:
    批量新增百万条数据 十百万条数据
    sqlserver 组内排序
    EF ++属性会更新实体
    Entity Framework Core: A second operation started on this context before a previous operation completed
    abp Cannot access a disposed object. A common cause of this error is disposing
    abp xunit Can not register IHostingEnvironment. It should be a non-abstract class. If not, it should be registered before.”
    hangfire enqueued but not processing(hangfire 定时任务入队列但不执行)
    EF 更新实体 The instance of entity type 'BabyEvent' cannot be tracked because another instance
    datatable to entiy list 不支持可空类型和枚举类型
    webapi 设置不显示接口到swaggerUI
  • 原文地址:https://www.cnblogs.com/skyline1/p/11252326.html
Copyright © 2011-2022 走看看