The WIA book says:
Setting an HTTP status code:
If you want to set an HTTP status code for your page, such as 404 (not
found), you
can do so by overriding the page’s setHeaders method:
@Override
protected void setHeaders(WebResponse response) {
response.getHttpServletResponse().setStatus(
HttpServletResponse.SC_NOT_FOUND);
super.setHeaders(response);
}
Alternatively, you can throw an AbortWithWebErrorCodeException and
provide it
with the appropriate error code and an optional message.
Stefan Lindner wrote:
I try to create a watchdog page for our site. My idea was to check the
neccessary resources and respond with a 500 error in case of failure.
So I placed
getWebRequestCycle().getWebResponse().getHttpServletResponse().setStatus
(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
in the page constructor and in onAfterRender but the page is displayed
correctly, no 500 error shown in browser.
Any idea?
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]