I think you might be interested in WebResponse#setStatus(int):
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/request/h
ttp/WebResponse.html#setStatus%28int%29

As an example see:
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/markup/ht
ml/pages/AccessDeniedPage.html

And its source code as part of the wicket-core module:
https://github.com/apache/wicket/blob/build/wicket-6.9.0/wicket-core/src/mai
n/java/org/apache/wicket/markup/html/pages/AccessDeniedPage.java

Or simply pull up its call hierarchy in your IDE.

~ Thank you,
  Paul Bors

-----Original Message-----
From: Martin Funk [mailto:[email protected]] 
Sent: Tuesday, July 02, 2013 9:59 AM
To: [email protected]
Subject: Save place to set http response status?

Hi there,

what is the best place to set http response state?

I was trying the 'onSomething' callback methods in IRequestCycleListener
Like onEndRequest

But sometimes those get ignored

The last save place I figured was onAfterRender in the page class, but this
doesn't feel right.

The reason that calls like:
((HttpServletResponse)
RequestCycle.get().getResponse().getContainerResponse()).setStatus(404);
in the RequestCycle Listner are ignored seems to be that the underlying
container, Tomcat 6.0.37 in our case, starts to flush the outputstream as
the Response becomes big, as in maybe 20k.

If the response is small enoug the status, can be set up to  'onDetach()'

Anyone any ideas?

Martin
---------------------------------------------------------------------
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]

Reply via email to