OK, when setting an error status (httpServletResponse.sendError(errorCode)), the container will try to resolve that in that call itself. This will result in a second wicket call in the same thread. Because of that we will clean all thread locals like RequestCycle and Application. I do reset those now to the previous values.
The problem is that we have more thread locals which also could be affected. Like Sessions thread locals (dirty pages) Also the RequestContext for our portlet support how to handle that?
We need to look at this in a next release a bit more (1.4)
So for the most part this is fixed (if not everything) for the next 1.3.x release.
Ate: can you quickly look at this code in WicketFilter:
// unset the application thread local if it didn't exist already.
if (previous == null)
You see i dont do anything with RequestContext when the previous app was there..
Can i do that? Or is this not an issue at all in portlets?
Reassign to me when you have looked at it.