!!!Javaオブジェクト双方向通信 {{category SourceCode,"Java",nolink}}HttpURLConnection と HttpServlet を利用した、オブジェクトの双方向通信例です。 !!!サーブレット側 {{ref_code InteractiveCommunicationServlet.java:utf8,,Java,4}} !!!クライアント側 {{ref_code InteractiveCommunicationClient.java:utf8,,Java,4}} !!!呼び出し例 {{code Java,4,0, /** * アプリケーションメイン. * @param args * @throws Exception */ public static void main(String[] args) throws Exception { URL url = new URL("http://127.0.0.1:8080/ServletTest/ObjSend"); //URL url = new URL("https://127.0.0.1:8443/ServletTest/ObjSend"); //String keystore = "C:/ServletTest/keystore"; //String storepass = "password"; InteractiveCommunicationClient client = new InteractiveCommunicationClient(url, true); //client.loadTrusts(new java.io.FileInputStream(keystore), storepass); String str = (String)client.execute("オブジェクト双方向通信"); System.out.println("result:" + str); } }}