Hi All ,
I am writing a Java Application to find out if my website is up and running.
I am trying to do this by opening an HttpURLConnection to the specified URL
and then trying to read the properties from it.
When my website is up and running, getResponseCode() method of
HttpURLConnection returns 200 and getResponseMessage() returns OK, thereby
confirming that requested page is available. However, the getContentLength()
method returns -1, no content is available. My website has been implemented
using JSP and Tomcat.

I would like to know :
1) Why does getContentLength() return -1 when the page is available?
2) Is getting a status code of 200 enough of an indicator that my site is up
or do I need to recover some content as well for confirming that?
3) Is there any other, more reliable method for achieving the purpose?

Thanks in Advance

Sudhanshu

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to