• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

url validation problem

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wonder if someone could lend me a hand.
In the following snippit of code I want to validate that I have connected to the correct URL. How can I do this.

Hope someone can help me out as I fail to find away but feel that you must be able to do this.
Thanks in advance
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this should solve your problem
try
{
URLConnection uc = u.openConnection();
}
catch(IOEXception e)
{
}
if an exception is caught then you could not open the connection
aditya

Originally posted by Eric Howell:
[B]I wonder if someone could lend me a hand.
In the following snippit of code I want to validate that I have connected to the correct URL. How can I do this.

Hope someone can help me out as I fail to find away but feel that you must be able to do this.
Thanks in advance
[/B]


 
Always look on the bright side of life. At least this ad is really tiny:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic