非常关注!!
我也想用这个方法调用servlet,是不是这个方法调用Servlet比远程调用EJB效率更高呢?

解决方案 »

  1.   

    使用URL("http://www....")就可以啊
      

  2.   

    URL url= new URL(wgUrl);
          URLConnection uc = url.openConnection();
          uc.setDoOutput(true);
          uc.setRequestProperty("Content-Type", "application/octet-stream");
          //send http request
          OutputStream out = uc.getOutputStream();
          out.write(mrp, 0, numberOfBytesToWrite);
          out.flush();
          out.close();
      

  3.   

    怎么样取到servlet返回的结果?
    有没有完整的例子啊...
      

  4.   

    同意woowindice(黑山老妖) ,用URLConnection是最实际的选择。取得Serverlet的返回结果只需:
      InputStream in=uc.getInputStream();
    读取输入流中的数据即可。