Closed Bug 376336 Opened 19 years ago Closed 19 years ago

Not able to show 404 Page Not Found error

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: anupam_n, Unassigned)

Details

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) Build Identifier: Firefox 2.0 In my web application in the response header I am setting the status as SC_NOT_FOUND. In IE i am able to see the 404 Page not found error but in FIREFOX it is showing me a blank WHITE page. Reproducible: Always Steps to Reproduce: 1.set response header status as SC_NOT_FOUND 2. 3. Actual Results: Does FireFox supports 404 page not found error page. Please let me know by email what can be done regarding this.
As I recall firefox displays 404 error pages just like any other pages, so if you aren't sending anything to display, nothing will be displayed. IE on the other hand can override any 404 page sent with its own custom error page in certain situations.
Component: Error Console → General
QA Contact: javascript.console → general
A demonstration URL would be quite useful here.
Cant give you teh URL as it is my own web application.... But i am sending SC_NOT_FOUND in the response.SetHeader(status).. IE is showing that
then what i need to send to firefox to show 404 pagenot found error
You need to send the page that you want Firefox to display.
I want to show the same 404 error shown by IE thats the requirement I am facing ....
Without an example URL that demonstrates this issue I can't look into this issue further. My suspicion is that you are setting the 404 error code and returning a blank page which will cause IE to display one of its internal error pages. The same simply isn't true of Firefox, you must return an appropriate page for it to display.
If I am getting the data of PDF from backend I am setting the following things into response response.setStatus(HttpServletResponse.SC_OK); response.setHeader(HEADER_EXPIRES, VALUE_EXPIRES_NO_CACHE); response.setHeader(HEADER_CACHE_CONTROL, VALUE_CACHE_CONTROL_MUST_REVAL); response.setHeader(HEADER_PRAGMA, VALUE_PRAGMA_PUBLIC); response.setContentType(application/pdf); response.setContentLength(10000); response.setHeader(content-disposition,"inline;filename ="+name); and if I am not getting teh PDF I want to show 404 error so i am doing the following response.setStatus(HttpServletResponse.SC_NOT_FOUND); response.setHeader(HEADER_EXPIRES, VALUE_EXPIRES_NO_CACHE); response.setHeader(HEADER_CACHE_CONTROL, VALUE_CACHE_CONTROL_MUST_REVAL); response.setHeader(HEADER_PRAGMA, VALUE_PRAGMA_PUBLIC); response.setContentType(text/html); response.setContentLength(-1); response.setHeader(content-disposition,"inline;filename ="+name); So here I am getting the 404 page in IE but a blank page in FIREFOX. So what I have to do to show the 404 page not founf erro in FIREFOX. isnt there any internal page for 404 in FIREFOX. In this mainly SC_NOT_FOUND is responsible to show 404 error in IE.What I have to do in FIREFOX in order to avoid the white blank page?
You are sending an empty page (hopefully your platform is correcting the content length to 0), so Firefox is displaying nothing. This would be the expected result. If you wish Firefox to display something you should send it the page to display.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
So what I have to do in code to send a page in FIREFOX ...to show 404 kind of a page....is there any different code in java ,....please let me know
Your example code shows that you know how to send content to the browser, you are doing it in the working case. This is not a web support forum, please seek help from forums for java servlets.
Hello Dave, i know that it is not a web support forum....the problem I am facing is with FIREFOX...as I am able to see page in IE and not in FIREFOX from that i have taken conclusion that it is bug with FIREFOX. as in the code you can see I have set all the reponse header and the reply from you previously that I have to show the page exclusively... so i want to how can this be done....I hope you are understanding the problem....
You need to log in before you can comment on or make changes to this bug.