httpclient、http-commonsなどのサードパーティAPIを使用せずにhttp接続プールを実行する方法はJavaにありますか?
私の場合、特定のサーブレットのURLで接続を開きたいのですが、クエリ文字列が変更されますが、接続を開くたびに、'netstat -anp | 私が欲しくないgrepportno'?
String sendMessageUrl="http\://ip\:portno/contextpath/servlet/Servletname?parameter1\=¶meter2\=";
URL testURl=new URL(sendMessageUrl.replaceAll("&", name+"&")+surname);
HttpURLConnection httpConnection=(HttpURLConnection)testURl.openConnection();
httpConnection.connect();
if(httpConnection.getResponseCode()==200)
{
System.out.println("Success");
}
ここでは、URL全体が同じままであることを除いて、parameter1とparameter2のみが変更されます。