Using a request wrapper seems to submit two requests
Tuesday, 20. February 2007, 11:42:08
In a previous blog I described how to use a request wrapper to fool a J2EE application into believing that the user has logged in to the local login context even if they were actually authenticated using a remote service or some custom authentication method.
After having used this method for quite a while in the project I am working on, I happened upon a small snag. I was trying to put in some custom code for the prepare model stage of the ADF page lifecycle and I noticed that when a partial page rendering submit is executed, the custom code was called twice. The first time, all the page bindings were accessible and the second time, they weren't. I put in some extra debug output and managed to trace the source of the problem down to the request wrapper.
It seems that on a partial page render, the OC4J instance deals with the request using the custom request wrapper and then constructs an instance of EvermindHttpServletRequest (the OC4J internal implementation of HttpServletRequest) and submits that after the page has been rendered.
I've made a minimal example project (download here
), which uses HttpSerlvetRequestWrapper instead of a custom one which shows that it is simply a problem with the request being wrapped. The same thing occurs if you use a custom implementation of HttpServletRequest, rather than a wrapper.
So what I'm wondering is,
a. is it a bug?
b. if it isn't a bug, is there some way to stop it doing this?
PhantomLoad.zip
After having used this method for quite a while in the project I am working on, I happened upon a small snag. I was trying to put in some custom code for the prepare model stage of the ADF page lifecycle and I noticed that when a partial page rendering submit is executed, the custom code was called twice. The first time, all the page bindings were accessible and the second time, they weren't. I put in some extra debug output and managed to trace the source of the problem down to the request wrapper.
It seems that on a partial page render, the OC4J instance deals with the request using the custom request wrapper and then constructs an instance of EvermindHttpServletRequest (the OC4J internal implementation of HttpServletRequest) and submits that after the page has been rendered.
I've made a minimal example project (download here
), which uses HttpSerlvetRequestWrapper instead of a custom one which shows that it is simply a problem with the request being wrapped. The same thing occurs if you use a custom implementation of HttpServletRequest, rather than a wrapper.
So what I'm wondering is,
a. is it a bug?
b. if it isn't a bug, is there some way to stop it doing this?
PhantomLoad.zip









mike.ring # 28. June 2007, 21:10
dominionspy # 30. June 2007, 19:11
I still have a metalink service request and an associated bug open, but there hasn't seemed to be much progress on it.
From what you are saying, it sounds like a different problem to the one I'm having. Have you tried posting a message on the JDeveloper forums about it?