你可以考虑这样写:    String protocol = getCodeBase().getProtocol();
    int port = getCodeBase().getPort();
    String host = getCodeBase().getHost();
    try{
      URL url = new URL(protocol + "://" + host +":" + port +
                        "/systemservlet?command=start");      下同你的程序
    另外你的程序中,8080也没有引号呀!

解决方案 »

  1.   

    connect = (new URL("http://"+"localhost:"+8080+QueryString)).openConnection();
    改成connect = (new URL(getCodeBase()+QueryString)).openConnection();试试
      

  2.   


    String str ="http://"+"serverName:"+Port"/Servlet/receiveservlet?message="+message;URL url = new URL(str);this.appletMe.getAppletContext().showDocument(url, "_self");