Right...a better method than checking the content length would be to create
a JSP page that simply outputs a status string such as "Application OK" or
whatever.  Then look for that string in the content that comes back.  Just
checking for content to come back doesn't tell you that everything is OK, as
Ralph pointed out.  An error page will have a content lenght greater then -1
or greater than zero.

John Turner
[EMAIL PROTECTED]


-----Original Message-----
From: Ralph Einfeldt [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 9:25 AM
To: Tomcat Users List
Subject: AW: How to detect whether Tomcat is running?


If you don't change it, the jsp engine always sends content 
length = -1, as it don't knows how long the output will 
get at the time it creates the header. So it is better to 
read the stream and parse the result for the status code.

Note taht the content length may be > -1 if an error happens 
because tomcat or the web server might reply with an error 
page.

> -----Ursprüngliche Nachricht-----
> Von: Jack Li [mailto:[EMAIL PROTECTED]]
> Gesendet: Montag, 8. Juli 2002 15:01
> An: '[EMAIL PROTECTED]'
> Betreff: How to detect whether Tomcat is running?
> 
> 
> I need to detect the Tomcat status on a production server. I 
> was trying to run a detecting program on the development 
> server. If Tomcat is down on the production sever, I would 
> get an email.

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to