Chris Ward <[EMAIL PROTECTED]> writes: > Hi Nic, > > Just a question or two relating to the example you kindly provided > (below) > > In my application, I want to deliver an HTML report as the result of > calling the servlet. In the example I can't see anything being > output following the > > > String checkUrl = request.getServletPath(); > > out.println("<html><body><a href='" + checkUrl + "'>"); > > out.println("Check the call here"); > > out.println("</a></body></html>"); > > // The client sees a completed page from here > > out.close(); > > I assume the results are seen at "checkUrl" - which is the servlet > itself. > > This being the case, I guess there would be some conditional code > that inspects the session variable to check for completion before > your results are formatted and output. > > Something along the lines of > > if( session.statusVar == completed ) > { > format results and output with out.println() > } > else > { > still working, out the same "busy" page > } > > I suppose this would live in the goGet() method.
You got it. > If I wanted to avoid the user have to keep clicking, I suppose could put > an auto-refresh header thingy in the busy page HTML. (Good or bad > idea?) Bad idea (mostly). > Lastly, is there something more generic I could do using Filters? > Ideally I'd like to set up a "BusyFilter" that maps to the URL > pattern > > /servlet/apps/* > > Ideally this would display a busy page for any /servlet/apps... request > and require coding only in one place. Yes. You could implement the same pattern using filters. But filters are very complicated things and hard to get right (in retrospect I feel they were a mistake to include in the API). It would be easier to code the pattern as a helper class which you could easily use in your servlets that want this. Maybe extend HttpServlet if that takes your fancy. -- Nic Ferrier http://www.tapsellferrier.co.uk ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html