apache mina对http支持力度不够,apache mina作者的另外一个开源项目asynweb 也因为年久了,不在更新。
本次测试使用httpclient 来模拟http请求, 使用apache mina作为web服务器。
httpclient测试代码:
/**
* This example demonstrates the recommended way of using API to make sure
* the underlying connection gets released back to the connection manager.
*/
public class ClientConnectionRelease {
public final static void main(String[] args) throws Exception {
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("http://localhost:8080");
// Execute HTTP request
System.out.println("executing request " + httpget.getURI());
HttpResponse response = httpclient.execute(httpget);
System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
System.out.println("---------