Hello,
My investigation of why my error messages (in request) are getting lost during redirect, leads me to suspect that the request attribute restore code may not be working as desired. Of course, I may have totally misunderstood it J. The way the code restores the request attributes is by copying them into session attribute "_REQ_ATTR_MAP_". These attributes are put back into request after redirection in two places, ContextFilter.java (130) and RequestHandler.java (295). When a user request a url that will result in redirection, the traced steps are as follows: 1. ContextFilter (130), session attribute "_REQ_ATTR_MAP_" is null 2. Code stores request attributes to session attribute "_REQ_ATTR_MAP_" before calling response.sendRedirect 3. RequestHandler (295), session attribute "_REQ_ATTR_MAP_" contains all attributes 4. Attributes are copied to request object correctly and session attribute "_REQ_ATTR_MAP_" is set to null 5. ContextFilter (130), session attribute "_REQ_ATTR_MAP_" is null and request object does not contain any attributes copied in step 4. 6. RequestHandler (295), session attribute "_REQ_ATTR_MAP_" contains all attributes and request object does not contain any attributes copied in step 4. As seen from steps 5 and 6, all request attributes copied in step 4 are lost. I would appreciate any help in resolving it. Thanks in advance. Regards, Vinay Agarwal |
How do I replicate this bug you are reporting?
I am hoping that might solve the "Service invocation error: commit transaction failed" error messages as well, by the way, so I'd be happy to look through this with you. Si On Jul 21, 2006, at 10:13 AM, Vinay Agarwal wrote: > Hello, > > > > My investigation of why my error messages (in request) are getting > lost > during redirect, leads me to suspect that the request attribute > restore code > may not be working as desired. Of course, I may have totally > misunderstood > it J. > > > > The way the code restores the request attributes is by copying them > into > session attribute "_REQ_ATTR_MAP_". These attributes are put back into > request after redirection in two places, ContextFilter.java (130) and > RequestHandler.java (295). > > > > When a user request a url that will result in redirection, the > traced steps > are as follows: > > 1. ContextFilter (130), session attribute "_REQ_ATTR_MAP_" > is null > > 2. Code stores request attributes to session attribute > "_REQ_ATTR_MAP_" > before calling response.sendRedirect > > 3. RequestHandler (295), session attribute "_REQ_ATTR_MAP_" > contains > all attributes > > 4. Attributes are copied to request object correctly and session > attribute "_REQ_ATTR_MAP_" is set to null > > 5. ContextFilter (130), session attribute "_REQ_ATTR_MAP_" > is null > and request object does not contain any attributes copied in step 4. > > 6. RequestHandler (295), session attribute "_REQ_ATTR_MAP_" > contains > all attributes and request object does not contain any attributes > copied in > step 4. > > > > As seen from steps 5 and 6, all request attributes copied in step 4 > are > lost. I would appreciate any help in resolving it. Thanks in advance. > > > > Regards, > > Vinay Agarwal > > > |
Si,
I haven't yet thought of a way to see the attributes getting lost in the SVN code. I was able to see it in my code because I used redirect and forced an error which wasn't displayed. Ordermgr quickship uses redirect which might show this problem also. Anyway, I tried the obvious solution (commenting out the restore attribute code in RequestHandler.java) and it does show the error that I wasn't able to see before. I don't yet know if it breaks anything. Regards, Vinay Agarwal -----Original Message----- From: Si Chen [mailto:[hidden email]] Sent: Friday, July 21, 2006 10:17 AM To: [hidden email] Subject: Re: Redirect: Restoring Request Attributes How do I replicate this bug you are reporting? I am hoping that might solve the "Service invocation error: commit transaction failed" error messages as well, by the way, so I'd be happy to look through this with you. Si On Jul 21, 2006, at 10:13 AM, Vinay Agarwal wrote: > Hello, > > > > My investigation of why my error messages (in request) are getting > lost during redirect, leads me to suspect that the request attribute > restore code may not be working as desired. Of course, I may have > totally misunderstood it J. > > > > The way the code restores the request attributes is by copying them > into session attribute "_REQ_ATTR_MAP_". These attributes are put back > into request after redirection in two places, ContextFilter.java (130) > and RequestHandler.java (295). > > > > When a user request a url that will result in redirection, the traced > steps are as follows: > > 1. ContextFilter (130), session attribute "_REQ_ATTR_MAP_" > is null > > 2. Code stores request attributes to session attribute > "_REQ_ATTR_MAP_" > before calling response.sendRedirect > > 3. RequestHandler (295), session attribute "_REQ_ATTR_MAP_" > contains > all attributes > > 4. Attributes are copied to request object correctly and session > attribute "_REQ_ATTR_MAP_" is set to null > > 5. ContextFilter (130), session attribute "_REQ_ATTR_MAP_" > is null > and request object does not contain any attributes copied in step 4. > > 6. RequestHandler (295), session attribute "_REQ_ATTR_MAP_" > contains > all attributes and request object does not contain any attributes > copied in step 4. > > > > As seen from steps 5 and 6, all request attributes copied in step 4 > are lost. I would appreciate any help in resolving it. Thanks in > advance. > > > > Regards, > > Vinay Agarwal > > > |
In reply to this post by Si Chen-2
Ok, do you have a simplified version of what you're using so we could
replicate it? Si On Jul 21, 2006, at 11:25 AM, Vinay Agarwal wrote: > error which wasn't displayed. Ordermgr quickship uses redirect > which might |
Si, David,
After further investigation, the issue I was facing (of lost request attributes) is a side effect of calling response.sendRedirect from within the event handler. This does not happen when the requests are chained. In this light, how dangerous is calling the sendRedirect from event handler? Is it likely to cause a lot of problems? Regards, Vinay Agarwal -----Original Message----- From: Si Chen [mailto:[hidden email]] Sent: Friday, July 21, 2006 11:31 AM To: [hidden email] Subject: Re: Redirect: Restoring Request Attributes Ok, do you have a simplified version of what you're using so we could replicate it? Si On Jul 21, 2006, at 11:25 AM, Vinay Agarwal wrote: > error which wasn't displayed. Ordermgr quickship uses redirect which > might |
Free forum by Nabble | Edit this page |