I've solved similar problem by creating my own request object which provides all methods the other parts of the system are using. Then I changed all the reference to HttpServletRequest to my own request object. This can be done easily by changing HttpServletRequest to MyRequest in the method signature. When I receive a HTTP request, I use the HttpServletRequest to instantiate my request object and pass it to the others. Therefore, I can trap all the method calls to the HttpServletRequest and decide what to do under different situations. Usually, it just needs to call the corresponding method from the original servlet request object. However, this approach requires that you CAN change the method signature in all places. If this is not the case, then your request object needs to implement the HttpServletRequest interface.
Derek > -----Original Message----- > From: Breivik Ivar [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 17, 2003 8:17 AM > To: jdjlist > Subject: [jdjlist] RE: Servlet Request Timeout Handling > > > Yes, we are already doing that with some of the attributes of > the request. > But the problem is when we want to execute the second request > like it was > the first one, and not all information can be "restored into" a > HttpServletRequest. > > Our application and the framework that we're using uses the > HttpServletRequest in several places, and we don't want the > application to > worry about where to get the needed information from, but just use the > HttpServletRequest like today. > > Mvh, > Ivar Breivik > > > -----Original Message----- > From: James Stauffer [mailto:[EMAIL PROTECTED]] > Sent: 17. februar 2003 16:57 > To: jdjlist > Subject: [jdjlist] RE: Servlet Request Timeout Handling > > > Can you extract the needed information from the original > request and save > just that? > > James Stauffer > > > -----Original Message----- > From: Breivik Ivar [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 17, 2003 9:25 AM > To: jdjlist > Subject: [jdjlist] Servlet Request Timeout Handling > > > We have an J2EE application which requires the user to login. > This login is > done by accessing a backend system. After a certain time the > backend system > requires the user to login again, also called a timeout > situation. When the > user has logged in again, we want to execute the original > request that the > user tried to do before the timeout situation was known. This > is so the user > can continue where he was interrupted. Although it works with > BEA WebLogic > Server, saving the HttpServletRequest on the associated HttpSession is > illegal according to the Servlet Specification. It also does > not work in > with IBM WebSphere, which is our production environment. > > So, is there a way to save the HttpServletRequest (or some of it's > information) and use it later? Is it possible to (re)construct the old > HttpServletRequest and replace it with the current one? Can the > HttpServletRequestWrapper class be used to achieve something similar? > > Any comments and experience on this issue are welcome. Thanks. > > Regards, > Ivar Breivik > > > --- > You are currently subscribed to jdjlist as: [EMAIL PROTECTED] > To unsubscribe send a blank email to > [EMAIL PROTECTED] > > --- > You are currently subscribed to jdjlist as: [EMAIL PROTECTED] > To unsubscribe send a blank email to > [EMAIL PROTECTED] > > --- > You are currently subscribed to jdjlist as: [EMAIL PROTECTED] > To unsubscribe send a blank email to > [EMAIL PROTECTED] > --- You are currently subscribed to jdjlist as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
