用xmlhttp,你网上查,有很多资料

解决方案 »

  1.   

    在Java环境里,用java.net就很棒了。
    xmlhttp是微软东西,不能跨平台,而且是本地activex代码,调起来麻烦。
      

  2.   

    可是用java.net怎么实现啊...?等ing..
      

  3.   

    public void GetwayPostxml(String xmllir)throws Exception {    url = new URL(rc.getgateway_host()+":"+rc.getgateway_port() );    HttpURLConnection connection = (HttpURLConnection) url.openConnection() ;
          connection.setRequestMethod("POST");
          connection.setDoOutput(true);
          PrintWriter out = new PrintWriter(connection.getOutputStream());      // send the encoded message
          out.println(URLEncoder.encode(xmllir, "UTF-8"));
          out.close();
    //      System.out.println(xmllir);
          if(connection.getResponseCode()!=200)
            System.out .println(connection.getResponseCode()+connection.getResponseMessage() );      BufferedReader in
              = new BufferedReader(new InputStreamReader(connection.getInputStream()));
          String line;
          FileWriter fr = new FileWriter("TEMP/ll.XML");
          BufferedWriter bfr = new BufferedWriter(fr);
          while ((line = in.readLine()) != null) {
              bfr.write(line);
          }
          bfr.close() ;
          File fi = new File("TEMP/ll.XML");
          liap.saxDoc(this.conn ,fi, System.out );
          in.close();
      }这是我的实现类,帮忙看一下了...