File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to use the OpenConnection()

 
von rodrig
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to write a servlet that will check to see if an url exist and if exist display the page if it does not exist display an error message. Also, if the page give a 404 error code they need to be redirected. How do I do this? Need help!!!
 
Bonnie Beach-Morin
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use an HttpURLConnection and call the getResponseCode().
You can do something like this:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic