1
儘管HttpComponents documentation說類有一個名爲INSTANCE
的靜態字段,但Eclipse告訴我這個問題沒有解決。Eclipse是說一個類的靜態字段無法解析
我試過我所知道的一切(檢查版本,重建代碼等),但沒有讓它消失。 有誰知道可能會導致這個問題?
代碼是:
socket = serverSocket.accept();
DefaultBHttpServerConnectionFactory connFactory = DefaultBHttpServerConnectionFactory.INSTANCE;
HttpServerConnection conn = connFactory.createConnection(socket);
ConnectionReuseStrategy connReuseStrat = DefaultConnectionReuseStrategy.INSTANCE;
HttpService httpService = new HttpService(httpproc, connReuseStrat, new DefaultHttpResponseFactory(), null, null);
HttpContext context = new BasicHttpContext(null);
httpService.handleRequest(conn, context);
確定是新的我會下載4.3並讓你知道發生了什麼... – CodyBugstein