> > So, I have set up an error-page directive in my web.xml file to tell
> > tomcat that it needs to do something special for 404s.  Tomcat is then
> > sending a response code of 200 and the 404.html file, rather than a
> > response code of 404 and the html file.
> >
> 
> That is the correct behavior, from my understanding.  Declaring an
> <error-page> is telling the container to "use this page *instead* of what
> you would normally do".  And, because your "/404.html" page actually
> exists, a 200 is the correct status for that.
> 
> > For my particular case it happens to be important what the response
> > code is, because it isn't a browser that is requesting the file.  It is
> > a program that does something special if it gets a 404 as opposed to a
> > 200.  So, it needs to be a 404.  (for those that are curious, the
> > 'program' is a JVM; when running an applet it will try to request class
> > files from the server; if it gets a 404 it knows that it can't find the
> > class.  If it gets a 200, it thinks that the html file is the binary of
> > the class file and gets really confused.)
> >
> > Hope this helps make it more clear.
> >
> 
> Why not just remove your <error-page> declaration?  Then, Tomcat will
> return a "real" 404 status?

That's what I've actually done for now.  However, it would be more
asthetically pleasing to have a special 404 page..  That's the only
real reason.  Not a huge deal.. Just trying to figure out how things
are acting.

FYI (I just thought to check this),

Apache (1.3.19, anyway), when using the

ErrorDocument 404 /nothere.html

configuration directive, logs an access_log of:

127.0.0.1 - - [07/Jan/2002:11:47:10 -0600] "GET /asdf HTTP/1.0" 404 33   

(and displays /nothere.html, which is 33 bytes long)


-- 

Kirby Vandivort                      Theoretical Biophysics Group
Email: [EMAIL PROTECTED]          3051 Beckman Institute
http://www.ks.uiuc.edu/~kvandivo/    University of Illinois
Phone: (217) 244-5711                405 N. Mathews Ave
Fax  : (217) 244-6078                Urbana, IL  61801, USA

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to