If you are using Tomcat look in the logs on my machine Tomcat5.0/logs/localhost_log.2005-08-18.txt shows an exception was thrown. I have used the code you provided above to get the exception.
Sorry I can't explian why you get the line - I also get it!
Joined: May 15, 2005
hi,thx 4 your replies.
To Sergey Tyulkin: i used Tomcat 5.5 and the browser is IE 6.0
To Mat Williams: yes, i also found the "throw exception" record in the tomcat log files, thank u for pointing out that, but in my thought, the result on the web browser would also display the follows:
HTTP Status 500 - ---------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.IllegalStateException sp.Resser.doGet(Resser.java:82) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
i found the reason that the browser is blank is i called flushBuffer() before throw an exception.
will show the exception's details on the browser and record it in the blog files, but
will not show anything on browser. Why?What's the mechainism of the servlet output stream to do this? Maybe it's another question and i should post it as a new topic, but i think it is related to the old one. thax.
Joined: May 10, 2005
When you call sendError(), you automatically close the response, and all data, passed after sendError() is ignored. To show 404 page i think you should define <error-page> element in DD with 404 eror-code.