10 Replies Latest reply on Sep 10, 2007 3:01 PM by 807605

    Url validation

      Hello everybody...

      There seems to be a serious problem...
      In the application I need to check out whether an user input a valid/invalid/unavailable URL.....

      When an user inputs say, http://www.yahoo.com
      It show the right result ... Valid URL

      But when an user input say www.yahoo.com
      It show the result ... Invalid URL.

      It means it needs the http:// to be included with the www,

      What should I do so that an user need not enter the whole of http://www.yahoo.com but just www.yahoo.com

      The code which I used was:
                        new URL(url).openStream().close();
                        // good
                   catch (MalformedURLException ex) 
                        // invalid
                   catch (IOException ex) 
      Please help me.