cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eisert, Wolfram" <Wolfram.Eis...@Dresdner-Bank.com>
Subject AW: [C2.0] 404 Error and Cocoon response
Date Fri, 23 Nov 2001 14:43:24 GMT
Hi,

sorry, but I've just seen that 
	res.setContentType(Notifier.notify(n, (OutputStream)null));
is there with intention to use the HTTP 404 error code instead
of a cocoon message.

In this case I think the HttpServletResponse method
	res.sendError(res.SC_NOT_FOUND)
should be used instead of
	res.setStatus(res.SC_NOT_FOUND)
because setStatus() is only intented for "non error" status codes.

I get the blank page whenever I enter an invalid http-adress in cocoon
(using IE 5.0). When using "sendError" I get a correct "NOT FOUND"
message.

Example "blank page":
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252"
http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>

Wolfram

-----Urspr—Ćngliche Nachricht-----
Von: Eisert, Wolfram [mailto:Wolfram.Eisert@Dresdner-Bank.com]
Gesendet am: Freitag, 23. November 2001 14:50
An: 'cocoon-dev@xml.apache.org'
Betreff: AW: [C2.0] 404 Error and Cocoon response

Hi,

I think this is because of an problem in CocoonServlet.java.

When catching "ResourceNotFoundException" in method service()
the error response is set via

	res.setContentType(Notifier.notify(n, (OutputStream)null));

but I think it should be

            res.setContentType(Notifier.notify(n,
(OutputStream)res.getOutputStream()));

Wolfram


-----Urspr—Ćngliche Nachricht-----
Von: Piroumian, Konstantin [mailto:KPiroumian@flagship.ru]
Gesendet am: Freitag, 23. November 2001 13:44
An: cocoon-dev@xml.apache.org
Betreff: Re: [C2.0] 404 Error and Cocoon response

> > >
> > > Hi all!
> > >
> > > I noticed that I get a blank page instead of 404 Error when
something's
> > > wrong in sitemap and the file could not be found. Long time ago Cocoon
> was
> > > giving an Exception, then it was changed to give a response: 404 File
> not
> > > found error. Now something's went wrong and the result is a blank
page.
> > >
> > > Do I miss something?
> > >
> > I just tested it - and got a shock as I did get a blank page, too, after
I
> > changed
> > the src attribute for a generator to a non existing xml document.
> > But then it hit me: The IE things he is clever and caches something of
the
> > first working response. After restarting the IE and invoking the same
> > URL I get the 404 as expected.
> > So, I hope you use the IE, too. Then try this.
> > If not, well - please give more information then.
>
> Yes, I use IE, so it must be the cache, but I couldn't check it cause I
> couldn't reproduce the blank page. All I remember is that the page was
> correct HTML without any content in the BODY. And I have seen a lot of
> messages in cocoon-users about the blank-page response.
> Couldn't it be a problem somewhere in Cocoon? Maybe with HTTP headers or
the
> cache?

Look at this quot from a cocoon-users list message. Maybe the problem
appears only with readers? I've been working with JSPReader when I was
getting blank pages.

<quot>
...
<map:match pattern="**.pdf">
    <map:read src="resources/pdf/{1}.pdf" mime-type="application/pdf"/>
    </map:match>
...
If the pdf file cannot be found, how do I redirect to an error page ??

I always get a blank page !

Thanks
Beat De Martin

</quot>

>
> >
> > Carsten
> >
> > > Best regards,
> > >
> > > Konstantin Piroumian
> > > Software engineer
> > >
> > > Protek Flagship LLC
> > > Phone: + 7 095 795 0520 (add. 1288)
> > > Fax: + 7 095 795 0525
> > > E-mail: kpiroumian@flagship.ru
> > > http://www.protek.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > > For additional commands, email: cocoon-dev-help@xml.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message