标签:
个人是个实践型人员,所以打算看着jetty源码,从头开始组装Jetty。
首先从github.com里找到jetty-project项目,用git下载源码,本文以9.3.x为例。
首先Jetty作为一个web server,必然需要支持HTTP。
查看Jetty-http项目下http包下一共有下列几个类:
接口: HttpContent HttpFieldPreEncoder HttpParser.HttpHandler HttpParser.RequestHandler HttpParser.ResponseHandler HttpTokens 类: DateGenerator DateParser HttpPostHttpField Http1FieldPreEncoder HttpCookie HttpField HttpField.IntValueHttpField HttpField.LongValueHttpField HttpFields HttpGenerator HttpParser HttpStatus HttpURI MetaData MetaData.Request MetaData.Response MimeTypes PathMap PathMap.MappedEntry PathMap.PathSet PreEncodedHttpField ResourceHttpContent 枚举类: HttpGenerator.Result HttpGenerator.State HttpHeader HttpHeaderValue HttpMethod HttpParser.State HttpScheme HttpStatus.Code HttpTokens.EndOfContent HttpVersion MimeTypes.Type 异常类: BadMessageException
上述类里,需要关注的有下面几个基础类,分别进行解说。
Http协议由请求消息和响应消息组成,其中请求消息由请求行、首部行、空行、实体主体组成;而响应消息由状态行、首部行、空行、实体主体组成。围绕这些我们需要研究的类有...。
标签:
原文地址:http://my.oschina.net/daidetian/blog/515902