jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes Trying to use the OpenConnection() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Trying to use the OpenConnection()" Watch "Trying to use the OpenConnection()" New topic

Trying to use the OpenConnection()

von rodrig

Joined: Jun 28, 2002
Posts: 2
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

Joined: Jun 13, 2002
Posts: 13
Use an HttpURLConnection and call the getResponseCode().
You can do something like this:

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Trying to use the OpenConnection()
It's not a secret anymore!