You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are calling a Grails servlet from another servlet to handle some URLs in a backwards compatible way.
So basically we have:
object:HttpServlet() {
overridefundoGet(req:HttpServletRequest, resp:HttpServletResponse) {
val dispatcher = grailsContext.servletContext.getRequestDispatcher(<some logic>)
// Forward to some other path in Grails
dispatcher.forward(req, resp)
}
}
I agree this is probably a very uncommon usecase but for us it is the only way.
After dispatcher.forward(...) the RequestContextHolder should always be empty again, right?
Actual Behaviour
Actually, GrailsWebRequestFilter incorrectly doesn't reset RequetContextHolder if the request is an include or forward.
Why? I don't think there really is a reason, it is just a else that was never written.
Expected Behavior
We are calling a Grails servlet from another servlet to handle some URLs in a backwards compatible way.
So basically we have:
I agree this is probably a very uncommon usecase but for us it is the only way.
After
dispatcher.forward(...)
theRequestContextHolder
should always be empty again, right?Actual Behaviour
Actually,
GrailsWebRequestFilter
incorrectly doesn't resetRequetContextHolder
if the request is an include or forward.Why? I don't think there really is a reason, it is just a
else
that was never written.The code currently is:
I think it should be:
Reason: We must ALWAYS reset the world to how we found it before. So either reset the previous or clear it.
Steps To Reproduce
No response
Environment Information
No response
Example Application
No response
Version
Latest
The text was updated successfully, but these errors were encountered: