zoukankan      html  css  js  c++  java
  • applet与SERLET交互...

    String SERVURL = "Dispatch";
    URL url;
    URLConnection connect;
    String ServletName;
    OutputStream outs;
    InputStream ins;
    boolean outOpened;
    boolean inOpened;
    ServletName = SERVURL;
    outOpened = false;
    inOpened = false;

    //open conn
    url = new URL(Config.ServURL, ServletName);
    connect = url.openConnection();
    connect.setDoInput(true);
    connect.setDoOutput(true);
    connect.setUseCaches(false); //for this one

    //send stream
    outs = connect.getOutputStream();
    outOpened = true;
    ObjectOutputStream out = new ObjectOutputStream(outs);
    out.flush();
    out.writeObject("request");
    out.writeObject(PubProp.getSessionId());
    out.writeObject(SendObjec);
    out.close();


    //reseiv
    if (!inOpened) {
    ins = connect.getInputStream();
    inOpened = true;
    }
    ObjectInputStream in = new ObjectInputStream(ins);
    ReciveObject obj = (GenericResponse) in.readObject();
    in.close();

    Powered by Zoundry

  • 相关阅读:
    视图
    Mysql事务
    子查询
    Mysql连表查询
    Mysql增删改查
    Mysql数据类型
    EntityFramwork 查询
    Git
    EntityFramework走马观花之CRUD(下)
    EntityFramework走马观花之CRUD(中)
  • 原文地址:https://www.cnblogs.com/attilax/p/15200075.html
Copyright © 2011-2022 走看看