1

Why I am getting no protocol if i have http in the url path?

Log:

network: Connecting http://xxx.ccc.local/upload/up.php?aa=0&bb=Ap%F3lice+de+Seguro&cc=1028&from=documentos with cookie "CLinkLanguage=en; __utma=232844939.1396040569.1356709687.1357294077.1357902500.12; __utmz=232844939.1356709687.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=232844939.24.10.1357902500; symfony=e0lpbkrcu0bidkpiujd1if4pt4; __utmc=232844939; CLinkLanguage=en; PHPSESSID=uv31kr1vpojvqgnc9ae9nda921"

Exception:

    java.net.MalformedURLException: no protocol: 
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)

html

 <APPLET  CODE = "wjhk.jupload.JUploadApplet" ARCHIVE = "upload/wjhk.jupload.jar" WIDTH = "600" HEIGHT = "400" MAYSCRIPT></XMP>
        <PARAM NAME = CODE VALUE = "wjhk.jupload.JUploadApplet" >
        <PARAM NAME = ARCHIVE VALUE = "upload/wjhk.jupload.jar" >
        <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.4">
        <PARAM NAME = "scriptable" VALUE="false">
        <PARAM NAME = "postURL" VALUE ="{$url}">
        <PARAM NAME = "anexosID" VALUE ="{$anexosID}">
        <PARAM NAME = "subanexosID" VALUE ="{$IdConsulta}">
        <PARAM NAME = "companyID" VALUE ="{$companyID}">
        <PARAM NAME = "resultURL" VALUE ="{$resultUrl}">
        <param name="debug" value="true">


    Java 1.4 or higher plugin required.

<APPLET  CODE = "wjhk.jupload.JUploadApplet" ARCHIVE = "upload/wjhk.jupload.jar" WIDTH = "600" HEIGHT = "400" MAYSCRIPT></XMP>
    <PARAM NAME = CODE VALUE = "wjhk.jupload.JUploadApplet" >
    <PARAM NAME = ARCHIVE VALUE = "upload/wjhk.jupload.jar" >
    <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.4">
    <PARAM NAME = "scriptable" VALUE="false">
    <PARAM NAME = "postURL" VALUE ="http://xxx.ccc.local/upload/up.php?aa=0&bb=Alvar%E1%2Ffg&cc=1028&from=documentos">
    <PARAM NAME = "anexosID" VALUE ="">
    <PARAM NAME = "subanexosID" VALUE ="">
    <PARAM NAME = "companyID" VALUE ="">
    <PARAM NAME = "resultURL" VALUE ="">
    <param name="debug" value="true">


Java 1.4 or higher plugin required.
</APPLET>
8
  • 2
    Show us the code and show us the exact value that you pass in to the URL constructor. Commented Jan 11, 2013 at 12:36
  • @JoachimSauer, question updated. Commented Jan 11, 2013 at 12:50
  • @Esailija, this is an applet, i don't have access to the source code. Commented Jan 11, 2013 at 12:51
  • @loops how are you giving this to the applet, show the html or javascript source code. The url passed to the URL constructor is an empty string. Commented Jan 11, 2013 at 12:52
  • Are you getting this error..... java.net.MalformedURLException: no protocol: {$VARS['HOST']}/upload/up.php?aa=0&bb=$idConsulta&cc=$COMPANYID&from=$from ........... Commented Jan 11, 2013 at 12:56

1 Answer 1

1

The value of the postURL parameter is a URL that can be parsed without exceptions, therefore the problem is somewhere else. What you can do:

  • Experiment with various applet parameters
  • Ask for support from the developers of the applet
  • If you don't have the source code of the applet, you can probably still decompile it, and find out how it works: Where can I find a Java decompiler?

The following program shows only that the postURL value is OK for Java:

public class A {
    public static void main(String[] args) throws MalformedURLException {
        String s = "http://xxx.ccc.local/upload/up.php?aa=0&bb=Alvar%E1%2Ffg&cc=1028&from=documentos";

        URL url = new URL(s);
        String protocol = url.getProtocol();
        System.out.println(String.format("A::main: protocol = '%s'", protocol));
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.