Hi, Without going into excessive detail, I wanted to point out two things: 1. This sort of thing is widely available: http://www.google.com/search?sourceid=navclient&q=showing+a+please+wait+ page+java. I even see a Matt Raible solution on the search result list, so I'd be inclined to try that one first ;) 2. One of the reasons this is failing is because you're mucking with the request processor threading model imposed by the ServletSpec. A lot of things depend on the request being served by one thread, so when you launch yours to handle things, you're at risk of seeing indeterminate behavior. And hey, that's what you're seeing, what a coincidence ;)
Yoav Shapira Millennium Research Informatics >-----Original Message----- >From: Phillip Rhodes [mailto:[EMAIL PROTECTED] >Sent: Tuesday, April 13, 2004 1:22 AM >To: [EMAIL PROTECTED] >Subject: ApplicationHttpRequest not using HttpServletRequestWrapper problem > >I wrote a really neat servlet filter that I will release open source. >What it does is allow any servlet or jsp that "runs long" to be >intercepted and display a "processing your request" page to the user while >the request is processing on the server. > >The filter intercepts a request, wrappers the response and request and >kicks off the request in a different thread. The filter will immediately >return to the client browser with a "wait page" that will periodically >poll the working thread to see if the long running request is done. > >However, things are not working as I planned. I have been testing it >thoroughly and the wrapped response is fine. All my code works correctly >if I just "block" the request. By "block" i mean, I don't respond to the >request to the client until the jsp, servlet or whatever completes the >chain processing. > >It seems that the ApplicationHttpRequest is not calling my subclass of >HttpServletRequestWrapper. I declared a "getAttributeNames" method in my >RequestWrapper, but it is not invoked. Instead Tomcat is calling the >getAttributeNames method on the ORIGINAL request object. This also >happens to be the same request object that I returned from already >(substituting a wait page for the actual expected content). I *think* >that when I respond to the request, tomcat invalidates it. Unfortunately, >the request is still being processed, just in a different thread. > >I threw the war file on at server of mine (tomcat 4.1.27) so you can check >it out and see it in action. >All source is here >http://test.rhoderunner.com/longrequest/ > >What I am looking for is some advice on how to solve this problem. I am >almost totally out of ideas on how to solve this one. >Thanks. > >Here is a stacktrace from Tomcat 4.1.30 > >java.lang.NullPointerException > at >org.apache.coyote.tomcat4.CoyoteRequestFacade.getAttributeNames(CoyoteR eque >stFacade.java:142) > at >org.apache.catalina.core.ApplicationHttpRequest.setRequest(ApplicationH ttpR >equest.java:512) > at >org.apache.catalina.core.ApplicationHttpRequest.<init>(ApplicationHttpR eque >st.java:125) > at >org.apache.catalina.core.ApplicationDispatcher.wrapRequest(ApplicationD ispa >tcher.java:921) > at >org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis patc >her.java:547) > at >org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa tche >r.java:498) > at >org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]