寫好jnlp,裡面配置好所依賴的jar的路徑

解决方案 »

  1.   

    直接运行那个JAR就可以,WEB START 和WIN FORM差不多.
      

  2.   

    我配置了自己的jsp服务器  诚招jsp虚拟空间代理商  如果有兴趣可以加qq254672366
      

  3.   

    当然可以了,你可以用java.net里面的HttpURLConnection类去连接servlet,并得到返回结果,可以将传输的东西封装为java对象。
    HttpURLConnection connection = null; try {
                               URL serveletURL = new URL(你的url);
    connection = (HttpURLConnection) businessServeletURL.openConnection();
    connection.setDoOutput(true);
    connection.setUseCaches(false);
    connection.setRequestProperty("Content-Type", "applicaiton/x-java-serialized-object");//可以传输POJO
    ObjectOutputStream oos = new ObjectOutputStream(connection.getOutputStream());
    oos.writeObject(dto);
    oos.flush();
    oos.close();
    } catch (Exception e) {
    e.printStackTrace();
    }
    ObjectInputStream ois = new ObjectInputStream(connection.getInputStream());
    int status = connection.getResponseCode();
    if (status >= HttpURLConnection.HTTP_OK &&
                    status <= HttpURLConnection.HTTP_MULT_CHOICE) {
    Object obj = ois.readObject();
    return obj;
    } else {
    错误处理 }
    } catch (IOException e) {
    e.printStackTrace(); } catch (ClassNotFoundException e) {
    e.printStackTrace();
    }
    大概的意思就是这样,catch、finally可能有点问题,你把这玩意写出一个通用类在客户端就行了。
    在servlet的doget和dopost里面            ObjectInputStream ois = new ObjectInputStream(request.getInputStream());然后进行处理            ObjectOutputStream os = new ObjectOutputStream(response.getOutputStream());
    os.writeObject(你要发送的对象);
    就可以了