• Post Reply Bookmark Topic Watch Topic
  • New Topic

url validation problem  RSS feed

 
Eric Howell
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • 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
 
aditya mahajan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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]

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!