URL class handling problem .....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    URL class handling problem .....

    Hi friends .. today i started to learn URL class handling.
    actually today morning JOASH replied to an answer that using URL an input stream can be opened.
    a diiferent server side file can be accessed from another server.

    so i started ... a fantastic idea .... frnds.

    but i have a problem with my code ....

    import java.net.*;
    import java.io.*;

    class URLTest
    {
    public static void main(String args[]) throws Exception
    {
    URL l_url = new URL("http://www.thescripts. com/forum/forum130.html") ;
    BufferedInputSt ream l_file = new BufferedInputSt ream(l_url.open Stream());
    int ch;
    while((ch = l_file.read()) != -1) System.out.prin tln(ch);

    System.out.prin tln("\n\n\nYaho o ......");
    }
    }
    now read carefully my problems what i faced .....

    here an exception thrown is ..... UNKNOWN HOST EXCEPTION ... thescripts.
    why???

    if i modify the URL as
    https://172.20.0.200/CoalNetPROD/common/jsp/login.jsp

    actually it is our server where i m working .....here HTTPS used
    here it tells that ... unknown URL specification HTTPS.
    why???

    plz tell me the URL class story ... when openStream method is called...
    plz help guys....

    kind regards.
    dmjpro.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    The code snippet you supplied works fine for me; I'm afraid you're dealing with
    firewalls or dns problems.

    kind regards,

    Jos

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      how can i solve these problems???

      plz help.

      kind regards.
      dmjpro.

      Comment

      Working...