• Post Reply Bookmark Topic Watch Topic
  • New Topic

validating URL without using exception

 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i would like to validate user entries against URL specification.

i could (somehow) abuse the MalformedURLException, like following:


but i generally don't like to use exceptions for validations.


does there exist an alternative (inside j2se api), which checks urls with the same signature -> public static boolean isWellFormedURL(String url);

thanks.
[ October 12, 2006: Message edited by: manuel aldana ]
 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i stopped searching, maybe it is senseful to include jakarta commons validation api...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!